[med-svn] [Git][med-team/python-py2bit][master] 6 commits: New upstream version 0.3.1
Nilesh Patra (@nilesh)
gitlab at salsa.debian.org
Tue Aug 9 19:30:51 BST 2022
Nilesh Patra pushed to branch master at Debian Med / python-py2bit
Commits:
b55fd12c by Nilesh Patra at 2022-08-09T23:49:28+05:30
New upstream version 0.3.1
- - - - -
65854a9a by Nilesh Patra at 2022-08-09T23:49:28+05:30
Update upstream source from tag 'upstream/0.3.1'
Update to upstream version '0.3.1'
with Debian dir 5828446bea21aa92bf7cea1130d8b854b1761c8b
- - - - -
2665a90c by Nilesh Patra at 2022-08-09T23:49:34+05:30
Bump Standards-Version to 4.6.1 (no changes needed)
- - - - -
6bf1f140 by Nilesh Patra at 2022-08-09T23:49:49+05:30
Remove myself from uploaders
- - - - -
78055ca3 by Nilesh Patra at 2022-08-09T23:56:13+05:30
d/t/run-uni-test: Use py3versions -s instead
- - - - -
ae531f2f by Nilesh Patra at 2022-08-09T23:56:13+05:30
Upload to unstable
- - - - -
10 changed files:
- − .travis.yml
- README.md
- + azure-pipelines.yml
- debian/changelog
- debian/control
- debian/tests/run-unit-test
- lib2bit/2bit.c
- py2bit.h
- py2bitTest/test.py
- setup.py
Changes:
=====================================
.travis.yml deleted
=====================================
@@ -1,10 +0,0 @@
-language: python
-python:
- - "2.6"
- - "2.7"
- - "3.3"
- - "3.4"
- - "3.5"
- - "3.6"
-install: python ./setup.py install
-script: nosetests -sv
=====================================
README.md
=====================================
@@ -15,6 +15,8 @@ Table of Contents
* [Print file information](#print-file-information)
* [Fetch a sequence](#fetch-a-sequence)
* [Fetch per-base statistics](#fetch-per-base-statistics)
+ * [Fetch masked blocks](#fetch-masked-blocks)
+ * [Close a file](#close-a-file)
* [A note on coordinates](#a-note-on-coordinates)
# Installation
@@ -108,6 +110,31 @@ If integer counts are preferred, then they can instead be returned.
>>> tb.bases("chr1", 24, 74, False)
{'A': 6, 'C': 6, 'T': 6, 'G': 6}
+## Fetch masked blocks
+
+There are two kinds of masking blocks that can be present in 2bit files: hard-masked and soft-masked. Hard-masked blocks are stretches of NNNN, as are commonly found near telomeres and centromeres. Soft-masked blocks are runs of lowercase A/C/T/G, typically indicating repeat elements or low-complexity stretches. In can sometimes be useful to query this information from 2bit files:
+
+ >>> tb.hardMaskedBlocks("chr1")
+ [(0, 50), (100, 150)]
+
+In this (small) example, there are two stretches of hard-masked sequence, from 0 to 50 and again from 100 to 150 (see the note below about coordinates). If you would instead like to query all blocks overlapping with a specific region, you can specify the region bounds:
+
+ >>> tb.hardMaskedBlocks("chr1", 75, 101)
+ [(100, 150)]
+
+If there are no overlapping regions, then an empty list is returned:
+
+ >>> tb.hardMaskedBlocks("chr1", 75, 100)
+ []
+
+Instead of `hardMaskedBlocks()`, one can use `softMaskedBlocks()` in an identical manner:
+
+ >>> tb = py2bit.open("foo.2bit", storeMasked=True)
+ >>> tb.softMaskedBlocks("chr1")
+ [(62, 70)]
+
+As shown, you **must** specify `storeMasked=True` or you will receive a run time error.
+
## Close a file
A `TwoBit` object can be closed with the `close()` method.
=====================================
azure-pipelines.yml
=====================================
@@ -0,0 +1,36 @@
+pr:
+ autoCancel: true
+
+jobs:
+
+- job: 'Linux'
+ pool:
+ vmImage: 'ubuntu-latest'
+ strategy:
+ matrix:
+ Python36:
+ python.version: '3.6'
+ Python37:
+ python.version: '3.7'
+ Python38:
+ python.version: '3.8'
+ Python39:
+ python.version: '3.9'
+ Python310:
+ python.version: '3.10'
+ maxParallel: 5
+
+ steps:
+ - bash: echo "##vso[task.prependpath]/usr/share/miniconda/bin"
+ displayName: Add conda to PATH
+
+ - bash: conda create -n foo -q --yes -c conda-forge -c bioconda python=$(python.version) libcurl zlib pip nose gcc_linux-64
+ displayName: Installing dependencies
+ - bash: |
+ source activate foo
+ python -m pip install . --no-deps --ignore-installed -vvv
+ displayName: Installing py2bit
+ - bash: |
+ source activate foo
+ nosetests -sv
+ displayName: Test py2bit
=====================================
debian/changelog
=====================================
@@ -1,3 +1,13 @@
+python-py2bit (0.3.1-1) unstable; urgency=medium
+
+ * Team upload.
+ * New upstream version 0.3.1
+ * Bump Standards-Version to 4.6.1 (no changes needed)
+ * Remove myself from uploaders
+ * d/t/run-uni-test: Use py3versions -s instead
+
+ -- Nilesh Patra <nilesh at debian.org> Tue, 09 Aug 2022 23:49:53 +0530
+
python-py2bit (0.3.0-6) unstable; urgency=medium
* Team upload.
=====================================
debian/control
=====================================
@@ -2,10 +2,10 @@ Source: python-py2bit
Section: science
Priority: optional
Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
-Uploaders: Steffen Moeller <moeller at debian.org>, Nilesh Patra <nilesh at debian.org>
+Uploaders: Steffen Moeller <moeller at debian.org>
Build-Depends: debhelper-compat (= 13), dh-python,
python3-all-dev, python3-setuptools
-Standards-Version: 4.5.0
+Standards-Version: 4.6.1
Homepage: https://github.com/deeptools/py2bit/
Vcs-Browser: https://salsa.debian.org/med-team/python-py2bit
Vcs-Git: https://salsa.debian.org/med-team/python-py2bit.git
=====================================
debian/tests/run-unit-test
=====================================
@@ -2,7 +2,7 @@
set -e
-for py in $(py3versions -r 2> /dev/null)
+for py in $(py3versions -s 2> /dev/null)
do
$py -m unittest discover -v
done
=====================================
lib2bit/2bit.c
=====================================
@@ -278,6 +278,7 @@ uint8_t getByteMaskFromOffset(int offset) {
void *twobitBasesWorker(TwoBit *tb, uint32_t tid, uint32_t start, uint32_t end, int fraction) {
void *out;
uint32_t tmp[4] = {0, 0, 0, 0}, len = end - start + (start % 4), i = 0, j = 0;
+ uint32_t seqLen = end - start;
uint32_t blockStart, blockEnd, maskIdx = (uint32_t) -1, maskStart, maskEnd, foo;
uint8_t *bytes = NULL, mask = 0, offset;
@@ -375,10 +376,10 @@ void *twobitBasesWorker(TwoBit *tb, uint32_t tid, uint32_t start, uint32_t end,
//out is in TCAG order, since that's how 2bit is stored.
//However, for whatever reason I went with ACTG in the first release...
if(fraction) {
- ((double*) out)[0] = ((double) tmp[2])/((double) len);
- ((double*) out)[1] = ((double) tmp[1])/((double) len);
- ((double*) out)[2] = ((double) tmp[0])/((double) len);
- ((double*) out)[3] = ((double) tmp[3])/((double) len);
+ ((double*) out)[0] = ((double) tmp[2])/((double) seqLen);
+ ((double*) out)[1] = ((double) tmp[1])/((double) seqLen);
+ ((double*) out)[2] = ((double) tmp[0])/((double) seqLen);
+ ((double*) out)[3] = ((double) tmp[3])/((double) seqLen);
} else {
((uint32_t*) out)[0] = tmp[2];
((uint32_t*) out)[1] = tmp[1];
=====================================
py2bit.h
=====================================
@@ -1,7 +1,7 @@
#include <Python.h>
#include "2bit.h"
-#define pyTwoBitVersion "0.3.0"
+#define pyTwoBitVersion "0.3.1"
typedef struct {
PyObject_HEAD
=====================================
py2bitTest/test.py
=====================================
@@ -31,6 +31,8 @@ class Test():
def testSequence(self):
tb = py2bit.open(self.fname, True)
assert(tb.sequence("chr1") == "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNACGTACGTACGTagctagctGATCGATCGTAGCTAGCTAGCTAGCTGATCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN")
+ assert(tb.sequence("chr1", 1, 2) == "N")
+ assert(tb.sequence("chr1", 1, 3) == "NN")
assert(tb.sequence("chr1", 0, 1000) == "NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNACGTACGTACGTagctagctGATCGATCGTAGCTAGCTAGCTAGCTGATCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN")
assert(tb.sequence("chr1", 24, 74) == "NNNNNNNNNNNNNNNNNNNNNNNNNNACGTACGTACGTagctagctGATC")
tb.close()
@@ -42,12 +44,6 @@ class Test():
assert(tb.bases("chr1", 24, 74, False) == {'A': 6, 'C': 6, 'T': 6, 'G': 6})
tb.close()
- def testSequence(self):
- tb = py2bit.open(self.fname, True)
- assert(tb.sequence("chr1", 1, 3) == "NN")
- assert(tb.sequence("chr1", 1, 2) == "N")
- tb.close()
-
def testHardMaskedBlocks(self):
tb = py2bit.open(self.fname, True)
assert(tb.hardMaskedBlocks("chr1") == [(0, 50), (100, 150)])
=====================================
setup.py
=====================================
@@ -17,13 +17,13 @@ module1 = Extension('py2bit',
include_dirs = ['lib2bit', sysconfig.get_config_var("INCLUDEPY")])
setup(name = 'py2bit',
- version = '0.3.0',
+ version = '0.3.1',
description = 'A package for accessing 2bit files using lib2bit',
author = "Devon P. Ryan",
- author_email = "ryan at ie-freiburg.mpg.de",
+ author_email = "dpryan79 at gmail.com",
url = "https://github.com/deeptools/py2bit",
license = "MIT",
- download_url = "https://github.com/deeptools/py2bit/tarball/0.3.0",
+ download_url = "https://github.com/deeptools/py2bit",
keywords = ["bioinformatics", "2bit"],
classifier = ["Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
@@ -31,13 +31,8 @@ setup(name = 'py2bit',
"Programming Language :: C",
"Programming Language :: Python",
"Programming Language :: Python :: 2",
- "Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
- "Programming Language :: Python :: 3.3",
- "Programming Language :: Python :: 3.4",
- "Programming Language :: Python :: 3.5",
- "Programming Language :: Python :: 3.6",
"Programming Language :: Python :: Implementation :: CPython",
"Operating System :: POSIX",
"Operating System :: Unix",
View it on GitLab: https://salsa.debian.org/med-team/python-py2bit/-/compare/edf1be2e5b55a30f0f332a11b5f61288fb47f0f3...ae531f2f0e64a243a66f17d5936010fdfe786e38
--
View it on GitLab: https://salsa.debian.org/med-team/python-py2bit/-/compare/edf1be2e5b55a30f0f332a11b5f61288fb47f0f3...ae531f2f0e64a243a66f17d5936010fdfe786e38
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/20220809/690244ff/attachment-0001.htm>
More information about the debian-med-commit
mailing list