This module provides a Unix-like command `venn'. It has a function upon multiple files equivalently draw the Venn Diagam, although the output shape is quite different as summarized in a TSV table. =head1 DESCRIPTION venn ── 複数ã®é›†åˆã®ãƒ™ãƒ³å›³ã®ã‚ˆã†ã«æ•´ç†ã—ã¦è¡¨ç¤º  ベン図ã¯è¤‡æ•°ã®é›†åˆã®é–¢ä¿‚を示ã—ã¾ã™ã€‚2個ã‹3個ã®å††ã‚’é‡ãåˆã‚ã¦é›†åˆã®é‡ãªã‚Šã‚’示ã™å›³ã‚’æ•°å¦ã®æ•™ç§‘書ã§è¦‹ãŸã“ã¨ã¯ç„¡ã„ã§ã—ょã†ã‹ã€‚ ã“ã®ä¾‹ã§ã¯ã€ãƒ•ã‚¡ã‚¤ãƒ«ã‚’4個用æ„ã™ã‚‹ä»£ã‚ã‚Šã«ã€ãƒ—ãƒã‚»ã‚¹ç½®æ›ã‚’4個åŒæ™‚ã«ä½¿ã£ã¦å®Ÿé¨“ã—ã¦ã„ã¾ã™ã€‚ ã¾ãŸå®Ÿæ¼”用ã«è‡ªä½œã‚·ã‚§ãƒ«é–¢æ•°yã‚’ã“ã“ã§æœ€åˆã«å®šç¾©ã—ã¦ã„ã¾ã™(引数を1æ–‡å—ãšã¤ã°ã‚‰ã—ã¦ã€æ”¹è¡Œã‚’挿入ã™ã‚‹åƒãã‚’yã«æŒãŸã›ã¾ã™)。 $ function y(){ echo -n $* | perl -pe's/./$&\n/g' } # ↠Defined a shell function to demo the next. ↓ $ venn <(y ABCCCC) <(y AABDEF) <(y ABBDEF) <(y DEEEF) # Each <(...) means the process substitution. Each is treated as a file as the result of the contained command. Out follows next 4 lines: cardi. file1 file2 file3 file4 minstr maxstr 2. 2 3 3 0 'A' 'B' 1. 4 0 0 0 'C' 3. 0 3 3 5 'D' 'F'  ã“ã®ä¾‹ã§ã¯ã€ã‚ãŸã‹ã‚‚{A,B,C,C,C,C}ã¨{A,A,B,D,E,F}ã¨{A,B,B,D,E,F}ã¨{D,E,E,E,F}ã«ç›¸å½“ã™ã‚‹4個ã®ãƒ•ã‚¡ã‚¤ãƒ«ãŒã‚ã£ã¦ã€ ãã‚Œãžã‚Œã¯æ”¹è¡ŒåŒºåˆ‡ã‚Šã§1æ–‡å—ãšã¤æ ¼ç´ã•ã‚Œã¦ã„ã¾ã™ã€‚ãã®ã‚ˆã†ãªãƒ•ã‚¡ã‚¤ãƒ«ç¾¤(以下ã€fiel1〜4ã¨ã™ã‚‹)ãŒvennã«ä¸Žãˆã‚‰ã‚Œã¦ã„ã¾ã™ã€‚  ãã®å‡ºåŠ›ã¯æ¬¡ã®ã‚ˆã†ãªæ„味ã«ãªã‚Šã¾ã™ã€‚ A,B,C,D,E,Fã®6個ã®æ–‡å—列ã¯3個ã®ã‚°ãƒ«ãƒ¼ãƒ—ã«åˆ†å‰²ã•ã‚Œã¦ã€ A〜Bã¨ã€Cã¨ã€D〜Fã«ãªã‚Šã¾ã™(å³å´2列をå‚ç…§)。 ãã‚Œãžã‚Œã®ç•°ãªã‚‹è¦ç´ ã®æ•°ã¯2,1,3個ã§ã™(å·¦å´1列目ピリオド付ãã®æ•°ã‚’å‚ç…§)。 ãれらã¯file1〜4ã®ã©ã‚Œã«ã€Œå«ã¾ã‚Œã¦ã„ã‚‹ã‹ï¼å«ã¾ã‚Œãªã„ã‹ã€ã®ãƒ‘ターン㌠ä¸ã®4列ã§ã€Œ0ã§ã‚ã‚‹ã‹ï¼0以外ã®æ•°ã§ã‚ã‚‹ã‹ã€ã§ç¤ºã—ã¾ã™ã€‚ 0以外ã®æ•°ã§ã‚ã‚‹å ´åˆã«ãã®æ•°ã¯ã€ 「文å—列ãŒã®ã¹ä½•å›žå«ã¾ã‚Œã¦ã„ã‚‹ã‹ã€ã‚’3グループ×4ファイルã®å…¨çµ„åˆã›ã”ã¨ã«ç¤ºã—ã¾ã™ã€‚ 最åˆã«æ›¸ã„ãŸã€Œ3パターンã€ã¨ã¯ã€ç•°ãªã‚‹6通りã®A〜Fã®æ–‡å—列ã®ãã‚Œãžã‚Œã«ã¤ã„ã¦4ファイルã«ã€Œç¾ã‚ŒãŸã‹ï¼å¦ã‹ã€ã‚’「1ï¼0ã€ã§ 表ç¾ã—ãŸã¨ãã«ã€Aã¯1110ã€Bã¯1110ã€Cã¯1000ã€Dã¯0111ã€Eã¯0111ã€Fã¯0111ã¨ãªã£ã¦ã€ã“れら6パターンã¯ç•°ãªã‚‹3ãƒã‚¿ãƒ¼ãƒ³ã« 分類出æ¥ã¦ã€ãã®åˆ†é¡žã‚’å„グループã¨ã—ã¦ã„ãŸã®ã§ã—ãŸã€‚  ã“ã®ã‚³ãƒžãƒ³ãƒ‰vennã¯ã€å¤šæ•°ã®ãƒ•ã‚¡ã‚¤ãƒ«ã«å¯¾ã—ã¦ã€ 値ã®åŒ…å«é–¢ä¿‚ã‚„é‡ãªã‚Šã‚’一目ã§æŠŠæ¡ã™ã‚‹ã®ã«ä¾¿åˆ©ã§ã™ã€‚ 上記ã®ä¾‹ã ã¨ã€ Cã¨D〜Fã¯åŒã˜ãƒ•ã‚¡ã‚¤ãƒ«ã«å‡ºç¾ã—ãªã„事ãŒ0ã®ãƒ‘ターンã‹ã‚‰èªã¿å–ã‚Œã¾ã™ã—〠file1ã®æŒã¤2+1+0=3個ã®æ–‡å—列ã¨file4ã®0+0+5=5個㮠文å—列ã¯ã€ 共通部分ãŒç„¡ã„ã“ã¨ãŒ0ã®å‡ºç¾ãƒ‘ターンã‹ã‚‰èªã¿å–ã‚Œã¾ã™ã€‚ ä»–ã€ãŸã¨ãˆã°Cã¨ã„ã†æ–‡å—列ã¯ã€file1ã®ã¿ã«ãれ以外ã«ç¾ã‚Œãšã€ ãã—ã¦ãã®ã‚ˆã†ãªå‡ºç¾ãƒ‘ターンを示ã™ã®ã¯æ–‡å—列ã¯Cã®ã¿ã«é™ã‚Šã€å‡ºç¾å›žæ•°ã¯4+0+0+0=4ã§ã‚ã‚‹ã“ã¨ã‚‚èªã¿å–ã‚Œã¾ã™ã€‚  ã“ã®vennã¯å®Ÿå‹™ã§ä½¿ã†ã¨éžå¸¸ã«ä¾¿åˆ©ã§ã€è¤‡æ•°ãƒ•ã‚¡ã‚¤ãƒ«ã«ç¾ã‚Œã‚‹ãƒ‡ãƒ¼ã‚¿ã®é‡ãªã‚Šå…·åˆã«ã¤ã„ã¦ã€å¤šãã®çŸ¥è¦‹ãŒä¸€ç›®ã§å¾—られã¾ã™ã€‚ Copyright (c) 2021 Toshiyuki SHIMONO. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.