Skip to content

Commit

Permalink
Merge pull request #30 from pdec/master
Browse files Browse the repository at this point in the history
Integrated HMM search signal
  • Loading branch information
linsalrob authored Mar 27, 2020
2 parents e9b7d86 + f6b5124 commit 540fbf2
Show file tree
Hide file tree
Showing 59 changed files with 420,442 additions and 420,999 deletions.
9 changes: 8 additions & 1 deletion PhiSpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,17 @@ def main(argv): #organismPath, output_dir, trainingFlag, INSTALLATION_DIR, eval
sys.exit(-1)
os.makedirs(args_parser.output_dir, exist_ok=True)

######################################
# add HMM search signal #
######################################
# if phmm search is required
if args_parser.phmms:
args_parser.infile = PhiSpyModules.search_phmms(args_parser.phmms, args_parser.infile, args_parser.output_dir, args_parser.color, args_parser.threads)
print(f'Performing HMM search.')
args_parser.infile = PhiSpyModules.search_phmms(**vars(args_parser))

######################################
# process input file #
######################################
# in future support other types
# added a filter to remove short contigs. These break everything and we can't predict them to be
# phages anyway
Expand Down
3 changes: 2 additions & 1 deletion PhiSpyModules/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,10 @@ def call_randomforest(**kwargs):
sys.exit(-1)
strm = pkg_resources.resource_stream('PhiSpyModules', trainingFile)
train_data = np.genfromtxt(TextIOWrapper(strm), delimiter="\t", skip_header=1, filling_values=1)
test_data = np.genfromtxt(fname=infile, delimiter="\t", skip_header=1, filling_values=1)
if 'phmms' not in kwargs:
train_data = np.delete(train_data, 5, 1)
test_data = np.genfromtxt(fname=infile, delimiter="\t", skip_header=1, filling_values=1)
test_data = np.delete(train_data, 5, 1)
# Przemek's comment
# by default 10 until version 0.22 where default is 100
# number of estimators also implies the precision of probabilities, generally 1/n_estimators
Expand Down
Loading

0 comments on commit 540fbf2

Please sign in to comment.