This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to handle gaps in consensus sequence construction from multiple sequence alignment

I am writing a function which takes aligned sequences, and outputs a consensus sequence using IUPAC ambiguous nucleotides. I am unsure how to handle assignment at a given position if gaps are the mode character. Here is an example.

Sequence 0    G-ATGT
Sequence 1    G-ATGT
Sequence 2    G-ATGT
Sequence 3    GCATGT

What would the appropriate consensus sequence in this case be?

msa gaps consensus-sequence

2 answers

Look at how sequence logos are built. Some advice can be found here.

I think the two best options for this are:

PROSITE pattern notation may be better known by biologists, whereas regular expressions are more useful for bioinformaticians in my opinion.

Log in to answer this question.