Skip to content

Commit

Permalink
added option to use user-defined annotool file
Browse files Browse the repository at this point in the history
  • Loading branch information
trvinh committed Jun 3, 2024
1 parent 29afb52 commit 3893e66
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion fdog/libs/fas.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,14 @@ def calc_fas_cand(args):
return(fas_score)


def calc_fas_multi (input_fa, outpath, annopath, cpus):
def calc_fas_multi (input_fa, outpath, annopath, cpus, featureFile):
""" Calculate pairwise FAS scores for all orthologs vs seed protein
input_fa is the default <seqName>.extended.fa output file of fDOG
Output will be <seqName>_forward.
"""
fasCmd = 'fas.runFdogFas -i %s -w %s --cores %s --redo_anno' % (input_fa, annopath, cpus)
if featureFile:
fasCmd = f'{fasCmd} --featuretypes {featureFile}'
try:
subprocess.call([fasCmd], shell = True)
if os.path.exists(outpath + '/tmp'):
Expand Down
4 changes: 3 additions & 1 deletion fdog/runMulti.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ def main():
help='Specifiy mode for filtering core orthologs by FAS score. In \'relaxed\' mode candidates with insufficient FAS score will be disadvantaged. In \'strict\' mode candidates with insufficient FAS score will be deleted from the candidates list. The option \'--minScore\' specifies the cut-off of the FAS score.',
choices=['relaxed', 'strict'], action='store', default='')
fas_options.add_argument('--minScore', help='Specify the threshold for coreFilter. Default: 0.75', action='store', default=0.75, type=float)
fas_options.add_argument('--featureFile', help='File that contains tools used for FAS calculation', action='store', default='')

addtionalIO = parser.add_argument_group('Other I/O options')
addtionalIO.add_argument('--append', help='Append the output to existing output files', action='store_true', default=False)
Expand Down Expand Up @@ -304,6 +305,7 @@ def main():
fasOff = args.fasOff
coreFilter = args.coreFilter
minScore = args.minScore
featureFile = args.featureFile

# other I/O arguments
append = args.append
Expand Down Expand Up @@ -446,7 +448,7 @@ def main():
sys.exit('Problem with FAS! Please check https://github.com/BIONF/FAS or turn it off if not needed!')
if os.path.exists(finalFa):
start = time.time()
fas_fn.calc_fas_multi(finalFa, outpath, annopath, cpus)
fas_fn.calc_fas_multi(finalFa, outpath, annopath, cpus, featureFile)
end = time.time()
print('==> FAS calculation finished in ' + '{:5.3f}s'.format(end - start))
multiLog.write('==> FAS calculation finished in ' + '{:5.3f}s'.format(end - start))
Expand Down
4 changes: 3 additions & 1 deletion fdog/runSingle.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def main():
help='Specifiy mode for filtering core orthologs by FAS score. In \'relaxed\' mode candidates with insufficient FAS score will be disadvantaged. In \'strict\' mode candidates with insufficient FAS score will be deleted from the candidates list. The option \'--minScore\' specifies the cut-off of the FAS score.',
choices=['relaxed', 'strict'], action='store', default='')
fas_options.add_argument('--minScore', help='Specify the threshold for coreFilter. Default: 0.75', action='store', default=0.75, type=float)
fas_options.add_argument('--featureFile', help='File that contains tools used for FAS calculation', action='store', default='')

addtionalIO = parser.add_argument_group('Other I/O options')
addtionalIO.add_argument('--append', help='Append the output to existing output files', action='store_true', default=False)
Expand Down Expand Up @@ -175,6 +176,7 @@ def main():
fasOff = args.fasOff
coreFilter = args.coreFilter
minScore = args.minScore
featureFile = args.featureFile

# other I/O arguments
append = args.append
Expand Down Expand Up @@ -296,7 +298,7 @@ def main():
sys.exit('Problem with FAS! Please check https://github.com/BIONF/FAS or turn it off if not needed!')
if os.path.exists(finalOutfile):
start = time.time()
fas_fn.calc_fas_multi(finalOutfile, outpath, annopath, cpus)
fas_fn.calc_fas_multi(finalOutfile, outpath, annopath, cpus, featureFile)
end = time.time()
print('==> FAS calculation finished in ' + '{:5.3f}s'.format(end - start))
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

setup(
name="fdog",
version="0.1.30",
version="0.1.31",
python_requires='>=3.7.0',
description="Feature-aware Directed OrtholoG search tool",
long_description=long_description,
Expand Down

0 comments on commit 3893e66

Please sign in to comment.