locus: Create and Manipulate Locus, Gene, and Marker Objects

Description Usage Arguments Value Author(s) See Also Examples

View source: R/locus.R

Description

locus, gene, and marker create objects to store information, respectively, about genetic loci, genes, and markers.

is.locus, is.gene, and ismarker test whether an object is a member of the respective class.

as.character.locus, as.character.gene, as.character.marker return a character string containing a compact encoding the object.

getlocus, getgene, getmarker extract locus data (if present) from another object.

locus<-, marker<-, and gene<- adds locus data to an object.

Usage

 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
28
29
30
31
  locus(name, chromosome, arm=c("p", "q", "long", "short", NA),
        index.start, index.end=NULL)

  gene(name, chromosome, arm=c("p", "q", "long", "short"),
       index.start, index.end=NULL)

  marker(name, type, locus.name, bp.start, bp.end = NULL,
         relative.to = NULL, ...)

  is.locus(x)

  is.gene(x)

  is.marker(x)

  ## S3 method for class 'locus'
as.character(x, ...)

  ## S3 method for class 'gene'
as.character(x, ...)

  ## S3 method for class 'marker'
as.character(x, ...)

  getlocus(x, ...)

  locus(x) <- value

  marker(x) <- value

  gene(x) <- value

Arguments

name

character string giving locus, gene, or marker name

chromosome

integer specifying chromosome number (1:23 for humans).

arm

character indicating long or short arm of the chromosome. Long is be specified by "long" or "p". Short is specified by "short" or "q".

index.start

integer specifying location of start of locus or gene on the chromosome.

index.end

optional integer specifying location of end of locus or gene on the chromosome.

type

character string indicating marker type, e.g. "SNP"

locus.name

either a character string giving the name of the locus or gene (other details may be specified using ...) or a locus or gene object.

bp.start

start location of marker, in base pairs

bp.end

end location of marker, in base pairs (optional)

relative.to

location (optional) from which bp.start and bp.end are calculated.

...

parameters for locus used to fill in additional details on the locus or gene within which the marker is located.

x

an object of class locus, gene, or marker, or (for getlocus, locus<-, marker<-, and gene<-) an object that may contain a locus attribute or field, notably a genotype object.

value

locus, marker, or gene object

Value

Object of class locus and geneare lists with the elements:

name

character string giving locus, gene, or marker name

chromosome

integer specifying chromosome number (1:23 for humans).

arm

character indicating long or short arm of the chromosome. Long is be specified by "long" or "p". Short is specified by "short" or "q".

index.start

integer specifying location of start of locus or gene on the chromosome.

index.end

optional integer specifying location of end of locus or gene on the chromosome.

Objects of class marker add the additional fields:

marker.name

character string giving the name of the marker

bp.start

start location of marker, in base pairs

bp.end

end location of marker, in base pairs (optional)

relative.to

location (optional) from which bp.start and bp.end are calculated.

Author(s)

Gregory R. Warnes greg@warnes.net

See Also

genotype,

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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
ar2  <- gene("AR2",chromosome=7,arm="q",index.start=35)
ar2

par  <- locus(name="AR2 Psedogene",
              chromosome=1,
              arm="q",
              index.start=32,
              index.end=42)
par

c109t  <- marker(name="C-109T",
                 type="SNP",
                 locus.name="AR2",
                 chromosome=7,
                 arm="q",
                 index.start=35,
                 bp.start=-109,
                 relative.to="start of coding region")
c109t

c109t  <- marker(name="C-109T",
                 type="SNP",
                 locus=ar2,
                 bp.start=-109,
                 relative.to="start of coding region")
c109t




example.data   <- c("D/D","D/I","D/D","I/I","D/D",
                    "D/D","D/D","D/D","I/I","")
g1  <- genotype(example.data, locus=ar2)
g1

getlocus(g1)

summary(g1)
HWE.test(g1)

g2  <- genotype(example.data, locus=c109t)
summary(g2)

getlocus(g2)

heterozygote(g2)
homozygote(g1)

allele(g1,1)

carrier(g1,"I")

heterozygote(g2)

Example output

Loading required package: combinat

Attaching package: 'combinat'

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

    combn

Loading required package: gdata
sh: 1: cannot create /dev/null: Permission denied
gdata: Unable to locate valid perl interpreter
gdata: 
gdata: read.xls() will be unable to read Excel XLS and XLSX files
gdata: unless the 'perl=' argument is used to specify the location of a
gdata: valid perl intrpreter.
gdata: 
gdata: (To avoid display of this message in the future, please ensure
gdata: perl is installed and available on the executable search path.)
sh: 1: cannot create /dev/null: Permission denied
gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLX' (Excel 97-2004) files.

