| 1 | #!/bin/bash |
| 2 | set -e |
| 3 | |
| 4 | TAXPATH="auto" |
| 5 | |
| 6 | #Fetch |
| 7 | wget -nv http://ftp.arb-silva.de/release_132/Exports/SILVA_132_SSURef_tax_silva_trunc.fasta.gz |
| 8 | wget -nv http://ftp.arb-silva.de/release_132/Exports/SILVA_132_LSURef_tax_silva_trunc.fasta.gz |
| 9 | |
| 10 | #Process LSU |
| 11 | time reformat.sh in=SILVA_132_LSURef_tax_silva_trunc.fasta.gz out=lsu_utot.fa.gz fastawrap=4000 utot zl=9 qtrim=rl trimq=1 ow minlen=80 pigz=20 |
| 12 | time clumpify.sh in=lsu_utot.fa.gz reorder groups=1 -Xmx31g fastawrap=4000 out=lsu_clumped.fa.gz zl=9 pigz=20 |
| 13 | time rename.sh addprefix prefix="lcl\|LSU" in=lsu_clumped.fa.gz out=lsu_prefix.fa.gz pigz=20 zl=9 fastawrap=4000 |
| 14 | time gi2taxid.sh -Xmx8g tree=auto in=lsu_prefix.fa.gz out=lsu_renamed.fa.gz silva zl=9 pigz=20 taxpath=$TAXPATH |
| 15 | time sortbyname.sh -Xmx31g in=lsu_renamed.fa.gz out=lsu_sorted.fa.gz ow taxa tree=auto fastawrap=4000 zl=9 pigz=20 allowtemp=f taxpath=$TAXPATH |
| 16 | time dedupe.sh in=lsu_sorted.fa.gz out=lsu_deduped100pct.fa.gz zl=9 pigz=20 ordered fastawrap=4000 |
| 17 | |
| 18 | #Process SSU |
| 19 | time reformat.sh in=SILVA_132_SSURef_tax_silva_trunc.fasta.gz out=ssu_utot.fa.gz fastawrap=4000 utot zl=9 qtrim=rl trimq=1 ow minlen=80 pigz=20 |
| 20 | time clumpify.sh in=ssu_utot.fa.gz reorder groups=1 -Xmx31g fastawrap=4000 out=ssu_clumped.fa.gz zl=9 pigz=20 |
| 21 | time rename.sh addprefix prefix="lcl\|SSU" in=ssu_clumped.fa.gz out=ssu_prefix.fa.gz pigz=20 zl=9 fastawrap=4000 |
| 22 | time gi2taxid.sh -Xmx8g tree=auto in=ssu_prefix.fa.gz out=ssu_renamed.fa.gz silva zl=9 pigz=20 taxpath=$TAXPATH |
| 23 | time sortbyname.sh -Xmx31g in=ssu_renamed.fa.gz out=ssu_sorted.fa.gz ow taxa tree=auto fastawrap=4000 zl=9 pigz=20 allowtemp=f taxpath=$TAXPATH |
| 24 | time dedupe.sh in=ssu_sorted.fa.gz out=ssu_deduped_sorted.fa.gz zl=9 pigz=20 ordered fastawrap=4000 |
| 25 | #time sortbyname.sh -Xmx31g in=ssu_deduped100pct.fa.gz out=ssu_deduped_sorted.fa.gz ow taxa tree=auto fastawrap=4000 zl=9 pigz=20 allowtemp=f |
| 26 | |
| 27 | #Merge LSU and SSU |
| 28 | cat ssu_sorted.fa.gz lsu_sorted.fa.gz > both_sorted_temp.fa.gz |
| 29 | time sortbyname.sh -Xmx31g in=both_sorted_temp.fa.gz out=both_sorted.fa.gz ow taxa tree=auto fastawrap=4000 zl=9 pigz=20 allowtemp=f taxpath=$TAXPATH |
| 30 | rm both_sorted_temp.fa.gz |
| 31 | cat ssu_deduped_sorted.fa.gz lsu_deduped_sorted.fa.gz > both_deduped_sorted_temp.fa.gz |
| 32 | time sortbyname.sh -Xmx31g in=both_deduped_sorted_temp.fa.gz out=both_deduped_sorted.fa.gz ow taxa tree=auto fastawrap=4000 zl=9 pigz=20 allowtemp=f taxpath=$TAXPATH |
| 33 | rm both_deduped_sorted_temp.fa.gz |
| 34 | filterbytaxa.sh include=f in=both_deduped_sorted.fa.gz id=2323,256318,12908 tree=auto requirepresent=f out=both_deduped_sorted_no_unclassified_bacteria.fa.gz zl=9 fastawrap=9999 ow |
| 35 | |
| 36 | #Sketch steps |
| 37 | time sketchblacklist.sh -Xmx16g in=both_deduped_sorted_no_unclassified_bacteria.fa.gz prefilter=f tree=auto taxa silva taxlevel=species ow out=blacklist_silva_species_500.sketch mincount=500 |
| 38 | time sketchblacklist.sh -Xmx16g in=both_deduped_sorted_no_unclassified_bacteria.fa.gz prefilter=f tree=auto taxa silva taxlevel=genus ow out=blacklist_silva_genus_200.sketch mincount=200 |
| 39 | time mergesketch.sh -Xmx1g in=blacklist_silva_species_500.sketch,blacklist_silva_genus_200.sketch out=blacklist_silva_merged.sketch |
| 40 | time sketch.sh files=31 out=both_taxa#.sketch in=both_deduped_sorted.fa.gz size=200 maxgenomefraction=0.1 -Xmx8g tree=auto mode=taxa ow silva blacklist=blacklist_silva_merged.sketch autosize ow |
| 41 | |
| 42 | time sketch.sh files=31 out=both_seq#.sketch in=both_deduped_sorted.fa.gz size=200 maxgenomefraction=0.1 -Xmx8g tree=auto mode=sequence ow silva blacklist=blacklist_silva_merged.sketch autosize ow parsesubunit |
| 43 | |
| 44 | cp blacklist_silva_merged.sketch /global/projectb/sandbox/gaag/bbtools/jgi-bbtools/resources/ |