Skip to content

Commit

Permalink
added diamond support, added ref weight support to heuristic and bpo,…
Browse files Browse the repository at this point in the history
… added tcdb

Former-commit-id: 61ad057
  • Loading branch information
PedroMTQ committed May 13, 2021
1 parent 679adfe commit 8060c08
Show file tree
Hide file tree
Showing 26 changed files with 1,590 additions and 2,271 deletions.
18 changes: 10 additions & 8 deletions MANTIS.config
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,30 @@

#######DEFAULT PATHS#######
#You can add custom paths here, otherwise they will be set to default values
#ncbi_dmp_path_folder=
#default_hmms_folder=
#####<custom_hmms_folder> defines the folder where Mantis will look for MULTIPLE custom HMMs. Each HMM should be contained within a folder, such that the path will look something like this: /path/to/custom_hmms_folder/custom1/custom1.hmm
#custom_hmms_folder=
#ncbi_resources_folder=
#default_ref_folder=
#####<custom_ref_folder> defines the folder where Mantis will look for MULTIPLE custom HMMs or DMND. Each HMM should be contained within a folder, such that the path will look something like this: /path/to/custom_ref_folder/custom1/custom1.hmm
#custom_ref_folder=
#nog_hmm_folder=
#pfam_hmm_folder=
#kofam_hmm_folder=
#ncbi_hmm_folder=
#tigrfam_hmm_folder=
tcdb_seq_folder=NA
#nog_tax=NCBI_ID

#####Make sure the names of the weights correspond to the path of the hmms
#####example: <NOGT>_hmm_folder should be <NOGT>_weight
#####example: custom_hmm=path/to/customHMM.hmm should be customHMM_weight
#####example: custom_ref=path/to/customHMM.hmm should be customHMM_weight
nog_weight=0.8
pfam_weight=0.9
tigrfam_weight=0.5


#######CUSTOM HMMS#######
#####<custom_hmm> defines the folder or file where Mantis will look for a SINGLE custom HMM. The path will look something like this: /path/to/custom1/custom1.hmm or /path/to/custom1/
#custom_hmm=path/to/hmm/custom1.hmm
#######CUSTOM REFERENCES#######
#####<custom_ref> defines the folder or file where Mantis will look for a SINGLE custom reference (HMM or DMND). The path will look something like this: /path/to/custom1/custom1.hmm or /path/to/custom1/
#custom_ref=path/to/hmm/custom1.hmm
#custom_ref=path/to/hmm/custom2.dmnd
#to set the weight, simply add a line with the hmm file name followed by _weight , like so:
#custom1_weight=0.5

Binary file added References/Custom_references/example.tar.gz
Binary file not shown.
10 changes: 10 additions & 0 deletions References/Custom_references/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Custom references will go here

Please use one folder per source otherwise it won't be recognized.

If using a HMM, please use hmmpress on the hmm within each folder.
If using sequences, use Diamond to create a Diamond database.

example1.tar.gz contains an example custom hmm source.

You can also use the function ```merge_hmm_folder``` to merge a target folder with hmms. This function will merge all hmms into one global hmm and then press it.
File renamed without changes.
8 changes: 7 additions & 1 deletion __main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@
'\t\t\ttaxon name, e.g. "Proteobacteria" or "Escherichia coli"\n'
'\t\t\tNCBI taxon ID, e.g.: 561 for Escherichia coli\n'
'Providing NCBI IDs is faster and safer.')
parser.add_argument('-gc', '--genetic_code',
help='[optional]\tIf you want Mantis to translate your target fasta, please provide a genetic code. Default is 11. \n'
'\t\tFor further details please see https://www.ncbi.nlm.nih.gov/Taxonomy/taxonomyhome.html/index.cgi?chapter=cgencodes\n')
parser.add_argument('-k', '--keep_files', action='store_true',
help='[optional]\tKeep intermediary output files')
parser.add_argument('-sc', '--skip_consensus', action='store_true',
Expand Down Expand Up @@ -113,6 +116,7 @@
overlap_value = args.overlap_value
minimum_consensus_overlap = args.minimum_consensus_overlap
organism_details = args.organism_details
genetic_code = args.genetic_code
domain_algorithm = args.domain_algorithm
best_combo_formula = args.best_combo_formula
sorting_type = args.sorting_type
Expand Down Expand Up @@ -150,6 +154,7 @@
overlap_value=overlap_value,
minimum_consensus_overlap=minimum_consensus_overlap,
organism_details=organism_details,
genetic_code=genetic_code,
domain_algorithm=domain_algorithm,
best_combo_formula=best_combo_formula,
sorting_type=sorting_type,
Expand All @@ -175,7 +180,8 @@
mantis_config = args.mantis_config
force_download = args.force_download
chunk_size = args.chunk_size
setup_databases(force_download=force_download, chunk_size=chunk_size, mantis_config=mantis_config)
cores = args.cores
setup_databases(force_download=force_download, chunk_size=chunk_size, mantis_config=mantis_config,cores=cores)
elif args.execution_type == 'merge_hmm_folder':
target = args.target
merge_hmm_folder(target_folder=target)
Expand Down
Empty file removed hmm/custom_hmms/.gitkeep
Empty file.
1,179 changes: 0 additions & 1,179 deletions hmm/custom_hmms/custom.hmm

This file was deleted.

Binary file removed hmm/custom_hmms/custom.hmm.h3f
Binary file not shown.
Binary file removed hmm/custom_hmms/custom.hmm.h3i
Binary file not shown.
Binary file removed hmm/custom_hmms/custom.hmm.h3m
Binary file not shown.
Binary file removed hmm/custom_hmms/custom.hmm.h3p
Binary file not shown.
2 changes: 0 additions & 2 deletions hmm/custom_hmms/custom.tsv

This file was deleted.

7 changes: 0 additions & 7 deletions hmm/custom_hmms/readme.md

This file was deleted.

36 changes: 9 additions & 27 deletions source/Exceptions.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
RequirementsNotMet='Installation check not passed! Make sure you\'ve setup the databases and your system meets all the requirements!'
NoValidFiles='No valid files to annotate'
InvalidTargetFile='You did not insert a valid target file!\n'
InstallationCheckNotPassed='Installation check not passed! Make sure you\'ve setup the databases and your system meets all the requirements!'
CythonNotCompiled= 'Cython has not been correctly compiled! Please go to mantis/source/ and run python utils.py'
BadNumberWorkers='You should not be seeing this, please contact the developer. Invalid number of workers in '
ConnectionError='Could not connect to url:\n'
InvalidTranslation='Invalid residues for translation. Please make sure you provided a CDS of DNA or RNA in the target file:\n'

class RequirementsNotMet(Exception):
def __init__(self, *args):
if args:
Expand All @@ -14,30 +23,3 @@ def __str__(self):
return 'Requirements not met'


class MissingCondaEnvironment(Exception):
def __str__(self):
return 'Conda environment is missing from configuration file!'


class InvalidFunction(Exception):
def __str__(self):
return 'This function is not available in this module!'


class InvalidTargetFile(Exception):
def __str__(self):
return 'You did not insert a valid target file!'


class InstallationCheckNotPassed(Exception):
def __str__(self):
return 'Installation check not passed! Make sure you\'ve setup the databases and your system meets all the requirements!'


class CythonNotCompiled(Exception):
def __str__(self):
return 'Cython has not been correctly compiled! Please go to mantis/source/ and run python utils.py'

class BadNumberWorkers(Exception):
def __str__(self):
return 'Number of workers not correctly defined. You should not be seeing this! Contact developer!'
Loading

0 comments on commit 8060c08

Please sign in to comment.