geneContribution: Gene contribution or proportion of genes in pedigree by...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/geneContribution.R

Description

geneContribution calculates gene contribution as proportion of genes in pedigree by individual with higher number of descendants will have higher values.

Usage

1
geneContribution(x, relative=TRUE)

Arguments

x

pedigree

relative

logical, should results be presented relative to number of individuals in the pedigree

Value

Gene contribution values i.e. higher the values higher the contribution of genes by particular individual in the pedigree. When relative=FALSE, values represent number of individuals (in conceptually additive manner i.e. 0.5 + 0.75 = 1.25 individual) in the pedigree that carry genes of a particular individual. With relative=TRUE, values represent the same result as ratios to all individuals in the pedigree. Value 0 indicates that individual did not pass its genes to next generations.

Author(s)

Gregor Gorjanc

See Also

Pedigree

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
  ped <- generatePedigree(nId=5, nGeneration=4, nFather=1, nMother=2)
  geneContribution(ped)
  geneContribution(ped, relative=FALSE)
  ## geneContribution(ped[5:15, ]) ## needs [ method

  ## More than one father example
  ped <- data.frame(     id=c(1, 2, 3, 4, 5, 6, 7),
                    father1=c(0, 0, 0, 2, 1, 1, 2),
                    father2=c(0, 0, 0, 0, 0, 2, 0),
                     mother=c(0, 0, 0, 0, 3, 3, 3),
                    generat=c(1, 1, 1, 2, 2, 2, 2))
  ped <- Pedigree(ped, ascendant=c("father1", "father2", "mother"),
                  ascendantSex=c(1, 1, 2), ascendantLevel=c(1, 1, 1),
                  unknown=0, generation="generat")
  geneContribution(ped)

Example output

Loading required package: MASS

Attaching package: 'GeneticsPed'

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

    family

      1       2       3       4       5       6       7       8       9      10 
0.37500 0.00000 0.11875 0.25625 0.00000 0.25000 0.00000 0.16250 0.08750 0.00000 
     11      12      13      14      15      16      17      18      19      20 
0.12500 0.00000 0.05000 0.07500 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 
There were 45 warnings (use warnings() to see them)
    1     2     3     4     5     6     7     8     9    10    11    12    13 
7.500 0.000 2.375 5.125 0.000 5.000 0.000 3.250 1.750 0.000 2.500 0.000 1.000 
   14    15    16    17    18    19    20 
1.500 0.000 0.000 0.000 0.000 0.000 0.000 
There were 45 warnings (use warnings() to see them)
         1          2          3          4          5          6          7 
0.07142857 0.10714286 0.14285714 0.00000000 0.00000000 0.00000000 0.00000000 
Warning messages:
1: In mapply(FUN = "isUnknown", x = x, unknown = unknown, ..., SIMPLIFY = FALSE) :
  longer argument not a multiple of length of shorter
2: In z[k] <- z[k] + cont1 * z[i] :
  number of items to replace is not a multiple of replacement length
3: In mapply(FUN = "isUnknown", x = x, unknown = unknown, ..., SIMPLIFY = FALSE) :
  longer argument not a multiple of length of shorter
4: In z[k] + cont1 * z[i] :
  longer object length is not a multiple of shorter object length
5: In z[k] <- z[k] + cont1 * z[i] :
  number of items to replace is not a multiple of replacement length
6: In mapply(FUN = "isUnknown", x = x, unknown = unknown, ..., SIMPLIFY = FALSE) :
  longer argument not a multiple of length of shorter
7: In z[k] <- z[k] + cont1 * z[i] :
  number of items to replace is not a multiple of replacement length
8: In mapply(FUN = "isUnknown", x = x, unknown = unknown, ..., SIMPLIFY = FALSE) :
  longer argument not a multiple of length of shorter
9: In z[k] <- z[k] + cont1 * z[i] :
  number of items to replace is not a multiple of replacement length

GeneticsPed documentation built on Nov. 8, 2020, 5:54 p.m.