Skip to content

Commit

Permalink
add hmm-file and pfam-accession artifacts
Browse files Browse the repository at this point in the history
rel #2244
  • Loading branch information
meren committed Mar 18, 2024
1 parent d3e9609 commit 61feea8
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 8 deletions.
14 changes: 13 additions & 1 deletion anvio/docs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,11 +377,23 @@
"provided_by_anvio": True,
"provided_by_user":True
},
"pfam-accession": {
"name": "PFAM ACCESSION",
"type": "TXT",
"provided_by_anvio": False,
"provided_by_user": True
},
"hmm-file": {
"name": "HMM MODEL FILE",
"type": "TXT",
"provided_by_anvio": False,
"provided_by_user": True
},
"hmm-source": {
"name": "HMM SOURCE",
"type": "HMM",
"provided_by_anvio": False,
"provided_by_user":True
"provided_by_user": True
},
"hmm-hits": {
"name": "HMM PROFILE",
Expand Down
3 changes: 3 additions & 0 deletions anvio/docs/artifacts/hmm-file.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
A flat text HMM that literally desribes the properties of the model and lists transition probabilities.

Such files are typically generated by the program `hmmbuild` (which is a part of the [HMMER](http://hmmer.org/) package and installed in every anvi'o environment) from FASTA files of aligned sequnces.
3 changes: 3 additions & 0 deletions anvio/docs/artifacts/pfam-accession.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
One or more accession numbers that match to valid entries in the [Pfam database](https://www.ebi.ac.uk/interpro/entry/pfam/).

Such as [PF00001](https://www.ebi.ac.uk/interpro/entry/pfam/PF00001/) or [PF14437](https://www.ebi.ac.uk/interpro/entry/pfam/PF14437/).
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ __license__ = "GPL 3.0"
__version__ = anvio.__version__
__authors__ = ['ge0rges']
__provides__ = ["hmm-source"]
__requires__ = ["hmm"]
__requires__ = []
__description__ = ("This program generates an anvi'o compatible HMM directory to be used with `anvi-run-hmms` "
"from the MDMParis Defense Finder Models.")

Expand Down
2 changes: 1 addition & 1 deletion sandbox/anvi-script-hmm-to-hmm-directory
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ __credits__ = []
__license__ = "GPL 3.0"
__version__ = anvio.__version__
__authors__ = ['ge0rges']
__requires__ = ["hmm-file"]
__provides__ = ["hmm-source"]
__requires__ = ["hmm"]
__description__ = ("You give this program one or more HMM files from `hmmbuild`, and it generates "
"an anvi'o compatible HMM directory to be used with `anvi-run-hmms`")

Expand Down
10 changes: 5 additions & 5 deletions sandbox/anvi-script-pfam-accessions-to-hmms-directory
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ __credits__ = []
__license__ = "GPL 3.0"
__version__ = anvio.__version__
__authors__ = ['meren']
__requires__ = ["pfam-accession"]
__provides__ = ["hmm-source"]
__requires__ = []
__description__ = ("You give this program one or more PFAM accession ids, and it generates "
"an anvi'o compatible HMM directory to be used with `anvi-run-hmms`")

Expand Down Expand Up @@ -76,7 +76,7 @@ def main(args):
except:
failed_accession_ids.add(pfam_accession)
continue

try:
data_dict[pfam_accession] = {}
data_dict[pfam_accession]['ga'] = utils.get_attribute_from_hmm_file(fp, 'GA ')
Expand All @@ -87,7 +87,7 @@ def main(args):
except ValueError:
run.warning(f"The PFAM accession {pfam_accession} could not be included due to a missing attribute. "
f"Anvi'o will continue without it")

progress.end()

if len(failed_accession_ids):
Expand Down Expand Up @@ -154,11 +154,11 @@ if __name__ == '__main__':
parser = ArgumentParser(description=__description__)

parser.add_argument('--pfam-accessions-list', nargs='+', help="One or more PFAM accession IDs "
"(such as PF14437.6). If you have multiple accessions, you can separate them from "
"(such as PF14437). If you have multiple accessions, you can separate them from "
"each other with a space. If you have too many, consider using the "
"`--pfam-accessions-file` parameter instead.", metavar='PFAM_ACCESSION')
parser.add_argument('--pfam-accessions-file', help="A single column text file where each column "
"is a single PFAM accession ID (such as PF14437.6). You may have as many accession "
"is a single PFAM accession ID (such as PF14437). You may have as many accession "
"ids as you like in this file.", metavar='FILE')
parser.add_argument('-O', '--output-directory', metavar='PATH', help="Output directory for the "
"anvi'o-formatted HMMs. Choose the name wisely as this will be the name that will "
Expand Down

0 comments on commit 61feea8

Please sign in to comment.