Beispiel #1
0
    def to_allele_counts(self, alleles=None, **storage_kwargs):
        # determine alleles to count
        if alleles is None:
            m = self.max()
            alleles = list(range(m + 1))

        out = self.apply_method('to_allele_counts',
                                kwargs=dict(alleles=alleles),
                                **storage_kwargs)
        return _chunked.ChunkedArray(out)
Beispiel #2
0
    def mask(self, mask):

        # check input
        if not hasattr(mask, 'shape'):
            mask = np.asarray(mask)
        if mask.shape != self.shape[:2]:
            raise ValueError('mask has incorrect shape')

        # store
        self._mask = _chunked.ChunkedArray(mask)
Beispiel #3
0
 def is_doubleton(self, allele=1, **storage_kwargs):
     out = self.apply_method('is_doubleton',
                             kwargs=dict(allele=allele),
                             **storage_kwargs)
     return _chunked.ChunkedArray(out)
Beispiel #4
0
 def is_non_segregating(self, allele=None, **storage_kwargs):
     out = self.apply_method('is_non_segregating',
                             kwargs=dict(allele=allele),
                             **storage_kwargs)
     return _chunked.ChunkedArray(out)
Beispiel #5
0
 def is_segregating(self, **storage_kwargs):
     out = self.apply_method('is_segregating', **storage_kwargs)
     return _chunked.ChunkedArray(out)
Beispiel #6
0
 def is_non_variant(self, **storage_kwargs):
     out = self.apply_method('is_non_variant', **storage_kwargs)
     return _chunked.ChunkedArray(out)
Beispiel #7
0
 def max_allele(self, **storage_kwargs):
     out = self.apply_method('max_allele', **storage_kwargs)
     return _chunked.ChunkedArray(out)
Beispiel #8
0
 def allelism(self, **storage_kwargs):
     out = self.apply_method('allelism', **storage_kwargs)
     return _chunked.ChunkedArray(out)
Beispiel #9
0
 def to_frequencies(self, fill=np.nan, **storage_kwargs):
     out = self.apply_method('to_frequencies',
                             kwargs=dict(fill=fill),
                             **storage_kwargs)
     return _chunked.ChunkedArray(out)
Beispiel #10
0
 def to_gt(self, phased=False, max_allele=None, **storage_kwargs):
     out = self.apply_method('to_gt',
                             kwargs=dict(phased=phased,
                                         max_allele=max_allele),
                             **storage_kwargs)
     return _chunked.ChunkedArray(out)
Beispiel #11
0
 def to_packed(self, boundscheck=True, **storage_kwargs):
     out = self.apply_method('to_packed',
                             kwargs=dict(boundscheck=boundscheck),
                             **storage_kwargs)
     return _chunked.ChunkedArray(out)
Beispiel #12
0
 def to_n_alt(self, fill=0, dtype='i1', **storage_kwargs):
     out = self.apply_method('to_n_alt',
                             kwargs=dict(fill=fill, dtype=dtype),
                             **storage_kwargs)
     return _chunked.ChunkedArray(out)