mecfs_bio.build_system.sample_size_spec
Specification of how the sample size (N) of a GWAS should be supplied to downstream analyses.
Most GWAS have a single scalar sample size, but meta-analyses and synthetic GWAS
produced by GenomicSEM have a sample size that varies per variant. The two cases
are modelled by :class:ScalarSampleSize and :class:PerVariantSampleSize
respectively, so that call sites and tasks can branch on a named type rather than
passing a bare int and a separate flag.
Classes:
-
PerVariantSampleSize–The sample size varies per variant and is read from
column. -
ScalarSampleSize–A single sample size shared by every variant in the GWAS.
Functions:
-
coerce_sample_size–Wrap a bare
intas a :class:ScalarSampleSizefor backwards -
per_variant_column–The data column holding the per-variant sample size, or
Nonefor a
Attributes:
PerVariantSampleSize
The sample size varies per variant and is read from column.
The column must already be present on the GWAS data (e.g. the per-variant effective sample size of a meta-analysis) and survive sumstats creation.
Attributes:
ScalarSampleSize
coerce_sample_size
Wrap a bare int as a :class:ScalarSampleSize for backwards
compatibility with call sites that pass a scalar sample size directly.
Source code in mecfs_bio/build_system/sample_size_spec.py
per_variant_column
The data column holding the per-variant sample size, or None for a
scalar sample size (so callers know not to write an N column).