nextstrain / fauna

RethinkDB database to support real-time virus analysis
GNU Affero General Public License v3.0
33 stars 13 forks source link

Move date selection function #96

Closed barneypotter24 closed 5 years ago

barneypotter24 commented 5 years ago

This PR moves the function rethinkdb_date_greater from the end of the vdb/download.py to the beginning, so that it is in scope when the download is called.

This fixes an error when the --interval flag was used for virus downloads in which rethinkdb_date_greater could not be found by add_intervals_command.

@huddlej would you mind taking a look at this just to let me know if this has been moved to the most appropriate location? The (previously broken) command that I have been using to run is:

python3 vdb/download.py --database vdb \
     --virus flu \
     --fasta_fields strain virus accession collection_date region country division \
           location passage_category submitting_lab age gender \
     --resolve_method split_passage \
     --select locus:na lineage:seasonal_h3n2 \
     --interval collection_date:2016-03-30,2018-04-31 \
     --path data \
     --fstem h3n2_na