| 1 | #!/bin/bash |
| 2 | |
| 3 | ## Written by Brian Bushnell |
| 4 | ## Last modified April 11, 2020 |
| 5 | ## Description: Summarizes all the runs of "processCorona.sh" in this directory. |
| 6 | ## Then tars them if you want to send them somewhere. |
| 7 | ## Should be run only after all samples are processed individually. |
| 8 | |
| 9 | ## Set minimum coverage for variant calls. |
| 10 | MINCOV=5 |
| 11 | |
| 12 | ## Specify the viral reference file. |
| 13 | ## NC_045512.fasta contains the SARS-CoV-2 genome, equivalent to bbmap/resources/Covid19_ref.fa |
| 14 | REF="NC_045512.fasta" |
| 15 | |
| 16 | ## Call variants in multisample mode to solve things. |
| 17 | ## This reports the genotype of *all* samples at any position at which a variant is called in *any* sample. |
| 18 | callvariants.sh *_deduped_trimclip.sam.gz ref="$REF" multisample out=allVars.vcf ow -Xmx4g usebias=f strandedcov minstrandratio=0 maf=0.6 minreads="$MINCOV" mincov="$MINCOV" minedistmax=30 minedist=16 flagnearby |
| 19 | |
| 20 | ## Make a summary of coverage at varous depth cutoffs for all libraries. |
| 21 | summarizecoverage.sh *basecov_border5.txt out=coverageSummary.txt |
| 22 | |
| 23 | mkdir output |
| 24 | cp *.sh output |
| 25 | cp *.bam* output |
| 26 | cp *.txt output |
| 27 | cp *.vcf output |
| 28 | cp *genome*.fa output |
| 29 | |
| 30 | rm results.tar |
| 31 | tar -cf results.tar output |