snipar.read.phenotype module

snipar.read.phenotype.match_phenotype(G, y, pheno_ids)[source]

Match a phenotype to a genotype array by individual IDs.

Args:
Ggtarray

genotype array to match phenotype to

yarray

vector of phenotype values

pheno_ids: array

vector of individual IDs corresponding to phenotype vector, y

Returns:
yarray

vector of phenotype values matched by individual IDs to the genotype array

snipar.read.phenotype.read_covariates(covar, pheno_ids=None, missing_char='NA')[source]
snipar.read.phenotype.read_phenotype(phenofile, missing_char='NA', phen_index=1)[source]

Read a phenotype file and remove missing values.

Args:
phenofilestr

path to plain text phenotype file with columns FID, IID, phenotype1, phenotype2, …

missing_charstr

The character that denotes a missing phenotype value; ‘NA’ by default.

phen_indexint

The index of the phenotype (counting from 1) if multiple phenotype columns present in phenofile

Returns:
yarray

vector of non-missing phenotype values from specified column of phenofile

pheno_ids: array

corresponding vector of individual IDs (IID)