[med-svn] [Git][med-team/cyvcf2][master] 4 commits: New upstream version 0.30.1
Nilesh Patra
gitlab at salsa.debian.org
Sat Dec 12 13:23:36 GMT 2020
Nilesh Patra pushed to branch master at Debian Med / cyvcf2
Commits:
654e9ee1 by Nilesh Patra at 2020-12-06T20:18:29+05:30
New upstream version 0.30.1
- - - - -
f0945ea4 by Nilesh Patra at 2020-12-06T20:18:29+05:30
routine-update: New upstream version
- - - - -
7936b687 by Nilesh Patra at 2020-12-06T20:18:31+05:30
Update upstream source from tag 'upstream/0.30.1'
Update to upstream version '0.30.1'
with Debian dir 0bff16dd6e86ac11a40299bc887d02474ee4a4c7
- - - - -
6ef0b90e by Nilesh Patra at 2020-12-06T20:18:35+05:30
routine-update: Ready to upload to unstable
- - - - -
4 changed files:
- cyvcf2/__init__.py
- cyvcf2/cyvcf2.pyx
- cyvcf2/tests/test_reader.py
- debian/changelog
Changes:
=====================================
cyvcf2/__init__.py
=====================================
@@ -2,4 +2,4 @@ from .cyvcf2 import (VCF, Variant, Writer, r_ as r_unphased, par_relatedness,
par_het)
Reader = VCFReader = VCF
-__version__ = "0.30.0"
+__version__ = "0.30.1"
=====================================
cyvcf2/cyvcf2.pyx
=====================================
@@ -1429,7 +1429,7 @@ cdef class Variant(object):
def set_format(self, name, np.ndarray data not None):
"""
set the format field given by name..
- data must be a numpy array of type float or int
+ data must be a numpy array of type float, int or string (fixed length ASCII np.bytes_)
"""
cdef int n_samples = self.vcf.n_samples
if len(data) % n_samples != 0:
@@ -1438,6 +1438,7 @@ cdef class Variant(object):
cdef np.ndarray[np.float32_t, mode="c"] afloat
cdef np.ndarray[np.int32_t, mode="c"] aint
cdef char *bytesp
+ cdef size_t i
cdef int size
cdef int ret
@@ -1452,6 +1453,10 @@ cdef class Variant(object):
if len((<object>data).shape) > 1:
size *= data.shape[1]
afloat = data.astype(np.float32).reshape((size,))
+ isnan = np.isnan(afloat)
+ for i in range(size):
+ if isnan[i]:
+ bcf_float_set(&afloat[i], bcf_float_missing)
ret = bcf_update_format_float(self.vcf.hdr, self.b, to_bytes(name), &afloat[0], size)
elif np.issubdtype(data.dtype, np.bytes_):
if len((<object>data).shape) > 1:
=====================================
cyvcf2/tests/test_reader.py
=====================================
@@ -1125,3 +1125,16 @@ def test_no_seqlen():
with assert_raises(AttributeError) as ae:
vcf.seqlens
assert isinstance(ae.exception, AttributeError)
+
+def test_set_unknown_format():
+ vcf = VCF(VCF_PATH)
+ vcf.add_format_to_header({'ID':'NEW', 'Type':'Float', 'Number':1, 'Description':'...'})
+
+ v = next(vcf)
+ arr = np.array([[1.1] for s in vcf.samples])
+ arr[-1][0] = np.nan
+ v.set_format('NEW', arr)
+ record = str(v)
+ parts = record.split()
+ assert parts[-1][-1] == '.'
+ assert parts[-2][-3:] == '1.1'
=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+cyvcf2 (0.30.1-1) unstable; urgency=medium
+
+ * New upstream version
+
+ -- Nilesh Patra <npatra974 at gmail.com> Sun, 06 Dec 2020 20:18:35 +0530
+
cyvcf2 (0.30.0-1) unstable; urgency=medium
* New upstream version
View it on GitLab: https://salsa.debian.org/med-team/cyvcf2/-/compare/ecec6f64b4dfe59cc6ea4c47c0d4693e959e2571...6ef0b90e97f3fff257f45ea9ca0ef0238104b7a3
--
View it on GitLab: https://salsa.debian.org/med-team/cyvcf2/-/compare/ecec6f64b4dfe59cc6ea4c47c0d4693e959e2571...6ef0b90e97f3fff257f45ea9ca0ef0238104b7a3
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/20201212/1301203a/attachment-0001.html>
More information about the debian-med-commit
mailing list