I would like to generate a consensus based on mapping reads to a reference, but samtools doesn't fill in gaps or deal well with indels. Is there a good alternative available?
I would like to generate a consensus based on mapping reads to a reference, but samtools doesn't fill in gaps or deal well with indels. Is there a good alternative available?
as far as I know, to extract a consensus from mapping reads you must use a variant caller such as samtools' pileup, since what it does is not only to call the variants found, but to generate a "modified reference sequence" which is in fact the consensus of all your reads.
the fact that samtools' pileup doesn't deal with with indels could be solved with other variant caller, like GATK for instance, but unfortunately I don't know of any other that would fill the gaps where no reads are found. I think that lh3 is right, and that you have to write your own either from scratch (I wouldn't go that far) or by filling manually the gaps extracting the needed portions of the reference sequence for the missing gaps.
Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
So far as I know, you have to write your own.
Take a look here to see if this is what you are looking for.