Skip to content

Commit

Permalink
Merge pull request #53 from FOI-Bioinformatics/name_bug_issue51_fix
Browse files Browse the repository at this point in the history
Name bug issue51 fix
  • Loading branch information
davve2 authored Apr 29, 2022
2 parents 588a870 + 81c10bd commit 423d49f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion flextaxd/modules/NewickTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
import logging
logger = logging.getLogger(__name__)

try:
import inquirer
except:
Raise(ImportError("The package inquirer is required for flextaxd visualisation"))


__version__ = "0.0.1"
__author__ = "David Sundell"
Expand Down Expand Up @@ -340,7 +345,6 @@ def double_vis_path(self,duplicates,taxid,nodes):
),
]
selected = inquirer.prompt(questions)["parent"]
import random
n = random.randint(10000000,10100000)
if selected != default:
children[0],children[1] = children[1],children[0]
Expand Down
2 changes: 1 addition & 1 deletion flextaxd/modules/ProcessDirectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def walk_directory(self,folder_path):
logger.info("Process genome path ({path})".format(path=folder_path))
for root, dirs, files in os.walk(folder_path,followlinks=True):
for file in files:
fname = file.strip(".gz") ## remove gz if present
fname = file.rstrip(".gz") ## remove gz if present
if fname.endswith(tuple(self.ext)):
if count % 1000 == 0:
print("Processed {count} genomes".format(count=count), end="\r")
Expand Down
4 changes: 2 additions & 2 deletions flextaxd/modules/ReadTaxonomyQIIME.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def __init__(self, taxonomy_file=False, names_dmp=False, database=False, verbose
}
self.set_qiime(True)
### Add root name these manual nodes are required when parsing the GTDB database!
rootid = self.add_node("root") ## Allways set in ReadTaxonomy
rootid = self.root ## Allways set in ReadTaxonomy
coid = self.add_node("cellular organisms")
bac_id = self.add_node("Bacteria")
Euk_id = self.add_node("Eukaryota")
Expand All @@ -48,7 +48,7 @@ def __init__(self, taxonomy_file=False, names_dmp=False, database=False, verbose
self.add_rank("n",qiime=True)
self.add_rank("sk",qiime=True)
## Add basic links
self.add_link(child=rootid, parent=rootid,rank="n")
#self.add_link(child=rootid, parent=rootid,rank="n") ## Already done in ReadTaxonomy
self.add_link(child=coid, parent=rootid,rank="n")
self.add_link(child=bac_id, parent=coid,rank="sk")
self.add_link(child=Euk_id, parent=coid,rank="sk")
Expand Down

0 comments on commit 423d49f

Please sign in to comment.