Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Robaina/issue71 #93

Merged
merged 5 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/pynteny/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,22 @@ def download() -> argparse.ArgumentParser:
action="store_true",
help="force-download database again if already downloaded",
)
optional.add_argument(
"-pgap",
"--pgap",
dest="pgap",
default=False,
action="store_true",
help="download PGAP database (default)",
)
optional.add_argument(
"-pfam",
"--pfam",
dest="pfam",
default=False,
action="store_true",
help="download PFAM database",
)
optional.add_argument(
"-l",
"--log",
Expand Down
8 changes: 5 additions & 3 deletions src/pynteny/config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"database_dir": "",
"upack_PGAP_database": false,
"data_downloaded": false,
"upack_PFAM_database": false,
"PGAP_data_downloaded": false,
"PFAM_data_downloaded": false,
"PGAP_database": "",
"PGAP_meta_file": "",
"streamlit_process": "",
"streamlit_log": ""
"PFAM_database": "",
"PFAM_meta_file": ""
}
8 changes: 4 additions & 4 deletions src/pynteny/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import pynteny.parsers.labelparser as labelparser
import pynteny.parsers.syntenyparser as syntenyparser
from pynteny.hmm import HMMER, PGAP
from pynteny.hmm import HMMER, PFAM, PGAP, HMMDatabase
from pynteny.preprocessing import FASTA

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -416,14 +416,14 @@ def add_HMM_meta_info_to_hits(self, hmm_meta: Path) -> SyntenyHits:
fields = ["gene_symbol", "label", "product", "ec_number"]
if all([f in self._synteny_hits.columns for f in fields]):
return self._synteny_hits
pgap = PGAP(hmm_meta)
hmm_db = HMMDatabase(hmm_meta)
self._synteny_hits[fields] = ""
for row in self._synteny_hits.itertuples():
meta_values = [
[
str(v).replace("nan", "")
for k, v in pgap.get_meta_info_for_HMM(hmm).items()
if k != "#ncbi_accession"
for k, v in hmm_db.get_meta_info_for_HMM(hmm).items()
if k != "accession"
]
for hmm in row.hmm.split("|")
]
Expand Down
Loading