バイオシェル芸勉強会 2017/10/18

0bb9a9b44711b580d89954d8c7ddbc98?s=47 carushi
October 18, 2017

バイオシェル芸勉強会 2017/10/18

0bb9a9b44711b580d89954d8c7ddbc98?s=128

carushi

October 18, 2017
Tweet

Transcript

  1. ࡉ๔ϨϕϧͰγΣϧܳͯ͠Δʁ ࡉ๔ϨϕϧͰγΣϧܳͯ͠Δʁ @carushi

  2. ࣗݾ঺հ • Carushi - ๭ݚڀॴͰ๭όΠΦΠϯϑΥΛ͍ͯ͠ΔPD • Computational BiologyͰ3݄ʹPh.DΛͱΓ·ͨ͠ • ݱࡏɿ౷ܭΞϧΰϦζϜ։ൃɾػցֶशͰը૾ղੳ

    2
  3. ࡉ๔ϨϕϧͰ ࿀γΣϧܳ ͯ͠Δʁ 1. ࡉ๔ɾήϊϜʹࠁ·ΕͨຊೳʹैͬͯγΣϧܳΛ͢Δ͜ͱ 2. Ҩ఻ࢠൃݱσʔλ΍ήϊϜ഑ྻղੳͳͲʹγΣϧܳΛ༻͍Δ͜ͱ

  4. • ਓଟ͗͢Ͱ͸ʂʁ Śŕ ƅЧƅ㲇ƅЧƅ)ŵŢƄ? • ͱ͍͏͔ϓϩͷํʑͷલͰԿΛ͠Ό΂Ζ͏ʂʂʁ:(ʀƄƅ’Тƅ'): ࡉ๔ϨϕϧͰ࿀γΣϧܳͯ͠Δʁ γΣϧܳͱͷೃΕॳΊΛ͔ͨΓ·͢(✿◕ ‿◕ฺ)φ →

    ؾ߹͍ೖΕͯbashͷίʔυͷಡΈ௚͠ΛਐΊ͖ͯͨ • Bashͷmailcheck + cronɾat • ࣗ෼ͷਪ͔͠Β͍ͭ΋Ԡԉϝʔϧ͕͘ΔγεςϜͱ͔ • ͪΐͬͱؾ࣋ͪѱ͍
  5. γΣϧܳͱͷग़ձ͍͸ए͘ͳ͍͕·ͩ७ਅͩͬͨ೥ γΣϧܳͱͷͳΕͦΊ Αͬ͠ɺ7JSUVBM.BDIJOFͰ ͍ΖΜͳ04Λࢼͯ͠ΈΔ͔ʂ 6CVOUV͔͠஌Βͳֶ͔ͬͨੜ͕͍Ζ͍Ζௐ΂ͩ͢ʜ w -JOVYNJOU "SDI-JOVY 'SFF#4%ʜ w

    ˠ641ఏڙͷγΣϧܳ༻GSFF#4%؀ڥ5VLVCBJʹग़ձ͏ʂ
  6. γΣϧপʢʁʣ ʢγΣϧϓϩάϥϛϯά࣮༻ςΫχοΫ΋ങ͏ʣ

  7. ษڧձ౳Ͱ࣌୹ϫϯϥΠφʔʹ͍ͭͯ࿩͢ 7 $IFDL $IFDL ςʔϒϧɾFastqɾsam

  8. ͋Γ͕ͪͳಥવͷཪ੾Γ ύΠϓύΠϓύΠϓ….. seq 0 5 | xargs -I{} echo "samtools

    view -F 16 {}.bam | grep -v \”XS: \” | awk 'BEGIN{OFS='\t'}{if(length(\$10) >= 15) { print }}' | cut -f6,6 | grep \"^[0-9]*S\" | cut -f1,1 -d\"S\" | sort -n | uniq -c > {}_local.txt " | bash…
  9. ͋Γ͕ͪͳಥવͷཪ੾Γ ύΠϓʹΑΔϚϧνϓϩηεԽͷ͗͢͠Ͱ ڞ༻αʔόʔͷδϣϒ੍ݶʹҾ͔͔ͬΔ ్தͰ͚͜Δͱશ෦ύʔʹͳΔ ˠ΄ͲΑ͍͓෇͖߹͍ʹʜ

  10. ʢ࣮ྫʣBam/Samͷॲཧ • Bam/SamϑΝΠϧ • ࣍ੈ୅γʔέϯγϯά͔ΒಘΒΕͨDNA഑ྻ৘ใʢʴΫΦϦςΟͳͲʣ ͱɺήϊϜ্Ͱͦͷ഑ྻʹྨࣅ͢ΔҐஔͷ৘ใΛؚΉϑΝΠϧɻجຊλϒ ۠੾Γɻ 10 1൪໨ͷϦʔυɿ39Ԙج߹Θͳ͍ʴ48ԘجϚον ͜ͷҰ൪ࠨ୺ʹ͋Δ߹Θͳ͍Ԙجͷ਺Λ਺͍͑ͨ

    ͨͩ͠૬ิ࠯ʹٯ޲͖ͷ഑ྻʢ2ΧϥϜ໨Ͱ5Ϗοτ໨ཱ͕ͭʣʹؔͯ͠͸ӈ୺
  11. ࣮ྫʣBam/Samͷॲཧ 11 # github/carushi/RT_end_count/ࢀর samtools view -F 16 temp.bam \

    | gawk 'BEGIN{OFS="\t"}{if (NF == 3) {;} else if ($6 ~ / ^[0-9]*M/){ print 0 } else if ($6 ~ /^[0-9]*S/){print gensub(/ ^([0-9]*)S.*\$/, "\\1", "1", $6)} else {print "Error", $6}}'" • samtoolsͰ+࠯ʢਖ਼ํ޲ʣͷϦʔυͷΈΛऔΓग़͢ • gawkͰ • 1. ϔομʔ৘ใ͸ແࢹ • 2. ࠷ॳ͕਺ࣈͱϚονͰ࢝·͍ͬͯͨΒ0ϕʔεΛग़ྗ • 3. ࠷ॳ͕਺ࣈͱιϑτΫϦοϓͰ࢝·͍ͬͯͨΒɺ1൪໨ʹݟ͔ͭͬͨจࣈྻΛஔ ׵ͯ͠਺ࣈ෦෼ͷΈΛग़ྗ͢Δ • 4. ͦΕҎ֎͸Τϥʔใࠂ
  12. Ұ൪࢖͏γΣϧίϚϯυ LC_ALL=C tr '|' ‘\n' < ~/.zshistory | sed 's/^

    //g' | cut -f1 -d” “ \ | grep -v "=" | sort | uniq -c | sort -n (-r) ӫ͑͋ΔୈҐ͸ʜʂʁ
  13. 13 alias͸ͬͯΔls ࣗ෼ͷιϑτ make͗͢͠ macͷΑ͞open (xdg-open?) samtools ୈҐMFTTΦʔμʔ͕ҧ͏ಊʑҐ ୈҐDEɹଧͨͳͯ͘΋ྑ͍ͷʹ͍ͭ ୈҐMTɹBMJBTೖΕͨΒҐ

    ݁ہଧͭbash
  14. ༨ஊɿ࠷ۙͷγΣϧ؀ڥ • command line filtering: zsh+tmux+peco+ghq -> fzf΋ྑ͍… • unco:

    ਲͬ෷ͬͯ࡞ۀ͢Δͱ͖͸࢖͏΂͖ͩͳͱ਎ʹ͠Έͨ • pbpaste/pbcopy • Control + TʢControl + a, h, d, k, e, …ʣ • લޙͷจࣈΛೖΕସ͑Δʢtransposeʣ • sl -> lsʂ • macͰ͸ίϚϯυ࣮ߦதʹԡ͢ͱsnapshot ʢࠓͳΜͷίϚϯ υ͕࣮ߦ͞Ε͍ͯΔ͔ʣΛදࣔ͢Δ͜ͱ͕Ͱ͖Δ
  15. thank you for your attention! thank you for your attention!