Skip to content
Permalink
Newer
Older
100644 27 lines (20 sloc) 1.04 KB
Oct 18, 2018
1
#requries bcf tools, samtools, and bowtie2 (or other read mapper)
2
bowtie2-build ref.fasta refname
3
#makes bowtie index for reference genome
4
5
bowtie2 -x refname -1 read1.fq -2 read2.fq -U unpairedread.fq -S output.sam
6
#map reads back to reference genome for sam file
7
8
samtools view -bS output.sam > output.bam
9
#convert sam to bam
10
11
samtools sort output.bam -O output.sort.bam
12
#sort by genomic location
13
#need to do next step or the variant annotations are useless
14
samtools mpileup --min-BQ number 20-30 \
15
-f ref.fasta --BCF bamfromprevious.bam | \
16
bcftools call --consensus-caller \
17
--variants-only --pval-threshold 0.05 recommended -Ov -Ob > outputsvariants.bcf ;
18
#gets the variants from read mapping file
19
20
21
bcftools norm -m-any outputsvariants.bcf | bcftools norm -Ov --check-ref w -f ref.fasta > outputsvariants.vcf ;
22
#convert to vcf based off of alignment with refernce genome
23
24
25
bcftools view outputsvariants.vcf | vcfutils.pl varFilter -d 18 -w 1 -W 3 -a 1 \
26
-e 0.05 -p > outputsvariants.filtered.vcf ;
27
#filters those variants that don't meet a certain threshold
You can’t perform that action at this time.