Last data update: 2014.03.03

R: Class "PhenList"
PhenList-classR 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 <- PhenList(dataset=read.csv(file),
            testGenotype="Sparc/Sparc")
    class(test)
    
    file <- system.file("extdata", "test2.csv", package="PhenStat")
    test2 <- PhenList(dataset=read.csv(file),
            testGenotype="Arid4a/Arid4a",
            refGenotype="+/+",
            hemiGenotype="Arid4a/+",
            dataset.colname.weight="Weight.Value")
    getStat(test2)
    testGenotype(test2)
    refGenotype(test2)
    hemiGenotype(test2)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(PhenStat)
> png(filename="/home/ddbj/snapshot/RGM3/R_BC/result/PhenStat/PhenList-class.Rd_%03d_medium.png", width=480, height=480)
> ### Name: PhenList-class
> ### Title: Class "PhenList"
> ### Aliases: PhenList-class dataset,PhenList-method
> ###   refGenotype,PhenList-method testGenotype,PhenList-method
> ###   hemiGenotype,PhenList-method getColumn,PhenList,character-method
> ###   getColumnBatchAdjusted,PhenList,character-method
> ###   getColumnWeightBatchAdjusted,PhenList,character-method
> ###   getStat,PhenList-method getVariables,PhenList-method
> ###   multipleBatches,PhenList-method setBatch,PhenList,character-method
> ###   setGenotype,PhenList,character-method
> ###   setMissingValue,PhenList,character-method
> ###   setSex,PhenList,character-method setWeight,PhenList,character-method
> ### Keywords: methods classes
> 
> ### ** Examples
> 
>     file <- system.file("extdata", "test1.csv", package="PhenStat")
>     test <- PhenList(dataset=read.csv(file),
+             testGenotype="Sparc/Sparc")
Warning:
Dataset's column 'Assay.Date' has been renamed to 'Batch' and will be used for the batch effect modelling.

Information:
Dataset's 'Genotype' column has following values: '+/+', 'Sparc/Sparc'

Information:
Dataset's 'Sex' column has following value(s): 'Female', 'Male'

>     class(test)
[1] "PhenList"
attr(,"package")
[1] "PhenStat"
>     
>     file <- system.file("extdata", "test2.csv", package="PhenStat")
>     test2 <- PhenList(dataset=read.csv(file),
+             testGenotype="Arid4a/Arid4a",
+             refGenotype="+/+",
+             hemiGenotype="Arid4a/+",
+             dataset.colname.weight="Weight.Value")
Warning:
Dataset's column 'Assay.Date' has been renamed to 'Batch' and will be used for the batch effect modelling.

Warning:
Hemizygotes 'Arid4a/+' have been relabelled to test genotype 'Arid4a/Arid4a'.
If you don't want this behaviour then don't define 'hemiGenotype' argument.

Information:
Dataset's 'Genotype' column has following values: '+/+', 'Arid4a/Arid4a'

Information:
Dataset's 'Sex' column has following value(s): 'Female', 'Male'

>     getStat(test2)
       Variables Numeric Continuous Levels NObs   Mean StdDev Minimum Maximum
1   Age.In.Weeks    TRUE      FALSE     10  954     NA     NA      NA      NA
2            Alb    TRUE       TRUE    487  951  25.77   1.75   10.63   30.70
3            Alp    TRUE       TRUE    640  949 129.42  31.91   54.40  256.60
4            Alt    TRUE       TRUE    813  948 147.38  96.82   12.80  643.20
5            Amy    TRUE       TRUE    839  948 688.12 120.40  336.30 1172.10
6    Anaesthetic   FALSE      FALSE      1  954     NA     NA      NA      NA
7          Batch   FALSE      FALSE     67  954     NA     NA      NA      NA
8            Ast    TRUE       TRUE    805  949 170.56  87.32   42.50  541.60
9     Birth.Date   FALSE      FALSE    238  954     NA     NA      NA      NA
10  Blood.Volume    TRUE      FALSE     16  954     NA     NA      NA      NA
11            Ca    TRUE      FALSE     42  951     NA     NA      NA      NA
12           Che    TRUE       TRUE    163  228   6.18   0.93    2.86    8.52
13          Chol    TRUE       TRUE    441  954   5.18   1.37    2.22    9.17
14            Ck    TRUE       TRUE    820  933 208.01 170.88   23.90 1010.80
15            Cl    TRUE       TRUE    143  952 106.38   2.68   94.20  116.70
16   Cohort.Name   FALSE      FALSE     73  954     NA     NA      NA      NA
17   Colony.Name   FALSE      FALSE    107  954     NA     NA      NA      NA
18 Colony.Prefix   FALSE      FALSE    107  954     NA     NA      NA      NA
19   Core.Strain   FALSE      FALSE      1  954     NA     NA      NA      NA
20         Creat    TRUE       TRUE    108  947   9.66   1.98    3.90   20.70
21          Frct    TRUE       TRUE    393  762 186.73  13.24  126.05  221.62
22   Full.Strain   FALSE      FALSE     21  954     NA     NA      NA      NA
23     Gene.Name   FALSE      FALSE    107  954     NA     NA      NA      NA
24      Genotype   FALSE      FALSE      2  954     NA     NA      NA      NA
25          Gluc    TRUE       TRUE    762  954  27.00   5.57    4.94   42.53
26          Glyc    TRUE       TRUE    719  922 211.05  45.40   98.50  357.50
27           Hdl    TRUE       TRUE    284  953   3.33   0.74    1.47    5.06
28          Iron    TRUE       TRUE    326  952  33.83   9.30    7.80  111.10
29             K    TRUE      FALSE     30  934     NA     NA      NA      NA
30           Ldh    TRUE       TRUE    768  806 803.78 391.86  261.30 3215.00
31           Ldl    TRUE       TRUE    206  954   1.32   0.52    0.44    3.35
32            Mg    TRUE      FALSE     40  951     NA     NA      NA      NA
33         Mouse   FALSE      FALSE    954  954     NA     NA      NA      NA
34    Mouse.Name   FALSE      FALSE    954  954     NA     NA      NA      NA
35            Na    TRUE       TRUE    167  952 142.67   3.36  125.50  154.50
36         Nefac    TRUE       TRUE    503  952   0.54   0.18    0.17    1.23
37          Phos    TRUE       TRUE    172  950   2.78   0.36    1.49    4.05
38    Pil.Holder   FALSE      FALSE      2  954     NA     NA      NA      NA
39      Pipeline   FALSE      FALSE      1  954     NA     NA      NA      NA
40           Sex   FALSE      FALSE      2  954     NA     NA      NA      NA
41         Tbilb    TRUE       TRUE    575  946  47.19  32.74    4.50  469.00
42         Tbilc    TRUE      FALSE     37  939     NA     NA      NA      NA
43            Tp    TRUE       TRUE    156  952  49.30   3.11   35.20   60.00
44         Trigs    TRUE       TRUE    161  954   0.92   0.36    0.26    2.74
45            Ua    TRUE       TRUE    331  815  25.07  11.16    7.70   90.70
46          Urea    TRUE       TRUE     74  948   7.93   1.24    4.90   14.40
47        Weight    TRUE       TRUE    231  942  36.06   5.27   21.50   51.10
>     testGenotype(test2)
[1] "Arid4a/Arid4a"
>     refGenotype(test2)
[1] "+/+"
>     hemiGenotype(test2)
[1] "Arid4a/+"
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>