gdata: Unable to load perl libaries needed by read.xls()
gdata: to support 'XLSX' (Excel 2007+) files.

gdata: Run the function 'installXLSXsupport()'
gdata: to automatically download and install the perl
gdata: libaries needed to support Excel XLS and XLSX formats.

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: MASS
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 objects are masked from 'package:base':

    %in%, as.factor, order

Gene: AR2 (7q35)
Locus: AR2 Psedogene (1q32-42)
Marker: AR2:C-109T (7q35:-109)	Type: SNP
Marker: AR2:C-109T (7q35:-109)	Type: SNP
Gene: AR2 (7q35)
 [1] "D/D" "D/I" "D/D" "I/I" "D/D" "D/D" "D/D" "D/D" "I/I" NA   
Alleles: D I 
Gene: AR2 (7q35)
[1] NA
Alleles: D I 

Gene: AR2 (7q35)

Number of samples typed: 9 (90%)

Allele Frequency: (2 alleles)
   Count Proportion
D     13       0.72
I      5       0.28
NA     2         NA


Genotype Frequency:
    Count Proportion
D/D     6       0.67
D/I     1       0.11
I/I     2       0.22
NA      1         NA

Heterozygosity (Hu)  = 0.4248366
Poly. Inf. Content   = 0.32074


	-----------------------------------
	Test for Hardy-Weinberg-Equilibrium
	-----------------------------------

Call: 
HWE.test.genotype(x = g1)

Raw Disequlibrium for each allele pair (D)

   
             D          I
  D            -0.1450617
  I -0.1450617           

Scaled Disequlibrium for each allele pair (D')

   
        D     I
  D       -1.88
  I -1.88      

Correlation coefficient for each allele pair (r)

   
            D         I
  D           0.7230769
  I 0.7230769          

Observed vs Expected Allele Frequencies 

           Obs        Exp    Obs-Exp
D/D 0.66666667 0.52160494  0.1450617
I/D 0.05555556 0.20061728 -0.1450617
D/I 0.05555556 0.20061728 -0.1450617
I/I 0.22222222 0.07716049  0.1450617

Overall Values

          Value
  D  -0.1450617
  D' -1.8800000
  r   0.7230769

Confidence intervals computed via bootstrap using 1000 samples

    * WARNING: The R^2 disequlibrium statistics is bounded between
    * [0,1].  The confidence intervals for R^2 values near 0 and 1 are
    * ill-behaved. A rough correction has been applied, but the
    * intervals still may not be correct for R^2 values near 0 or 1.


              Observed     95% CI                       NA's Contains Zero?
  Overall D   -0.145061728 (-0.246913580,  0.012345679) 0    YES           
  Overall D'  -1.880000000 (-8.000000000,  0.125000000) 24   YES           
  Overall r    0.723076923 (-0.125000000,  1.000000000) 24   YES           
  Overall R^2  0.522840237 ( 0.003460208,  1.000000000) 24   *NO*          

Significance Test:

	Exact Test for Hardy-Weinberg Equilibrium

data:  g1
N11 = 6, N12 = 1, N22 = 2, N1 = 13, N2 = 5, p-value = 0.05882



Warning message:
In diseq.ci(x, R = ci.B, conf = conf) : NAs returned from diseq call

Marker: AR2:C-109T (7q35:-109)	Type: SNP

Number of samples typed: 9 (90%)

Allele Frequency: (2 alleles)
   Count Proportion
D     13       0.72
I      5       0.28
NA     2         NA


Genotype Frequency:
    Count Proportion
D/D     6       0.67
D/I     1       0.11
I/I     2       0.22
NA      1         NA

Heterozygosity (Hu)  = 0.4248366
Poly. Inf. Content   = 0.32074

Marker: AR2:C-109T (7q35:-109)	Type: SNP
[1] NA
Alleles: D I 
 [1] FALSE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE    NA
attr(,"locus")
Marker: AR2:C-109T (7q35:-109)	Type: SNP
 [1]  TRUE FALSE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE  TRUE    NA
attr(,"locus")
Gene: AR2 (7q35)
 [1] "D" "D" "D" "I" "D" "D" "D" "D" "I" NA 
attr(,"locus")
Gene: AR2 (7q35)
attr(,"which")
[1] 1
attr(,"allele.names")
[1] "D" "I"
 [1] FALSE  TRUE FALSE  TRUE FALSE FALSE FALSE FALSE  TRUE    NA
attr(,"allele")
[1] NA
attr(,"locus")
Gene: AR2 (7q35)
 [1] FALSE  TRUE FALSE FALSE FALSE FALSE FALSE FALSE FALSE    NA
attr(,"locus")
Marker: AR2:C-109T (7q35:-109)	Type: SNP

genetics documentation built on March 1, 2021, 9:06 a.m.

Related to locus in genetics...