def testCachedValidation(self): try: import dogpile.cache except: pass else: r = pathmap.get_test_repos() p = Phylesystem(r) nexson, sha = p.return_study('xy_10') r = p.add_validation_annotation(nexson, sha) cache_hits = p._cache_hits r1 = p.add_validation_annotation(nexson, sha) self.assertEqual(1 + cache_hits, p._cache_hits) self.assertEqual(r, r1) import sys; from peyotl import write_as_json; write_as_json(nexson, sys.stdout)
def testCachedValidation(self): try: # noinspection PyPackageRequirements import dogpile.cache except: pass else: r = pathmap.get_test_repos() p = Phylesystem(r) nexson, sha = p.return_study('xy_10') r = p.add_validation_annotation(nexson, sha) cache_hits = p._cache_hits r1 = p.add_validation_annotation(nexson, sha) self.assertEqual(1 + cache_hits, p._cache_hits) self.assertEqual(r, r1) write_as_json(nexson, sys.stdout)
def testCachedValidation(self): try: import dogpile.cache except: pass else: r = pathmap.get_test_repos() p = Phylesystem(r) nexson, sha = p.return_study('xy_10') r = p.add_validation_annotation(nexson, sha) cache_hits = p._cache_hits r1 = p.add_validation_annotation(nexson, sha) self.assertEqual(1 + cache_hits, p._cache_hits) self.assertEqual(r, r1) import sys from peyotl import write_as_json write_as_json(nexson, sys.stdout)
print study_id ''' study_id = sys.argv[1] tree_id = sys.argv[2] seqaln = sys.argv[3] mattype = sys.argv[4] runname = sys.argv[5] #Fixed values E_VALUE_THRESH = 0.04 ott_ncbi = "../ott_ncbi" #TODO config file Entrez.email = "*****@*****.**" phy = Phylesystem() n = phy.return_study(study_id)[0] api_wrapper.study.get(study_id, tree=tree_id) ##This is a weird way to get the ingroup node, but I need the OTT ids anyhow. m = extract_tree(n, tree_id, PhyloSchema('newick', output_nexml2json='1.2.1', content="tree", tip_label="ot:ottId"), subtree_id="ingroup") otu_dict = gen_otu_dict(n) ottids = [] for oid, o in otu_dict.items(): try: ottid = o[u'^ot:ottId']