Skip to content

Commit

Permalink
remove usage of deprecated biopython IUPAC Alphabet (#26)
Browse files Browse the repository at this point in the history
* remove usage of deprecated biopython IUPAC Alphabet

* bump viral-core 2.1.8 -> 2.1.10

* wrap Seq() with SeqRecord()

* strict conda channel priority
  • Loading branch information
tomkinsc committed Nov 18, 2020
1 parent 8c8b563 commit 08bd746
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM quay.io/broadinstitute/viral-core:2.1.8
FROM quay.io/broadinstitute/viral-core:2.1.10

LABEL maintainer "viral-ngs@broadinstitute.org"

Expand All @@ -7,7 +7,7 @@ ENV VIRAL_CLASSIFY_PATH=$INSTALL_PATH/viral-classify \

COPY requirements-conda.txt requirements-conda-env2.txt $VIRAL_CLASSIFY_PATH/
RUN $VIRAL_NGS_PATH/docker/install-conda-dependencies.sh $VIRAL_CLASSIFY_PATH/requirements-conda.txt
RUN CONDA_PREFIX="$MINICONDA_PATH/envs/env2"; conda create -q -y -n env2; $VIRAL_NGS_PATH/docker/install-conda-dependencies.sh $VIRAL_CLASSIFY_PATH/requirements-conda-env2.txt
RUN CONDA_PREFIX="$MINICONDA_PATH/envs/env2"; conda config --set channel_priority strict; conda create -q -y -n env2; $VIRAL_NGS_PATH/docker/install-conda-dependencies.sh $VIRAL_CLASSIFY_PATH/requirements-conda-env2.txt

# Copy all source code into the base repo
# (this probably changes all the time, so all downstream build
Expand Down
3 changes: 1 addition & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@

# -- Mock out the heavyweight pip packages, esp those that require C ----
import mock
MOCK_MODULES = ['scipy', 'pysam', 'Bio', 'Bio.AlignIO', 'Bio.Alphabet',
'Bio.Alphabet.IUPAC', 'Bio.SeqIO', 'Bio.Data.IUPACData',
MOCK_MODULES = ['scipy', 'pysam', 'Bio', 'Bio.AlignIO', 'Bio.SeqIO', 'Bio.Data.IUPACData',
'Bio.Seq', 'Bio.SeqRecord', 'pybedtools', 'pybedtools.BedTool',
'arrow', 'zstd', 'bz2']
for mod_name in MOCK_MODULES:
Expand Down
3 changes: 1 addition & 2 deletions test/unit/test_kmer_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import Bio.SeqIO
from Bio.Seq import Seq
from Bio.SeqRecord import SeqRecord
from Bio.Alphabet import IUPAC
import pytest

import kmer_utils
Expand Down Expand Up @@ -101,7 +100,7 @@ class KmcPy(object):
def _revcomp(self, kmer):
"""Return the reverse complement of a kmer, given as a string"""
assert isinstance(kmer, str)
return str(Seq(kmer, IUPAC.unambiguous_dna).reverse_complement())
return str(SeqRecord(Seq(kmer), annotations={"molecule_type": "DNA"}).seq.reverse_complement())

def _canonicalize(self, kmer):
"""Return the canonical version of a kmer"""
Expand Down

0 comments on commit 08bd746

Please sign in to comment.