Skip to content

Commit

Permalink
smaller updates
Browse files Browse the repository at this point in the history
  • Loading branch information
mkandziora committed Nov 27, 2018
1 parent cf0f15d commit 1093d92
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
10 changes: 7 additions & 3 deletions physcraper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2177,11 +2177,11 @@ def remove_alien_aln_tre(self):
This function ensures they are properly removed."""
for tax_lab in self.data.aln.taxon_namespace:
if tax_lab not in self.data.tre.taxon_namespace:
sys.stdout.write("tax not in tre. This is an alien name in the data.")
sys.stderr.write("tax {} not in tre. This is an alien name in the data.\n".format(tax_lab))
self.data.remove_taxa_aln_tre(tax_lab)
for tax_lab in self.data.tre.taxon_namespace:
if tax_lab not in self.data.aln.taxon_namespace:
sys.stdout.write("tax not in aln. This is an alien name in the data. ")
sys.stderr.write("tax {} not in aln. This is an alien name in the data.\n".format(tax_lab))
self.data.remove_taxa_aln_tre(tax_lab)
self.data.prune_short()

Expand Down Expand Up @@ -2368,6 +2368,7 @@ def generate_streamed_alignment(self):
self.write_query_seqs()
self.align_query_seqs()
self.place_query_seqs()
self.prune_short()
self.est_full_tree()
self.data.tre = Tree.get(path="{}/RAxML_bestTree.{}".format(self.workdir, self.date),
schema="newick",
Expand Down Expand Up @@ -2532,6 +2533,8 @@ def sp_dict(self, downtorank=None):
if tax_name is None:
debug("something is going wrong!Check species name")
sys.stderr.write("{} has no corresponding tax_name! Check what is wrong!".format(key))
if len(tax_name.split("(")) > 1:
tax_name = tax_name.split("(")[0]
tax_name = str(tax_name).replace(" ", "_")
if self.config.blast_loc == 'remote':
if '^ncbi:accession' in self.data.otu_dict[key]:
Expand Down Expand Up @@ -2958,11 +2961,12 @@ def write_otu_info(self, downtorank=None):
"^ot:ottTaxonName",
"^ncbi:gi",
"^ncbi:accession",
"^ot:originalLabel",
"^physcraper:last_blasted",
"^physcraper:status",
"^ot:ottId",
"^ncbi:taxon",
"^ncbi:title",
"^ncbi:title"
]
with open("{}/otu_seq_info.csv".format(self.workdir), "w") as output:
writer = csv.writer(output)
Expand Down
2 changes: 1 addition & 1 deletion tests/tiny_comb_ets.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
id_to_spn = r"tests/data/tiny_comb_ets/nicespl.csv"

workdir = "tiny_comb_ets"
configfi = "tests/data/test.config"
configfi = "tests/data/localblast.config"
otu_jsonfi = "{}/otu_dict.json".format(workdir)
threshold = 2
selectby = "blast"
Expand Down
2 changes: 1 addition & 1 deletion tests/tiny_comb_its.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
id_to_spn = r"tests/data/tiny_comb_its/nicespl.csv"

workdir = "tiny_comb_its"
configfi = "tests/data/test.config"
configfi = "tests/data/localblast.config"
otu_jsonfi = "{}/otu_dict.json".format(workdir)
threshold = 2
selectby = "blast"
Expand Down
2 changes: 1 addition & 1 deletion tests/tiny_filter_ownfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
schema_trf = "newick"
id_to_spn = r"tests/data/tiny_test_example/test_nicespl.csv"
workdir="tests/output/tiny_filter_own"
configfi = "tests/data/test.config"
configfi = "tests/data/localblast.config"

otu_jsonfi = "{}/otu_dict.json".format(workdir)

Expand Down

0 comments on commit 1093d92

Please sign in to comment.