Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/src/msa_op.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,13 +348,21 @@ int convert_msa_to_internal(struct msa* msa, int type)

t = a->to_internal;
msa->L = a->L;
int unknown = 0;
if (t[(int)'X'] != -1) {
unknown = t[(int)'X'];
} else if (t[(int)'N'] != -1) {
unknown = t[(int)'N'];
}

for(i = 0; i < msa->numseq;i++){
seq = msa->sequences[i];
for(j =0 ; j < seq->len;j++){
if(t[(int) seq->seq[j]] == -1){
WARNING_MSG("there should be no character not matching the alphabet");
WARNING_MSG("offending character: >>>%c<<<", seq->seq[j]);
WARNING_MSG("offending character: >>>%c<<<, replacing internal alphabet value: %d with unknown: %d", seq->seq[j], seq->s[j], unknown);
/* exit(0); */
seq->s[j] = unknown;
}else{
seq->s[j] = t[(int) seq->seq[j]];
}
Expand Down