nextstrain / tb

Nextstrain build for tuberculosis
https://nextstrain.org/tb
2 stars 7 forks source link

Bug in refine step #1

Closed trvrb closed 5 years ago

trvrb commented 5 years ago

@emmahodcroft ---

I was just working through the tb tutorial here at https://nextstrain.org/docs/getting-started/tb-tutorial. With my local version of augur (on master) and with the lastest version of the Docker image from the CLI (augur version 3.0.5.dev1) I'm getting the following error:

nextstrain:/nextstrain/build $ augur refine \
>     --tree results/tree_raw.nwk \
>     --alignment results/masked.vcf.gz \
>     --vcf-reference data/ref.fasta \
>     --metadata data/meta.tsv \
>     --timetree \
>     --root residual \
>     --coalescent opt \
>     --output-tree results/tree.nwk \
>     --output-node-data results/branch_lengths.json

Inferred a time resolved phylogeny using TreeTime:
    Sagulenko et al. TreeTime: Maximum-likelihood phylodynamic analysis
    Virus Evolution, vol 4, https://academic.oup.com/ve/article/4/1/vex042/4794731

Traceback (most recent call last):
  File "/usr/bin/augur", line 11, in <module>
    load_entry_point('nextstrain-augur', 'console_scripts', 'augur')()
  File "/nextstrain/augur/augur/__main__.py", line 10, in main
    return augur.run( argv[1:] )
  File "/nextstrain/augur/augur/__init__.py", line 61, in run
    return args.__command__.run(args)
  File "/nextstrain/augur/augur/refine.py", line 189, in run
    node_data['clock'] = {'rate': tt.date2dist.clock_rate,
AttributeError: 'NoneType' object has no attribute 'clock_rate'

Are you able to reproduce this?

BTW I've made a Travis build here: https://travis-ci.com/nextstrain/tb that reproduces this behavior.

emmahodcroft commented 5 years ago

@trvrb, unfortunately I don't seem able to reproduce this error on my work computer. I'm also running augur 3.0.5.dev1, and worked through the tutorial from scratch (without CLI or conda). I've got the latest TreeTime, but installed from source, not via PyPi (if that might make a difference).

I can try to reproduce on my home computer, which is where I've done most of the tutorial testing (thus has augur via conda and PyPi TreeTime). It seems like something's going wrong in TreeTime. @rneher would you mind running the first few steps of the tutorial to see if you can reproduce?

rneher commented 5 years ago

I can't reproduce it either. runs fine on the cluster here, on my laptop both using snakemake and nextstrain build --native . haven't tried docker. The likely issue is that the treetime step failed. refine doesn't catch treetime errors and suppresses treetime output. If you change verbose to 3 or 4, there should be a lot more treetime output that will pin down the place where it breaks.

trvrb commented 5 years ago

Commit 45f7803734d5e8a517de07447253ad44010689f2 fixes the issue for me. May be good to investigate why residual is not working at some point, but I think good to fix the bug. I heard from someone else (student in another lab at the Hutch) that they couldn't get through the TB tutorial due to this issue.

tsibley commented 5 years ago

https://github.com/neherlab/treetime/commit/c3a435a removed residual from the valid values for root, among other changes to argument handling, although the commit doesn't say why.

I can reproduce this using nextstrain build . with the following versions:

nextstrain.cli 1.7.1
nextstrain/base:build-20181207T204900Z docker image 144f85f20fd7 (2018-12-07 12:55:40 -0800 PST)
  sacra abd1186
  fauna 0beaaa0
  augur 3.0.5.dev1
  auspice v1.34.2

TreeTime is 0.5.2 inside the container.