Created
June 25, 2019 20:35
-
-
Save jodyphelan/cbb8e2137d9a30ff8f567e5f78cc37ab 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
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/samtools/bcftools/releases/download/1.9/bcftools-1.9.tar.bz2 && tar -xvf bcftools-1.9.tar.bz2 && cd bcftools-1.9/ && make && cd .. | |
git clone https://github.com/lh3/bwa.git && cd bwa && make && cd ../ | |
wget https://github.com/dellytools/delly/releases/download/v0.8.1/delly_v0.8.1_linux_x86_64bit && chmod 755 delly_v0.8.1_linux_x86_64bit | |
# Mapping and variant calling | |
./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.bam - | |
./samtools-1.9/samtools index SRR2099969.bam | |
./delly_v0.8.1_linux_x86_64bit call -g H37Rv.fa -t DEL -o SRR2099969.bcf SRR2099969.bam | |
./bcftools-1.9/bcftools view -i '(RV/(RR+RV))>0.7 || (DV/(DR+DV))>0.7 ' SRR2099969.bcf | ./bcftools-1.9/bcftools view -i '(END-POS)<50000' > SRR2099969.filt.vcf | |
# Extracting from VCF | |
./bcftools-1.9/bcftools query -f '%POS\t%END\n' SRR2099969.filt.vcf | |
# Extracting from BCF | |
./bcftools-1.9/bcftools view SRR2099969.filt.vcf -Ob -o SRR2099969.filt.bcf | |
./bcftools-1.9/bcftools query -f '%POS\t%END\n' SRR2099969.filt.bcf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment