Variant calling by using samtools and bcftools
2
0
Entering edit mode
5.9 years ago
hasani.iut6 ▴ 60

Hi all

I want to do variant calling by using samtools and bcftools. As the pipelines that I found on the internet, I should run the following commands:

1. samtools view -bS aligned.sam > aligned.bam
2. samtools sort aligned.bam  aligned_sorted
3. samtools faidx genome.fasta
4. samtools mpileup -I -u -f genome.fasta aligned_sorted.bam > pileup.bcf
5. bcftools call -cv pileup.bcf > variant.bcf

In the second command, I face with the following error

[bam_sort] Use -T PREFIX / -o FILE to specify temporary and final output files

and for fixing that I use following command:

samtools sort aligned.bam > aligned_sorted

but I think that it is not right and it disrupts the pipeline. (although the pipeline can runs until end)

And I have another problem. How can I reports the reads Id in the varinat.bcf file?

variant calling samtools bcftools • 4.5k views
ADD COMMENT
1
Entering edit mode
5.9 years ago
ATpoint 85k

You have to redirect the output of sort to a file, be it either with the -o option or save stdout to disk with >. sort also accepts SAM files so there is no need for the view command. Do either of these two:

samtools sort -o aligned_sorted.bam aligned.sam
samtools sort -O BAM aligned.sam > aligned_sorted.bam
ADD COMMENT

Login before adding your answer.

Traffic: 1291 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6