Question: Variant calling by using samtools and bcftools
gravatar for hasani.iut6
13 months ago by
Iran, Islamic Republic Of
hasani.iut640 wrote:

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?

ADD COMMENTlink modified 9 weeks ago by Lakshman Teja40 • written 13 months ago by hasani.iut640
gravatar for ATpoint
13 months ago by
ATpoint29k wrote:

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 COMMENTlink written 13 months ago by ATpoint29k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1034 users visited in the last hour