PhenList-class {PhenStat} | R Documentation

## Class "PhenList"

### Description

A list-based S4 class for storing phenotypic data. Helps to support data integrity checks and statistics calculation. The PhenList object can be created by using function `PhenList`.

### Explore PhenList object

PhenList object instance contains the following slots:

1. "datasetPL" where cleaned and checked dataset is stored: `getDataset(phenList)`

2. "testGenotype" where the genotype level to test is stored: `testGenotype(phenList)`

3. "refGenotype" where reference genotype value is stored with default value set to "+/+":

`refGenotype(phenList)`

4. "hemiGenotype" if defined contains the genotype value for hemizygous: `hemiGenotype(phenList)`

6. "dataset.clean" flag value is stored, see `PhenList` for more details:

`phenList@dataset.clean`

7. "dataset.colname" if defined contains dataset column names that have been renamed:

- `phenList@dataset.colname.batch` column name for batch values

- `phenList@dataset.colname.genotype` column name for genotype values

- `phenList@dataset.colname.sex` column name for sex values

- `phenList@dataset.colname.weight` column name for weight values

8. "dataset.values" if defined contains dataset values that have been changed during dataset cleaning process:

- `phenList@dataset.values.missingValue` value used as missing value in the orginal dataset

- `phenList@dataset.values.male` value used to label "males" in the original dataset

- `phenList@dataset.values.female` value used to label "females" in the original dataset

### Slots

`datasetPL`:

  Object of class `"data.frame"` ~~ dataset to work with

`refGenotype`:

  Object of class `"character"` ~~ reference genotype

`testGenotype`:

  Object of class `"character"` ~~ test genotype

`hemiGenotype`:

  Object of class `"character"` ~~ hemi genotype

`dataset.colname.batch`:

  Object of class `"character"` ~~ column name for batch values

`dataset.colname.genotype`:

  Object of class `"character"` ~~ column name for genotype values

`dataset.colname.sex`:

  Object of class `"character"` ~~ column name for sex values

`dataset.colname.weight`:

  Object of class `"character"` ~~ column name for weigth values

`dataset.values.missingValue`:

  Object of class `"character"` ~~ value used as missing value in the orginal dataset

`dataset.values.male`:

  Object of class `"character"` ~~ value used to label "males" in the original dataset

`dataset.values.female`:

  Object of class `"character"` ~~ value used to label "females" in the original dataset

`dataset.clean`:

  Object of class `"logical"` ~~ flag value is stored

`datasetUNF`:

  Object of class `"data.frame"` ~~ unfiltered dataset

### Methods

getDataset

  (accessor): Returns dataset

refGenotype

  (accessor): Returns reference genotype

testGenotype

  (accessor): Returns test genotype

hemiGenotype

  (accessor): Returns hemi genotype if specified

getColumn

  Returns specified column if exists

getColumnBatchAdjusted

  Returns specified column adjusted for batch effect

getColumnWeightBatchAdjusted

  Returns specified column adjusted for batch and weight effects

getStat

  Returns simple dataset statistics

getVariables

  Returns dataset column names

batchIn

  Returns TRUE if the batch is in the dataset, FALSE otherwise

weightIn

  Returns TRUE if the weight is in the dataset, FALSE otherwise

multipleBatches

  Returns TRUE if the batches are variable in the dataset, FALSE otherwise

noSexes

  Returns number of sexes in the dataset

setBatch

  Sets the batch column - change the column names

setGenotype

  Sets the genotype column - change the column names

setMissingValue

  Sets the missing value

setSex

  Sets the sex column - change the column names

setWeight

  Sets the weight column - change the column names

### Author(s)

Natalja Kurbatova

### See Also

`PhenList`

### Examples

        file <- system.file("extdata", "test1.csv", package="PhenStat")
        test <- PhenStat:::PhenList(dataset=read.csv(file,na.strings = '-'),
                testGenotype="Sparc/Sparc")
        class(test)

        file <- system.file("extdata", "test2.csv", package="PhenStat")
        test2 <- PhenStat:::PhenList(dataset=read.csv(file,na.strings = '-'),
                testGenotype="Arid4a/Arid4a",
                refGenotype="+/+",
                hemiGenotype="Arid4a/+",
                dataset.colname.weight="Weight.Value")
        PhenStat:::getStat(test2)
        PhenStat:::testGenotype(test2)
        PhenStat:::refGenotype(test2)
        PhenStat:::hemiGenotype(test2)

[Package PhenStat version 2.28.0 Index]