snp.data-class: Class "snp.data"

Description Slots Methods Author(s) See Also Examples

Description

This class contains objects holding large arrays of single nucleotide polymorphism (SNP) genotypes

Slots

nbytes:

number of bytes used to store data on a SNP

nids:

number of people

male:

male code

idnames:

ID names

nsnps:

number of SNPs

snpnames:

list of SNP names

chromosome:

list chromosomes corresponding to SNPs

coding:

list of nucleotide coding for the SNPs

strand:

strands of the SNPs

map:

list SNPs' positions

gtps:

snp.mx-class object used to store genotypes

Methods

[

signature(x = "snp.data", i = "ANY", j = "ANY", drop = "ANY"): subset operations. x[i,j] will select people listed in i and SNPs listed in j.

coerce

signature(from = "snp.data", to = "numeric"): map to codes 0, 1, 2, or NA

coerce

signature(from = "snp.data", to = "character"): map to actual nucleotide codes, e.g. "A/A", "A/G", "G/G", ""

coerce

signature(from = "snp.data", to = "genotype"): map to data frame with genotype-class data, for later use with package genetics

coerce

signature(from = "snp.data", to = "hsgeno"): map to data frame with allelic data frame, for later use with package haplo.stats

show

signature(object = "snp.data"): shows the object. Take care that the objects are usually very large!

summary

signature(object = "snp.data"): calculate allele frequencies, genotype frequencies, and chi-square tests for Hardy-Weinberg equilibrium. Results are returned as a dataframe

annotation

signature(object = "gwaa.data"), signature(object = "snp.data"): extracts annotation

idnames

signature(object = "gwaa.data"), signature(object = "snp.data"): extracts id names

snpnames

signature(object = "gwaa.data"), signature(object = "snp.data"): extracts snp names

nids

signature(object = "gwaa.data"), signature(object = "snp.data"): extracts number of ids

nsnps

signature(object = "gwaa.data"), signature(object = "snp.data"): extracts number of snps

map

signature(object = "gwaa.data"), signature(object = "snp.data"): extracts map

chromosome

signature(object = "gwaa.data"), signature(object = "snp.data"): extracts chromosome

strand

signature(object = "gwaa.data"), signature(object = "snp.data"): extracts strand

strand<-

signature(object = "gwaa.data"), signature(object = "snp.data"): assign strand

coding

signature(object = "gwaa.data"), signature(object = "snp.data"): extracts coding

coding<-

signature(object = "gwaa.data"), signature(object = "snp.data"): assign coding

refallele

signature(object = "gwaa.data"), signature(object = "snp.data"): extracts reference allele

effallele

signature(object = "gwaa.data"), signature(object = "snp.data"): extracts effective allele

male

signature(object = "gwaa.data"), signature(object = "snp.data"): extracts male indicator

Author(s)

Yurii Aulchenko

See Also

gwaa.data-class, snp.data, snp.mx-class

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require(GenABEL.data)
data(srdta)
class(srdta)
x <- srdta@gtdata
class(x)
nids(x)
nsnps(x)
idnames(x)[1:12]
male(x)[1:12]
male(x)[c("p1","p2","p3","p4")]
snpnames(x)[1:4]
chromosome(x)[1:4]
map(x)[1:4]
n4 <- c("rs18","rs655")
n4
map(x)[n4]
n4 <- c("rs18","rs65")
n4
map(x)[n4]
chromosome(x)[n4]
x[1:12,1:4]
summary(x[,1:10])
as.numeric(x[1:12,1:4])
as.numeric(x[c("p1","p3","p4"),c("rs18","rs65")])
as.character(x[c("p1","p3","p4"),c("rs18","rs65")])
as.genotype(x[c("p1","p3","p4"),c("rs18","rs65")])
as.hsgeno(x[c("p1","p3","p4"),c("rs18","rs65")])

Example output

Loading required package: MASS
Loading required package: GenABEL.data
[1] "gwaa.data"
attr(,"package")
[1] "GenABEL"
[1] "snp.data"
attr(,"package")
[1] "GenABEL"
[1] 2500
[1] 833
 [1] "p1"  "p2"  "p3"  "p4"  "p5"  "p6"  "p7"  "p8"  "p9"  "p10" "p11" "p12"
 p1  p2  p3  p4  p5  p6  p7  p8  p9 p10 p11 p12 
  1   1   0   1   1   0   0   1   0   0   0   1 
p1 p2 p3 p4 
 1  1  0  1 
[1] "rs10" "rs18" "rs29" "rs65"
rs10 rs18 rs29 rs65 
 "1"  "1"  "1"  "1" 
 rs10  rs18  rs29  rs65 
 2500  3500  5750 13500 
[1] "rs18"  "rs655"
rs18 <NA> 
3500   NA 
[1] "rs18" "rs65"
 rs18  rs65 
 3500 13500 
rs18 rs65 
 "1"  "1" 
@nids = 12 
@nsnps = 4 
@nbytes = 3 
@idnames = p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 
@snpnames = rs10 rs18 rs29 rs65 
@chromosome = 1 1 1 1 
@coding =  08 0b 0c 03 
@strand =  01 01 02 01 
@map = 2500 3500 5750 13500 
@male = 1 1 0 1 1 0 0 1 0 0 0 1 
@gtps = 
40 40 40 80 
40 40 00 00 
40 40 00 80 
      Chromosome Position Strand A1 A2 NoMeasured CallRate        Q.2 P.11 P.12
rs10           1     2500      +  T  G       2384   0.9536 0.13255034 1792  552
rs18           1     3500      +  G  A       2385   0.9540 0.28029350 1232  969
rs29           1     5750      -  G  T       2374   0.9496 0.13774221 1763  568
rs65           1    13500      +  A  T       2378   0.9512 0.71972246  182  969
rs73           1    14250      +  A  G       2385   0.9540 0.01341719 2331   44
rs114          1    24500      +  A  T       2393   0.9572 0.11679900 1868  491
rs128          1    27000      -  G  T       2391   0.9564 0.02488499 2281  101
rs130          1    27250      +  A  G       2379   0.9516 0.69377890  222 1013
rs143          1    31000      +  T  G       2377   0.9508 0.47728229  655 1175
rs150          1    33250      +  C  A       2369   0.9476 0.65998312  267 1077
      P.22       Pexact         Fmax         Plrt
rs10    40 7.897327e-01 -0.006880004 7.355343e-01
rs18   184 7.608230e-01 -0.007017332 7.315304e-01
rs29    43 7.955141e-01 -0.007241148 7.227853e-01
rs65  1227 6.475412e-01 -0.010016746 6.246577e-01
rs73    10 1.792470e-12  0.303150234 1.281239e-12
rs114   34 7.663683e-01  0.005487764 7.894076e-01
rs128    9 9.408599e-06  0.129600629 1.000431e-05
rs130 1144 9.615127e-01 -0.002140946 9.168114e-01
rs143  547 6.512540e-01  0.009313705 6.497695e-01
rs150 1025 5.518478e-01 -0.012948436 5.281254e-01
    rs10 rs18 rs29 rs65
p1     0    0    0    1
p2     0    0   NA   NA
p3     0    0   NA    1
p4     0    0   NA   NA
p5     0    1    0    2
p6     0    0    0    0
p7     1    1    1    2
p8     0    0    0    2
p9     0    1    0    2
p10    0    0    0    2
p11    0    0   NA    2
p12    0    0    0    1
   rs18 rs65
p1    0    1
p3    0    1
p4    0   NA
   rs18  rs65 
p1 "G/G" "A/T"
p3 "G/G" "A/T"
p4 "G/G" NA   
Loading required package: genetics
Loading required package: combinat

Attaching package: 'combinat'

The following object is masked from 'package:utils':

    combn

Loading required package: gdata
gdata: read.xls support for 'XLS' (Excel 97-2004) files ENABLED.

gdata: read.xls support for 'XLSX' (Excel 2007+) files ENABLED.

Attaching package: 'gdata'

The following object is masked from 'package:stats':

    nobs

The following object is masked from 'package:utils':

    object.size

The following object is masked from 'package:base':

    startsWith

Loading required package: gtools
Loading required package: mvtnorm


NOTE: THIS PACKAGE IS NOW OBSOLETE.



  The R-Genetics project has developed an set of enhanced genetics

  packages to replace 'genetics'. Please visit the project homepage

  at http://rgenetics.org for informtion.




Attaching package: 'genetics'

The following object is masked from 'package:GenABEL':

    as.genotype

The following objects are masked from 'package:base':

    %in%, as.factor, order

   rs18 rs65
p1  G/G  T/A
p3  G/G  T/A
p4  G/G <NA>
   rs18.a1 rs18.a2 rs65.a1 rs65.a2
p1       1       1       1       2
p3       1       1       1       2
p4       1       1      NA      NA

GenABEL documentation built on May 30, 2017, 3:36 a.m.