pandas_genomics.arrays.GenotypeDtype¶
-
class
pandas_genomics.arrays.GenotypeDtype(variant: Optional[pandas_genomics.scalars.Variant] = None)[source]¶ An ExtensionDtype for genotype data.
- Parameters
- variant: Variant or None
The ~Variant associated with the genotype. If None, use an anonymous variant
Examples
v = Variant(chromosome=’12’, position=112161652, id=’rs12462’, ref=’T’, alt=[‘C’,], score=25) >>> GenotypeDtype(v) genotype(2n)[12; 112161652; rs12462; T; C]Q25
- Attributes
- variant: Variant
The variant that the datatype is specific to
-
__init__(variant: Optional[pandas_genomics.scalars.Variant] = None)[source]¶ Initialize self. See help(type(self)) for accurate signature.
Methods
__init__([variant])Initialize self.
construct_array_type()Return the array type associated with this dtype
construct_from_string(string)Construct a GenotypeDtype from a string.
from_genotype(genotype)Construct a GenotypeDtype from a Genotype.
is_dtype(dtype)Return a boolean if the passed type can be processed as this dtype
reset_cache()clear the cache
unpack_genotype(genotype)Attributes
baseisbuiltinisnativeitemsizekindna_valueReturn the genotype with variant information but no alleles specified
nameA string identifying the data type.
namesOrdered list of field names, or None if there are no fields.
numshapesubdtype