From bb6910b7a15b29f6aaca7f62684a712c36f1bfaa Mon Sep 17 00:00:00 2001 From: Pradeep Bashyal Date: Wed, 31 Mar 2021 10:34:23 -0500 Subject: [PATCH] Make seq2gfe work with imgt_sqldb (#39) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Make seq2gfe work with imgt_sqldb * Bump version: 1.1.3 → 1.1.4 --- Dockerfile | 8 ++++++-- pygfe/__init__.py | 2 +- scripts/seq2gfe | 19 ++++++++++--------- setup.cfg | 2 +- setup.py | 2 +- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index c0bd609..e752ba4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,11 +8,15 @@ RUN apt-get update -q \ && apt-get clean RUN pip install --no-cache-dir seq-ann==1.1.0 -RUN pip install --no-cache-dir py-gfe==1.1.3 +RUN pip install --no-cache-dir py-gfe==1.1.4 RUN touch blank.fasta \ && seq2gfe -f blank.fasta -l HLA-A \ && seq2gfe -f blank.fasta -l KIR3DL2 -k -ENV BIOSQLHOST=imgt_biosqldb + +ENV BIOSQLHOST=imgt_biosqldb ENV BIOSQLPORT=3306 +ENV BIOSQLDB=bioseqdb +ENV BIOSQLUSER=root +ENV BIOSQLPASS=my-secret-pw diff --git a/pygfe/__init__.py b/pygfe/__init__.py index 79cffe4..24d80bc 100644 --- a/pygfe/__init__.py +++ b/pygfe/__init__.py @@ -26,4 +26,4 @@ __author__ = """NMDP Bioinformatics""" -__version__ = '1.1.3' +__version__ = '1.1.4' diff --git a/scripts/seq2gfe b/scripts/seq2gfe index 2300b30..f50c57b 100755 --- a/scripts/seq2gfe +++ b/scripts/seq2gfe @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- import argparse +import os from Bio import SeqIO from BioSQL import BioSeqDatabase @@ -42,7 +43,7 @@ def main(): action='store_true') args = parser.parse_args() - fastafile = args.file + fasta_file = args.file loc = args.locus serv = args.server @@ -56,21 +57,21 @@ def main(): server = None if serv: - import os - biosqldb_host = os.getenv('BIOSQLPORT', 'localhost') - biosqldb_port = os.getenv('BIOSQLPORT', '3306') + biosqldb_host = os.getenv('BIOSQLHOST', 'localhost') + biosqldb_port = int(os.getenv('BIOSQLPORT', 3306)) biosqldb_user = os.getenv('BIOSQLUSER', 'root') - biosqldb_pass = os.getenv('BIOSQLPASSWORD', '') + biosqldb_pass = os.getenv('BIOSQLPASS', '') + biosqldb_name = os.getenv("BIOSQLDB", "bioseqdb") server = BioSeqDatabase.open_database(driver="pymysql", - user=biosqldb_user, passwd=biosqldb_pass, - host=biosqldb_host, port=biosqldb_port, - db="bioseqdb") + user=biosqldb_user, passwd=biosqldb_pass, + host=biosqldb_host, port=biosqldb_port, + db=biosqldb_name) seqann = BioSeqAnn(verbose=verbose, server=server, kir=kir) gfe_maker = gfe.GFE() - for seq in SeqIO.parse(fastafile, "fasta"): + for seq in SeqIO.parse(fasta_file, "fasta"): if not loc: loc = get_locus(seq, kir=kir, verbose=verbose, refdata=seqann.refdata) diff --git a/setup.cfg b/setup.cfg index 03ae76b..aa9acdf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.1.3 +current_version = 1.1.4 commit = True tag = True diff --git a/setup.py b/setup.py index eabc258..86ad08a 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ setup( name='py-gfe', - version='1.1.3', + version='1.1.4', description="Python package for converting sequence annotations to gene feature enumerations (GFE).", long_description=readme + '\n\n' + history, author="CIBMTR",