Samtools
Setup output directory.
Code Block |
---|
mkdir samtools |
...
Produces output.vcf from Bowtie and output.vcf from BWA.
Move all 3 bam files and all 3 vcf files to lonestar
introduce bedtools.
Developing a pipeline.
Entering all these commands to first create an alignment and then using Samtools to create a VCF format quickly becomes tedious... Let's create a simple bashscript to streamline things.
Mapping with Bowtie:
Code Block |
---|
#!/usr/bin/env bash #Bowtie. mkdir bowtie bp_seqconvert --from genbank --to fasta <REL606.5.gbk > bowtie/REL606.5.fasta bowtie-build bowtie/REL606.5.fasta bowtie/REL606.5 bowtie -t --sam bowtie/REL606.5 -1 SRR030257_1.fastq -2 SRR030257_2.fastq bowtie/REL606.5.sam #Samtools mkdir samtools cp bowtie/REL606.5.sam samtools/ cp bowtie/REL606.5.fasta samtools/ samtools faidx samtools/REL606.5.fasta samtools view -bS -o samtools/REL606.5.bam bowtie/REL606.5.sam samtools sort samtools/REL606.5.bam samtools/sorted_REL606.5 samtools mpileup -uf samtools/REL606.5.fasta samtools/sorted_REL606.5.bam \|bcftools view -vcg - \> samtools/output.vcf |
Mapping with BWA:
Code Block |
---|
#!/usr/bin/env bash
#BWA
mkdir -p bwa
bp_seqconvert --from genbank --to fasta <REL606.5.gbk > bwa/REL606.5.fasta
bwa index bwa/REL606.5.fasta
bwa aln -f bwa/SRR030257_1.sai bwa/REL606.5.fasta SRR030257_1.fastq
bwa aln -f bwa/SRR030257_2.sai bwa/REL606.5.fasta SRR030257_2.fastq
bwa sampe -f bwa/REL606.5.sam bwa/REL606.5.fasta bwa/SRR030257_1.sai bwa/SRR030257_2.sai SRR030257_1.fastq SRR030257_2.fastq
#Samtools
mkdir samtools
cp bwa/REL606.5.sam samtools/
cp bwa/REL606.5.fasta samtools/
samtools faidx samtools/REL606.5.fasta
samtools view -bS -o samtools/REL606.5.bam bwa/REL606.5.sam
samtools sort samtools/REL606.5.bam samtools/sorted_REL606.5
samtools mpileup -uf samtools/REL606.5.fasta samtools/sorted_REL606.5.bam \|bcftools view -vcg - \> samtools/output.vcf
|