[med-svn] [Git][med-team/seqmagick][master] 11 commits: Encode for adding support to utf-8

Nilesh Patra gitlab at salsa.debian.org
Sun Aug 16 16:22:45 BST 2020



Nilesh Patra pushed to branch master at Debian Med / seqmagick


Commits:
d34b51cc by Nilesh Patra at 2020-08-16T20:27:44+05:30
Encode for adding support to utf-8

- - - - -
795200d3 by Nilesh Patra at 2020-08-16T20:30:36+05:30
Replcae Bio.trie with pygtrie

- - - - -
22654021 by Nilesh Patra at 2020-08-16T20:30:50+05:30
Update Depends

- - - - -
1cb6f30d by Nilesh Patra at 2020-08-16T20:32:50+05:30
Add autopkgtests

- - - - -
ebad3703 by Nilesh Patra at 2020-08-16T20:43:53+05:30
Fix manpage

- - - - -
43023873 by Nilesh Patra at 2020-08-16T20:44:29+05:30
Update changelog

- - - - -
79c713cb by Nilesh Patra at 2020-08-16T20:45:06+05:30
routine-update: Standards-Version: 4.5.0

- - - - -
006fc2dd by Nilesh Patra at 2020-08-16T20:45:06+05:30
routine-update: debhelper-compat 13

- - - - -
39ce5de0 by Nilesh Patra at 2020-08-16T20:45:30+05:30
routine-update: Add salsa-ci file

- - - - -
3dc2f74e by Nilesh Patra at 2020-08-16T20:45:31+05:30
routine-update: Rules-Requires-Root: no

- - - - -
e1d5a7e3 by Nilesh Patra at 2020-08-16T20:45:49+05:30
Set upstream metadata fields: Bug-Database, Bug-Submit, Repository, Repository-Browse.

Changes-By: lintian-brush
Fixes: lintian: upstream-metadata-missing-bug-tracking
See-also: https://lintian.debian.org/tags/upstream-metadata-missing-bug-tracking.html
Fixes: lintian: upstream-metadata-missing-repository
See-also: https://lintian.debian.org/tags/upstream-metadata-missing-repository.html

- - - - -


10 changed files:

- debian/changelog
- debian/control
- + debian/patches/fix-myfunctions-example-file.patch
- + debian/patches/replace-biopython-trie-with-pygtrie.patch
- debian/patches/series
- + debian/salsa-ci.yml
- debian/seqmagick.1
- + debian/tests/control
- + debian/tests/run-unit-test
- debian/upstream/metadata


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,23 @@
+seqmagick (0.8.0-2) UNRELEASED; urgency=medium
+
+  [ Steffen Moeller ]
+  * Remove autogenerated version string and egg-info
+
+  [ Nilesh Patra ]
+  * Encode for adding support to utf-8
+  * Replcae Bio.trie with pygtrie
+  * Update Depends
+  * Add autopkgtests
+  * Fix manpage
+  * Standards-Version: 4.5.0 (routine-update)
+  * debhelper-compat 13 (routine-update)
+  * Add salsa-ci file (routine-update)
+  * Rules-Requires-Root: no (routine-update)
+  * Set upstream metadata fields: Bug-Database, Bug-Submit, Repository,
+    Repository-Browse.
+
+ -- Nilesh Patra <npatra974 at gmail.com>  Sun, 16 Aug 2020 20:44:11 +0530
+
 seqmagick (0.8.0-1) unstable; urgency=medium
 
   * Team upload.


=====================================
debian/control
=====================================
@@ -3,22 +3,25 @@ Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.
 Uploaders: Andreas Tille <tille at debian.org>
 Section: science
 Priority: optional
-Build-Depends: debhelper-compat (= 12),
+Build-Depends: debhelper-compat (= 13),
                dh-python,
                python3-all,
                python3-setuptools,
                python3-nose,
-               python3-biopython
-Standards-Version: 4.4.1
+               python3-biopython,
+               python3-pygtrie
+Standards-Version: 4.5.0
 Vcs-Browser: https://salsa.debian.org/med-team/seqmagick
 Vcs-Git: https://salsa.debian.org/med-team/seqmagick.git
 Homepage: https://github.com/fhcrc/seqmagick/
+Rules-Requires-Root: no
 
 Package: seqmagick
 Architecture: all
 Depends: ${python3:Depends},
          ${misc:Depends},
