effect
Below is an auto-generated summary of the xftsim.effect submodule API.
Summary
- class xftsim.effect.AdditiveEffects(beta, variant_indexer=None, component_indexer=None, standardized=True, scaled=True)
Bases:
object
Additive genetic effects object. Given matrix / vector of effects will provide various scalings / offsets for computation
- Parameters:
beta (
NDArray[Any
,Any]
) – Vector of diploid effectsvariant_indexer (
xft.index.HaploidVariantIndex | xft.index.DiploidVariantIndex
) – Variant indexer, will determine ploidy automaticallycomponent_indexer (
xft.index.ComponentIndex
, optional) – Phenotype component indexer, defaults to xft.index.ComponentIndex.RangeIndex if not providedstandardized (
bool
, optional) – True implies these are effects of standardized variants, by default Truescaled (
bool
, optional) – True implies these are effects of variants * sqrt(m_causal), by default True
- AF
diploid allele frequencies
- Type:
NDArray
- beta_scaled_standardized_diploid
Diploid effects scaled of standardized variants multiplied by number of causal variants per phenotype
- Type:
NDArray
- beta_scaled_standardized_haploid
haploid variant of above
- Type:
NDArray
- beta_scaled_unstandardized_diploid
Diploid effects scaled of unstandardized variants multiplied by number of causal variants per phenotype
- Type:
NDArray
- beta_scaled_unstandardized_haploid
haploid variant of above
- Type:
NDArray
- beta_unscaled_standardized_diploid
Diploid effects scaled of standardized variants unscaled by number of causal variants per phenotype
- Type:
NDArray
- beta_unscaled_standardized_haploid
haploid variant of above
- Type:
NDArray
- beta_unscaled_unstandardized_diploid
Diploid effects scaled of unstandardized variants unscaled by number of causal variants Multiply these against (0,1,2) raw genotypes and subtract offset to obtain phenotypes
- Type:
NDArray
- beta_unscaled_unstandardized_haploid
Haploid variant of above
- Type:
NDArray
- beta_raw_diploid
Alias for beta_unscaled_unstandardized_diploid
- Type:
NDArray
- beta_raw_haploid
Alias for beta_unscaled_unstandardized_haploid
- Type:
NDArray
- component_indexer
- Type:
xft.index.ComponentIndex
- k
Number of phenotypes (columns of effect matrix)
- Type:
int
- m
Number of diploid variants
- Type:
int
- offset
To compute phenotypes, add offset after multiplying by beta_raw_* to mean deviate under HWE
- Type:
NDArray
- variant_indexer
- Type:
xft.index.HaploidVariantIndex
- property beta_raw_diploid
- property beta_raw_haploid
- property beta_scaled_standardized_haploid
- property beta_scaled_unstandardized_haploid
- property beta_unscaled_standardized_haploid
- property beta_unscaled_unstandardized_haploid
- corr()
- property m_causal
- property offset
- class xftsim.effect.GCTAEffects(vg, variant_indexer=None, component_indexer=None)
Bases:
AdditiveEffects
Additive genetic effects object under GCTA infinitessimal model <CITE>
Under this genetic architecture, all variants are causal and standardized genetic variants / sqrt(m) have the user specified (possibly diagonal) variance covariance matrix
- Parameters:
vg (
Iterable | NDArray
) – Vector of genetic variances or genetic variance/covariance matrixvariant_indexer (
xft.index.HaploidVariantIndex | xft.index.DiploidVariantIndex
) – Variant indexer, will determine ploidy automaticallycomponent_indexer (
xft.index.ComponentIndex
, optional) – Phenotype component indexer, defaults to xft.index.ComponentIndex.RangeIndex if not provided
- class xftsim.effect.NonOverlappingEffects(vg, proportions=None, variant_indexer=None, component_indexer=None, permute=True)
Bases:
AdditiveEffects
Additive genetic effects object under non-infinitessimal model with no pleoitropy
Under this genetic architecture, the genome is partitioned into k+1 components corresponding to k sets of variants corresponding to those causal for each trait together with a final set of variants not causal for any traits. Within each kth set of causal variants, standardized variants are Gaussian with variance vg[k] / sqrt(proportions[k])
- Parameters:
vg (
Iterable
) – Vector of genetic variances or genetic variance/covariance matrixproportions (
Iterable
) – Proportion of variants causal for each trait. If an extra value is provided, this will be the number of variants that are noncausal for all traits. Defaults to an equal number of variants per traitpermute (
bool
) – Permute variants? If False, causal variants for each phenotype will fall into contiguous blocks, defaults to Truevariant_indexer (
xft.index.HaploidVariantIndex | xft.index.DiploidVariantIndex
) – Variant indexer, will determine ploidy automaticallycomponent_indexer (
xft.index.ComponentIndex
, optional) – Phenotype component indexer, defaults to xft.index.ComponentIndex.RangeIndex if not provided