[med-svn] [Git][med-team/pychopper][upstream] New upstream version 2.7.10
Alexandre Detiste (@detiste-guest)
gitlab at salsa.debian.org
Wed Jul 31 13:04:48 BST 2024
Alexandre Detiste pushed to branch upstream at Debian Med / pychopper
Commits:
e4d7d316 by Alexandre Detiste at 2024-07-31T13:08:23+02:00
New upstream version 2.7.10
- - - - -
7 changed files:
- CHANGELOG.md
- pychopper/__init__.py
- pychopper/report.py
- pychopper/scripts/pychopper.py
- pychopper/seq_utils.py
- requirements.txt
- setup.py
Changes:
=====================================
CHANGELOG.md
=====================================
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [v2.7.10]
+## Added support for PCS111/114 and PCB111/114 kits
+
## [v2.7.9]
### Added
- Support for LSK114 direct cDNA sequencing kit
=====================================
pychopper/__init__.py
=====================================
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
-__version__ = "2.7.9"
+__version__ = "2.7.10"
=====================================
pychopper/report.py
=====================================
@@ -1,6 +1,3 @@
-# -*- coding: utf-8 -*-
-
-import six
import numpy as np
import matplotlib
matplotlib.use('Agg')
@@ -68,10 +65,10 @@ class Report:
"""
fig = plt.figure()
- for label, data_arrays in six.iteritems(data_map):
+ for label, data_arrays in data_map.items():
plt.plot(data_arrays[0], data_arrays[1], marker, label=label)
if vlines is not None:
- for label, pos in six.iteritems(vlines):
+ for label, pos in vlines.items():
plt.axvline(x=pos, label=label, color=vlcolor, lw=vlwitdh)
if legend:
plt.legend(loc=legend_loc)
@@ -95,11 +92,11 @@ class Report:
"""
fig = plt.figure()
- for label, data in six.iteritems(data_map):
+ for label, data in data_map.items():
if len(data) > 0:
plt.hist(data, bins=bins, label=label, alpha=alpha)
if vlines is not None:
- for label, pos in six.iteritems(vlines):
+ for label, pos in vlines.items():
plt.axvline(x=pos, label=label)
if legend:
plt.legend(loc=legend_loc)
=====================================
pychopper/scripts/pychopper.py
=====================================
@@ -237,7 +237,7 @@ def main():
parser.add_argument(
'-k', type=str, default="PCS109",
help="Use primer sequences from this kit (PCS109).",
- choices=['PCS109', 'PCS110', 'PCS111', 'LSK114']
+ choices=['PCS109', 'PCS110', 'PCS111', 'PCS114', 'LSK114', 'PCB111', 'PCB114']
)
parser.add_argument(
'-q', metavar='cutoff', type=float, default=None,
@@ -335,6 +335,21 @@ def main():
os.path.dirname(phmm_data.__file__), "PCS110_primers.hmm"),
"FAS": os.path.join(
os.path.dirname(primer_data.__file__), "PCS111_primers.fas")},
+ "PCS114": {
+ "HMM": os.path.join(
+ os.path.dirname(phmm_data.__file__), "PCS110_primers.hmm"),
+ "FAS": os.path.join(
+ os.path.dirname(primer_data.__file__), "PCS111_primers.fas")},
+ "PCB111": {
+ "HMM": os.path.join(
+ os.path.dirname(phmm_data.__file__), "PCS110_primers.hmm"),
+ "FAS": os.path.join(
+ os.path.dirname(primer_data.__file__), "PCS111_primers.fas")},
+ "PCB114": {
+ "HMM": os.path.join(
+ os.path.dirname(phmm_data.__file__), "PCS110_primers.hmm"),
+ "FAS": os.path.join(
+ os.path.dirname(primer_data.__file__), "PCS111_primers.fas")},
"LSK114": {
"HMM": os.path.join(
os.path.dirname(phmm_data.__file__), "cDNA_SSP_VNP.hmm"),
=====================================
pychopper/seq_utils.py
=====================================
@@ -1,14 +1,13 @@
-# -*- coding: utf-8 -*-
+""" Utilities manipulating biological sequences and formats. Extensions to biopython functionality.
+"""
-from six.moves import reduce
-from numpy.random import random
-from pysam import FastxFile
from math import log
import sys
-from pychopper.common_structures import Seq
-""" Utilities manipulating biological sequences and formats. Extensions to biopython functionality.
-"""
+from numpy.random import random
+from pysam import FastxFile
+
+from pychopper.common_structures import Seq
# Reverse complements of bases, taken from dragonet:
comp = {
@@ -16,6 +15,7 @@ comp = {
'a': 't', 't': 'a', 'c': 'g', 'g': 'c', 'x': 'x', 'n': 'n',
'-': '-'
}
+comp_trans = str.maketrans(''.join(comp.keys()), ''.join(comp.values()))
def base_complement(k):
@@ -38,16 +38,14 @@ def base_complement(k):
def reverse_complement(seq):
- """ Return reverse complement of a string (base) sequence.
+ """Reverse complement sequence.
- :param seq: Input sequence.
- :returns: Reverse complement of input sequence.
- :rtype: str
+ :param: input sequence string.
+
+ :returns: reverse-complemented string.
"""
- if len(seq) == 0:
- return seq
- return reduce(lambda x, y: x + y, map(base_complement, seq[::-1]))
+ return seq.translate(comp_trans)[::-1]
def readfq(fastq, sample=None, min_qual=0, rfq_sup={}): # this is a generator function
=====================================
requirements.txt
=====================================
@@ -1,9 +1,8 @@
parasail
biopython
matplotlib
-six
tqdm==4.26.0
pandas
numpy
pytest
-pysam
\ No newline at end of file
+pysam
=====================================
setup.py
=====================================
@@ -39,6 +39,10 @@ data_files = []
extra_requires = {}
extensions = []
+pymajor, pyminor = sys.version_info[0:2]
+if (pymajor < 3):
+ raise RuntimeError(
+ '`pychopper` is unsupported on Python version < 3.')
setup(
name=__pkg_name__,
View it on GitLab: https://salsa.debian.org/med-team/pychopper/-/commit/e4d7d316b368f5ba2bcacfffb969e5f4023161d1
--
View it on GitLab: https://salsa.debian.org/med-team/pychopper/-/commit/e4d7d316b368f5ba2bcacfffb969e5f4023161d1
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20240731/b23cc929/attachment-0001.htm>
More information about the debian-med-commit
mailing list