genetest.phenotypes package¶
Submodules¶
genetest.phenotypes.core module¶
-
class
genetest.phenotypes.core.
PhenotypesContainer
[source]¶ Bases:
object
-
get_nb_samples
()[source]¶ Returns the number of samples.
Returns: The number of samples. Return type: int
-
get_nb_variables
()[source]¶ Returns the number of variables.
Returns: The number of variables. Return type: int
-
get_phenotypes
(li=None)[source]¶ Returns a dataframe of phenotypes.
Parameters: li (list) – A list of phenotypes to extract (default: None means all phenotypes). Returns: A dataframe containing the phenotypes (with the sample IDs as index). Return type: pandas.DataFrame
-
get_sex
()[source]¶ Returns the sex for all samples.
Returns: The sex for all samples. Return type: pandas.Series
-
genetest.phenotypes.text module¶
-
class
genetest.phenotypes.text.
TextPhenotypes
(filename, sample_column='sample', field_separator='t', missing_values=None, repeated_measurements=False, keep_sample_column=False, sex_column=None)[source]¶ Bases:
genetest.phenotypes.core.PhenotypesContainer
Instantiate a new TextPhenotypes object.
Parameters: - filename (str) – The name of the text file containing the phenotypes.
- sample_column (str) – The name of the column containing the sample identification number (to fit with the genotypes).
- field_separator (str) – The field separator (default is tabulation).
- missing_values (str or list or dict) – The missing value(s).
- repeated_measurements (bool) – Are the data containing repeated measurements (e.g. for MixedLM).
- sex_column (str) – The name of the column containing the sex for each sample.
-
get_nb_samples
()[source]¶ Returns the number of samples.
Returns: The number of samples. Return type: int
-
get_nb_variables
()[source]¶ Returns the number of variables.
Returns: The number of variables. Return type: int
-
get_phenotypes
(li=None)[source]¶ Returns a dataframe of phenotypes.
Returns: A dataframe containing the phenotypes (with the sample IDs as index). Return type: pandas.DataFrame
-
is_repeated
()[source]¶ Check if the phenotypes contain repeated measurements.
Returns: True
if the data contains repeated measurements,False
otherwise.Return type: bool