[med-svn] [Git][med-team/cyvcf2][master] 4 commits: New upstream version 0.20.9
Nilesh Patra
gitlab at salsa.debian.org
Mon Oct 12 06:50:54 BST 2020
Nilesh Patra pushed to branch master at Debian Med / cyvcf2
Commits:
aa57799f by Nilesh Patra at 2020-10-12T11:07:07+05:30
New upstream version 0.20.9
- - - - -
4f69940f by Nilesh Patra at 2020-10-12T11:07:07+05:30
routine-update: New upstream version
- - - - -
9eecc29d by Nilesh Patra at 2020-10-12T11:07:09+05:30
Update upstream source from tag 'upstream/0.20.9'
Update to upstream version '0.20.9'
with Debian dir 04e0e813a0277ba03df985582e47c957167e5dd1
- - - - -
b15b8032 by Nilesh Patra at 2020-10-12T11:07:26+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.20.8"
+__version__ = "0.20.9"
=====================================
cyvcf2/cyvcf2.pyx
=====================================
@@ -1024,13 +1024,14 @@ cdef class Genotypes(object):
result.append((v >> 1) - 1)
return result
- def array(Genotypes self):
+ def array(Genotypes self, int fill=-2):
"""
array returns an int16 numpy array of shape n_samples, (ploidy + 1).
The last column indicates phased (1 is phased, 0 is unphased).
The other columns indicate the alleles, e.g. [0, 1, 1] is 0|1.
- Unknown alleles are represented by -1 and mixed-ploidy arrays
- are padded with -2 to indicate non-alleles.
+ Unknown alleles are represented by -1.
+ If a mixture of ploidy levels are present then the array is padded
+ with the `fill` value (default = -2) to indicate non-alleles.
"""
cdef np.ndarray[np.int16_t, ndim=2] to_return = np.zeros((self.n_samples, self.ploidy + 1),
dtype=np.int16)
@@ -1044,7 +1045,7 @@ cdef class Genotypes(object):
for allele in range(self.ploidy):
raw = self._raw[ind * self.ploidy + allele]
if raw == bcf_int32_vector_end:
- to_return[ind, allele] = -2
+ to_return[ind, allele] = fill
else:
to_return[ind, allele] = (raw >> 1) - 1
to_return[ind, self.ploidy] = (self._raw[ind * self.ploidy + 1] & 1) == 1
=====================================
cyvcf2/tests/test_reader.py
=====================================
@@ -841,6 +841,12 @@ def test_access_genotype_array():
np.array([[-1, -2, 1], [0, 2, 1]], dtype=np.int16)
)
+ # test fill value
+ np.testing.assert_array_equal(
+ v.genotype.array(fill=-9),
+ np.array([[-1, -9, 1], [0, 2, 1]], dtype=np.int16)
+ )
+
def test_alt_homozygous_gt():
vcf = VCF(os.path.join(HERE, "test-multiallelic-homozygous-alt.vcf.gz"))
assert vcf is not None
=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+cyvcf2 (0.20.9-1) unstable; urgency=medium
+
+ * New upstream version
+
+ -- Nilesh Patra <npatra974 at gmail.com> Mon, 12 Oct 2020 11:07:26 +0530
+
cyvcf2 (0.20.8-1) unstable; urgency=medium
* New upstream version
View it on GitLab: https://salsa.debian.org/med-team/cyvcf2/-/compare/5caed555d5af14db7d311a0b8affe420fcabb75e...b15b803264bcf9df867dce792a785954f01aa7c3
--
View it on GitLab: https://salsa.debian.org/med-team/cyvcf2/-/compare/5caed555d5af14db7d311a0b8affe420fcabb75e...b15b803264bcf9df867dce792a785954f01aa7c3
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/20201012/bd135354/attachment-0001.html>
More information about the debian-med-commit
mailing list