Skip to content

Commit

Permalink
Make seq2gfe work with imgt_sqldb (#39)
Browse files Browse the repository at this point in the history
* Make seq2gfe work with imgt_sqldb
* Bump version: 1.1.3 → 1.1.4
  • Loading branch information
pbashyal-nmdp authored Mar 31, 2021
1 parent 75448d6 commit bb6910b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion pygfe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@


__author__ = """NMDP Bioinformatics"""
__version__ = '1.1.3'
__version__ = '1.1.4'
19 changes: 10 additions & 9 deletions scripts/seq2gfe
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# -*- coding: utf-8 -*-

import argparse
import os

from Bio import SeqIO
from BioSQL import BioSeqDatabase
Expand Down Expand Up @@ -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

Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.1.3
current_version = 1.1.4
commit = True
tag = True

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit bb6910b

Please sign in to comment.