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:
- G
gtarray
genotype array to match phenotype to
- y
array
vector of phenotype values
- pheno_ids:
array
vector of individual IDs corresponding to phenotype vector, y
- G
- Returns:
- y
array
vector of phenotype values matched by individual IDs to the genotype array
- y
- snipar.read.phenotype.read_phenotype(phenofile, missing_char='NA', phen_index=1)[source]
Read a phenotype file and remove missing values.
- Args:
- phenofile
str
path to plain text phenotype file with columns FID, IID, phenotype1, phenotype2, …
- missing_char
str
The character that denotes a missing phenotype value; ‘NA’ by default.
- phen_index
int
The index of the phenotype (counting from 1) if multiple phenotype columns present in phenofile
- phenofile
- Returns:
- y
array
vector of non-missing phenotype values from specified column of phenofile
- pheno_ids:
array
corresponding vector of individual IDs (IID)
- y