Skip to content

Commit

Permalink
command line args
Browse files Browse the repository at this point in the history
  • Loading branch information
snacktavish committed Apr 27, 2020
1 parent c6bbef6 commit 04329d0
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
31 changes: 31 additions & 0 deletions bin/opentree_scrape.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env python
import argparse
import sys
import physcraper
from physcraper.opentree_helpers import scraper_from_opentree

parser = argparse.ArgumentParser()
parser.add_argument("-s","--study_id", help="OpenTree study id")
parser.add_argument("-t","--tree_id", help="tree id")
parser.add_argument("-a","--alignment", help="path to alignment")
parser.add_argument("-as","--aln_schema", help="alignment schema (nexus or fasta)")
parser.add_argument("-o","--output", help="path to output directory")


args = parser.parse_args()



# Create an 'scraper' object to get data from NCBI, align it an
scraper = scraper_from_opentree(study_id =args.study_id,
tree_id = args.tree_id,
alnfile = args.alignment,
aln_schema = args.aln_schema,
workdir = args.output)

sys.stdout.write("{} taxa in alignment and tree\n".format(len(scraper.data.aln)))


#scraper.read_blast_wrapper()
scraper.est_full_tree()
scraper.data.write_labelled(label='^ot:ottTaxonName')
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
author='Emily Jane McTavish',
author_email='ejmctavish@gmail.com',
packages=['physcraper'],
scripts=['bin/opentree_scrape.py'],
install_requires=[]
)

0 comments on commit 04329d0

Please sign in to comment.