Question: Consensus sequence with characters apart from ATGC
0
gravatar for sambioinfo2018
9 months ago by
sambioinfo20180 wrote:

Dear All,

I have aligned the reads to the reference genome using Bowtie2. The generated sam was then converted to bam and sorted. The sorted file using the following command i tried to generate consensus sequence:

samtools mpileup -uf ref.fa aligned_sorted.bam | bcftools call -c | vcfutils.pl vcf2fq > aligned.fasta

However, a fasta file is generated. Viewing the tail of the file i get the follwoing:

HEHHHHHEHEEHEBBEBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
BBBBBBBEEEEEEHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHEHHHH
HHHHHHHHHHHHHHHEEEHHHEHHCCC@CCC@CEEEEEEEEEEECEEEEEEEEEEHHHHH
EHHHHHHHHHHHHHHHHHHHHHHHEHHKKKKKKKKKKKHEEEHECEEEEEEEECCEEEEE
EEEEEEEEEEEEEEEEHHHHHHHEKHHKKHKNNNNNQQQQNQQQNQNQQQQQQQTQTTQQ
TQQTQQQQQQNQQHNTTTTTTTTTTTQQQQNQQQQQQQQQQQQQQQQNQQQQQQQQQTQQ
QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQNNNNQQQQKKKKK
KKKKKKKHHHHHHHHHHHHHHHHEEEEEEEEEEEEEEEEEEEEEEEBBBBBBBBBBBBEE
EEEEEEEEEEEEEEEEEEEEEEEEEEEECCCCCCCCCFFFFFFFFFFFFFFFFFFFFFFF
FFFFFFFFFFFFFFFFFFFFFFCCCCCCCC

What does this mean. I expected the file to have charcaters 'ATGC'

Thanks in advance..

Regards, sam

next-gen • 357 views
ADD COMMENTlink modified 9 months ago by finswimmer11k • written 9 months ago by sambioinfo20180

Is this base quality ?

Your last command is vcfutils.pl vcf2fq, so you get a fastq file

ADD REPLYlink modified 9 months ago • written 9 months ago by Bastien HervĂ©4.2k

Thanks Bastien for your reply. But why is base quality printed in a consensus fasta file. I would like to use this fasta file for further analysis.

ADD REPLYlink written 9 months ago by sambioinfo20180
0
gravatar for finswimmer
9 months ago by
finswimmer11k
Germany
finswimmer11k wrote:

Hello,

if you like to have a consensu fasta you have to use bcftools consensus.

Furthermore which version of bcftools/samtools are you using. Since v1.9 samtools mpileup is deprecated and bcftools mpileup should be used instead, see:

Note that using "samtools mpileup" to generate BCF or VCF files is now
deprecated.  To output these formats, please use "bcftools mpileup" instead

fin swimmer

ADD COMMENTlink modified 9 months ago • written 9 months ago by finswimmer11k

Thanks finswimmer. i am using samtools v1.8 and bcftools v1.8. So should i use the following command to generate the consensus sequence:

bcftools mpileup -Ou -f reference.fa alignments.bam | bcftools call -mv -Oz -o calls.vcf.gz
tabix calls.vcf.gz

cat reference.fa | bcftools consensus calls.vcf.gz > consensus.fa

Thanks!

ADD REPLYlink written 9 months ago by sambioinfo20180

Or do you have the better way to do the same?

ADD REPLYlink written 9 months ago by sambioinfo20180

Looks fine to me.

You could think about to output bcftools call to compressed bcf and indexing with bcftools index.

I prefer to use the -f option instead of piping the reference to bcftools consensus.

fin swimmer

ADD REPLYlink written 9 months ago by finswimmer11k

Thanks Fin for your help!

ADD REPLYlink written 9 months ago by sambioinfo20180
Please log in to add an answer.

Help
Access

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