nextstrain / augur

Pipeline components for real-time phylodynamic analysis
https://docs.nextstrain.org/projects/augur/
GNU Affero General Public License v3.0
268 stars 129 forks source link

Error in traits.py when running with small data sample #715

Closed ArnieBerg closed 2 years ago

ArnieBerg commented 3 years ago

I am running in Augur 12 and when I run with a data sample of only five items, traits.py reports a warning that only one state exists, which is true. However it errors on line 179 unless the following change is made near line 64:

Change:

    for node in T.find_clades():
        node.__setattr__(field, unique_states[0])
    return T, None, {}

to:

    for node in T.find_clades():
        node.__setattr__(field, unique_states[0])
        node.__setattr__(field + "_entropy", 0)
        node.__setattr__(field + "_confidence", [.01])
    return T, None, {}

There may be a more elegant fix, but this worked for me!

huddlej commented 3 years ago

Thank you for reporting this, @ArnieBerg! I've transferred this issue to the Augur repository, since it's a bug in our bioinformatics toolkit and not the command line interface (nextstrain-cli) for running analyses.

Would you be able to provide your example dataset and/or the full error message you get? That would help us recreate the bug and confirm that a proposed solution will fix it.

ArnieBerg commented 3 years ago

The only data files changed are those attached, which can be found in the data and defaults folders of ncov. Basically, what I did is quite straightforward. I retained five items from the fasta file, made sure they were matched in the metadata file, and updated the exclude, include and parameters.yaml files to reflect these changes.

Other than the change to the traits.py code file, the rest is vanilla.

Arnie Berg

From: John Huddleston @.> Sent: Friday, April 16, 2021 12:13 PM To: nextstrain/augur @.> Cc: Arnie Berg @.>; Mention @.> Subject: Re: [nextstrain/augur] Error in traits.py when running with small data sample (#715)

Thank you for reporting this, @ArnieBerg https://github.com/ArnieBerg ! I've transferred this issue to the Augur repository, since it's a bug in our bioinformatics toolkit and not the command line interface (nextstrain-cli) for running analyses.

Would you be able to provide your example dataset and/or the full error message you get? That would help us recreate the bug and confirm that a proposed solution will fix it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nextstrain/augur/issues/715#issuecomment-821390865 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AFQ724NBTOXGPU5XKGPY3NDTJB44TANCNFSM43B7SPSA .

Reference

MN908947