-         python3-biopython
+         python3-biopython,
+         python3-pygtrie
 Description: imagemagick-like frontend to Biopython SeqIO
  Seqmagick is a little utility to expose the file format conversion
  in BioPython in a convenient way.


=====================================
debian/patches/fix-myfunctions-example-file.patch
=====================================
@@ -0,0 +1,14 @@
+Author: Nilesh Patra <npatra974 at gmail.com>
+Description: Encode hash result in hash_starts_numeric to support unicode
+Forwarded: https://github.com/fhcrc/seqmagick/pull/85
+Last Changed: August 16, 2020
+--- a/examples/apply-function/myfunctions.py
++++ b/examples/apply-function/myfunctions.py
+@@ -14,6 +14,6 @@
+     their sha-1 hash.
+     """
+     for record in records:
+-        seq_hash = hashlib.sha1(str(record.seq)).hexdigest()
++        seq_hash = hashlib.sha1(str(record.seq).encode('utf-8')).hexdigest()
+         if seq_hash[0].isdigit():
+             yield record


=====================================
debian/patches/replace-biopython-trie-with-pygtrie.patch
=====================================
@@ -0,0 +1,109 @@
+Author: Nilesh Patra <npatra974 at gmail.com>
+Description: Replace deprecated Biopython trie functionality with  pygtrie
+Forwarded: https://github.com/fhcrc/seqmagick/pull/86
+Last-Changed: August 16, 2020
+--- a/seqmagick/subcommands/quality_filter.py
++++ b/seqmagick/subcommands/quality_filter.py
+@@ -11,16 +11,29 @@
+ import time
+ 
+ from Bio import SeqIO
+-try:
+-    from Bio import trie, triefind
+-except ImportError:
+-    trie = None
+-    triefind = None
++import pygtrie as trie
+ from Bio.SeqIO import QualityIO
+ 
+ from seqmagick import fileformat, __version__
+ from .common import typed_range, FileType
+ 
++
++def trie_match(string, trie):
++    def has_prefix(teststring, trie):
++        for key in trie.keys():
++            if key.startswith(teststring):
++                return True
++        return False
++    longest = None
++    for i in range(len(string)):
++        substr = string[:i + 1]
++        if not has_prefix(substr, trie):
++            break
++        if trie.has_key(substr):
++            longest = substr
++    return longest
++
++
+ # Default minimummean quality score
+ DEFAULT_MEAN_SCORE = 25.0
+ 
+@@ -626,7 +639,7 @@
+         self.trie = trie
+ 
+     def filter_record(self, record):
+-        m = triefind.match(str(record.seq), self.trie)
++        m = trie_match(str(record.seq), self.trie)
+         if m:
+             if self.listener:
+                 self.listener(
+@@ -646,7 +659,7 @@
+ 
+     Any additional columns are ignored
+     """
+-    tr = trie.trie()
++    tr = trie.StringTrie()
+     reader = csv.reader(fp)
+ 
+     if header:
+@@ -680,10 +693,6 @@
+         raise ValueError("--quality-window-mean-qual specified without "
+                          "--quality-window")
+ 
+-    if trie is None or triefind is None:
+-        raise ValueError(
+-            'Missing Bio.trie and/or Bio.triefind modules. Cannot continue')
+-
+     filters = []
+     input_type = fileformat.from_handle(arguments.sequence_file)
+     output_type = fileformat.from_handle(arguments.output_file)
+--- a/seqmagick/test/test_subcommands_quality_filter.py
++++ b/seqmagick/test/test_subcommands_quality_filter.py
+@@ -7,8 +7,6 @@
+ 
+ from seqmagick.subcommands import quality_filter
+ 
+-from Bio import triefind
+-
+ IS_PYPY = hasattr(sys, 'pypy_version_info')
+ 
+ 
+@@ -194,7 +192,6 @@
+                          [i.id for i in actual])
+ 
+ 
+- at unittest.skipIf(IS_PYPY, "Bio.trie not available on pypy.")
+ class PrimerBarcodeFilterTestCase(unittest.TestCase):
+     def setUp(self):
+         self.sequences = [
+@@ -240,7 +237,6 @@
+         self.assertEqual(events, [1, 5])
+ 
+ 
+- at unittest.skipIf(IS_PYPY, "Bio.trie not available on pypy.")
+ class BarcodePrimerTrieTestCase(unittest.TestCase):
+     def setUp(self):
+         self.barcode_str = """p1d1bc205,TACTAGCG,CATTGCCTATG
+@@ -258,9 +254,9 @@
+         res = quality_filter.parse_barcode_file(self.fp, primer='CATTGCCTATG')
+         self.assertEqual(9, len(list(res.keys())))
+         self.assertEqual('p1d1bc210', res['TACAGTCGCATTGCCTATG'])
+-        self.assertEqual(None, triefind.match('TACAGTCGCATTGCCTAT', res))
++        self.assertEqual(None, quality_filter.trie_match('TACAGTCGCATTGCCTAT', res))
+         self.assertEqual('TACAGTCGCATTGCCTATG',
+-                         triefind.match('TACAGTCGCATTGCCTATGCTACCTA', res))
++                         quality_filter.trie_match('TACAGTCGCATTGCCTATGCTACCTA', res))
+ 
+     def test_primer_in_file(self):
+         res = quality_filter.parse_barcode_file(self.fp, primer=None)


=====================================
debian/patches/series
=====================================
@@ -1 +1,3 @@
 biopython_1.71_dual_coding_support.patch
+fix-myfunctions-example-file.patch
+replace-biopython-trie-with-pygtrie.patch 


=====================================
debian/salsa-ci.yml
=====================================
@@ -0,0 +1,4 @@
+---
+include:
+  - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
+  - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml


=====================================
debian/seqmagick.1
=====================================
@@ -5,7 +5,7 @@ seqmagick \- Manipulate sequence files
 .SH SYNOPSIS
 usage: seqmagick [\-h] [\-V] [\-v] [\-q]
 .IP
-{help,convert,info,mogrify,primer\-trim,quality\-filter,extract\-ids,backtrans\-align}
+help, convert, info, mogrify, primer\-trim, quality\-filter, extract\-ids, backtrans\-align
 \&...
 .SH DESCIPTION
 Seqmagick is a little utility to expose the file format conversion
@@ -13,7 +13,7 @@ in BioPython in a convenient way.
 .SH OPTIONS
 .SS "positional arguments:"
 .IP
-{help,convert,info,mogrify,primer\-trim,quality\-filter,extract\-ids,backtrans\-align}
+help, convert, info, mogrify, primer\-trim, quality\-filter, extract\-ids, backtrans\-align
 .TP
 help
 Detailed help for actions using help <action>


=====================================
debian/tests/control
=====================================
@@ -0,0 +1,4 @@
+Tests: run-unit-test
+Depends: @
+Restrictions: allow-stderr
+


=====================================
debian/tests/run-unit-test
=====================================
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+pkg=seqmagick
+TEST_DIR=`pwd`
+
+if [ "${AUTOPKGTEST_TMP}" = "" ] ; then
+  AUTOPKGTEST_TMP=$(mktemp -d /tmp/${pkg}-test.XXXXXX)
+  trap "rm -rf ${AUTOPKGTEST_TMP}" 0 INT QUIT ABRT PIPE TERM
+fi
+
+cp ${TEST_DIR}/examples -a "${AUTOPKGTEST_TMP}"
+
+cd "${AUTOPKGTEST_TMP}"
+gunzip -r *
+
+for f in `find examples/ -name '*.sh'`
+do
+	cd `dirname $f`
+	/bin/bash *.sh
+	cd -
+done
+echo 'PASS'
+


=====================================
debian/upstream/metadata
=====================================
@@ -1,3 +1,5 @@
+Bug-Database: https://github.com/fhcrc/seqmagick/issues
+Bug-Submit: https://github.com/fhcrc/seqmagick/issues/new
 Registry:
  - Name: bio.tools
    Entry: NA
@@ -7,3 +9,5 @@ Registry:
    Entry: seqmagick
  - Name: SciCrunch
    Entry: NA
+Repository: https://github.com/fhcrc/seqmagick.git
+Repository-Browse: https://github.com/fhcrc/seqmagick



View it on GitLab: https://salsa.debian.org/med-team/seqmagick/-/compare/9179005c3920850ee3759fcac0cbbe4e57098829...e1d5a7e31df79d7d068bac7ec502ca4ef5ceb49d

-- 
View it on GitLab: https://salsa.debian.org/med-team/seqmagick/-/compare/9179005c3920850ee3759fcac0cbbe4e57098829...e1d5a7e31df79d7d068bac7ec502ca4ef5ceb49d
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/20200816/34c71c71/attachment-0001.html>


More information about the debian-med-commit mailing list