Reference Mapping To Consensus Fasta
1
3
Entering edit mode
12.0 years ago
Juliofdiaz ▴ 140

I have mapped illumina reads to a reference fasta. I can visualize the map using the tview tool of samtools or CLC genomics. I already have the bam file of the mapping and it is sorted as well. I also have the mpileup file. Is there a way to get the "assembled" reads in a fasta format? For example if my reference and the mapping looks like this

    ref ATGCATGC
        ...A
         ..A...
           A....
             ...

and position 4 is recognized as a SNP. Can I get a fasta that looks like this:

>result
ATGAATGC

Also will it take gaps into account? Thanks

contigs bwa fasta • 4.6k views
ADD COMMENT
0
Entering edit mode

Why do you want to do this? What analyses would you use this for? Going from SNVs to FASTA requires some assumptions that could bias subsequent analyses.

ADD REPLY
0
Entering edit mode

I wanted to BLAST MLST genes to the consensus sequence. Do you think its better to map my reads to the sequence of the MLST genes?

ADD REPLY
0
Entering edit mode

@Juliofdiaz Did you find the solution? I have a similar problem posted here.

ADD REPLY
3
Entering edit mode
12.0 years ago

As far as I can see, samtools has you covered. From the man page, under "Generate the consensus sequence for one diploid individual:"

samtools mpileup -uf ref.fa aln.bam | bcftools view -cg - | vcfutils.pl vcf2fq > cns.fq

ADD COMMENT

Login before adding your answer.

Traffic: 2565 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