Skip to content

Conversation

@stelzch
Copy link

@stelzch stelzch commented Apr 23, 2025

Previously, parsing errors in FASTA files were ignored and subsequent sequences quietly dropped. By checking the return value of the parsing routine, the program can now warn the user if illegal characters are encountered and refuses to continue.

Example alignment:

>Seq1
ATGC
>Seq2
AA.A
>Seq3
TGGC
>Seq4
GGGC

Before the patch

$ modeltest-ng -i test.fa
                             _      _ _            _      _   _  _____ 
                            | |    | | |          | |    | \ | |/ ____|
         _ __ ___   ___   __| | ___| | |_ ___  ___| |_   |  \| | |  __ 
        | '_ ` _ \ / _ \ / _` |/ _ \ | __/ _ \/ __| __|  | . ` | | |_ |
        | | | | | | (_) | (_| |  __/ | ||  __/\__ \ |_   | |\  | |__| |
        |_| |_| |_|\___/ \__,_|\___|_|\__\___||___/\__|  |_| \_|\_____|
--------------------------------------------------------------------------------
ModelTest-NG v0.2.0 released on 05.04.2021 by The Exelixis Lab.
Written by Diego Darriba.
Contributors: Tomas Flouri, Alexey Kozlov, Benoit Morel, David Posada, 
              Alexandros Stamatakis.
Latest version: https://github.com/ddarriba/modeltest
--------------------------------------------------------------------------------

[error] modeltest-ng: Cannot parse the msa: test.fas
[error]               [910]: There are 1 sequences, and there must be at least 3
Error: Invalid arguments
Try `modeltest-ng --help` for more information

The error occurs because we only have four sequences, if we had more all sequences after the error would be dropped quietly.

With the patch

./bin/modeltest-ng -i test.fa
                             _      _ _            _      _   _  _____ 
                            | |    | | |          | |    | \ | |/ ____|
         _ __ ___   ___   __| | ___| | |_ ___  ___| |_   |  \| | |  __ 
        | '_ ` _ \ / _ \ / _` |/ _ \ | __/ _ \/ __| __|  | . ` | | |_ |
        | | | | | | (_) | (_| |  __/ | ||  __/\__ \ |_   | |\  | |__| |
        |_| |_| |_|\___/ \__,_|\___|_|\__\___||___/\__|  |_| \_|\_____|
--------------------------------------------------------------------------------
ModelTest-NG v0.2.0 released on 05.04.2021 by The Exelixis Lab.
Written by Diego Darriba.
Contributors: Tomas Flouri, Alexey Kozlov, Benoit Morel, David Posada, 
              Alexandros Stamatakis.
Latest version: https://github.com/ddarriba/modeltest
--------------------------------------------------------------------------------

[error] modeltest-ng: Cannot parse the msa: test.fas
[error]               [10200]: illegal character '.' on line 4 in the fasta file
Error: Invalid arguments
Try `modeltest-ng --help` for more information

Previously, parsing errors in FASTA files were ignored and subsequent
sequences quietly dropped. By checking the return value of the parsing
routine, the program can now warn the user if illegal characters are
encountered and refuses to continue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant