Created
March 20, 2019 23:09
-
-
Save jodyphelan/c26862404bc05c4e3129d22d8f4bb4e4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get data | |
wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR209/009/SRR2099969/SRR2099969_1.fastq.gz | |
wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/SRR209/009/SRR2099969/SRR2099969_2.fastq.gz | |
wget ftp://ftp.ensemblgenomes.org/pub/release-32/bacteria//fasta/bacteria_0_collection/mycobacterium_tuberculosis_h37rv/dna/Mycobacterium_tuberculosis_h37rv.ASM19595v2.dna.toplevel.fa.gz | |
gunzip Mycobacterium_tuberculosis_h37rv.ASM19595v2.dna.toplevel.fa.gz | |
mv Mycobacterium_tuberculosis_h37rv.ASM19595v2.dna.toplevel.fa H37Rv.fa | |
# Get software | |
wget https://github.com/samtools/samtools/releases/download/1.9/samtools-1.9.tar.bz2 && tar -xvf samtools-1.9.tar.bz2 && cd samtools-1.9/ && make && cd .. | |
wget https://github.com/BenLangmead/bowtie2/releases/download/v2.3.5/bowtie2-2.3.5-linux-x86_64.zip && unzip bowtie2-2.3.5-linux-x86_64.zip | |
git clone https://github.com/lh3/bwa.git && cd bwa && make && cd ../ | |
# Mapping | |
./bowtie2-2.3.5-linux-x86_64/bowtie2-build H37Rv.fa H37Rv.fa | |
./bwa/bwa index H37Rv.fa | |
./bwa/bwa mem -t 20 H37Rv.fa SRR2099969_1.fastq.gz SRR2099969_2.fastq.gz | ./samtools-1.9/samtools view -@ 20 -b - | ./samtools-1.9/samtools sort -@ 20 -o SRR2099969_bwa.bam - | |
./samtools-1.9/samtools index SRR2099969_bwa.bam | |
./bowtie2-2.3.5-linux-x86_64/bowtie2 -p 20 -x H37Rv.fa -1 SRR2099969_1.fastq.gz -2 SRR2099969_2.fastq.gz | ./samtools-1.9/samtools view -@ 20 -b - | ./samtools-1.9/samtools sort -@ 20 -o SRR2099969_bowtie.bam - | |
./samtools-1.9/samtools index SRR2099969_bowtie.bam | |
# Check coverage from bwa BAM | |
samtools stats SRR2099969_bwa.bam Chromosome:10-11 | grep ^COV | |
# Check coverage from bowtie BAM | |
samtools stats SRR2099969_bowtie.bam Chromosome:10-11 | grep ^COV | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment