[BioC] GWASTools mendelList Constructor

Samuel Younkin syounkin at jhsph.edu
Thu Sep 13 17:53:28 CEST 2012


Thanks Stephanie, your response was very helpful.

One thing I found was that the offspring, father and mother vectors must 
be character vectors, not factor vectors.  If they are factors 
mendelList() will not work.  One must be careful not to let them be 
coerced into factors, say during construction of the data frame.  The 
inclusion of stringsAsFactors=FALSE is necessary in the below code.

Thanks,

Sam


On 09/12/2012 11:37 AM, Stephanie M. Gogarten wrote:
> Hi Sam,
>
> Sorry that the documentation for this function is not very clear - I
> will work on revising it for the next release at the beginning of October.
>
> The offspring, mother, and father vectors should be subject IDs, which
> are not required to be integers.  The scanID vector should be the scan
> ID of the offspring, which should be integers.  I suspect your problem
> might be that all subjects with genotypes must have an entry in all the
> vector arguments to mendelList - think of the arguments as being columns
> of a data frame that contains all your subjects.  This is because the
> mendelList function needs to know the scan IDs of the father and mother
> as well, and all the vector arguments must have the same length.
>
> Here is a toy example of some IDs that produce a valid mendelList object:
>
>   > dat <- data.frame(family=c(1,1,1), offspring=c("a","b","c"),
> father=c("b",0,0), mother=c("c",0,0), sex=c("M","M","F"), scanID=1:3,
> stringsAsFactors=FALSE)
>   > dat
>     family offspring father mother sex scanID
> 1      1         a      b      c   M      1
> 2      1         b      0      0   M      2
> 3      1         c      0      0   F      3
>   > mendelList(dat$family, dat$offspring, dat$father, dat$mother,
> dat$sex, dat$scanID)
> $`1`
> $`1`$a
>     offspring father mother
> 1         1      2      3
>
>
> attr(,"class")
> [1] "mendelList"
>
> If you only include the first row, without separate entries for the
> father and mother, you get a NULL:
>
>   > dat <- dat[1,]
>   > dat
>     family offspring father mother sex scanID
> 1      1         a      b      c   M      1
>   > mendelList(dat$family, dat$offspring, dat$father, dat$mother,
> dat$sex, dat$scanID)
> NULL
>
> If this doesn't solve your problem, please send a small example of your
> code that gives a NULL result.
>
> Stephanie
>
>> -------- Original Message --------
>> Subject: [BioC] GWASTools mendelList Constructor
>> Date: Wed, 12 Sep 2012 10:36:58 -0400
>> From: Samuel Younkin <syounkin at jhsph.edu>
>> To: bioconductor at r-project.org <bioconductor at r-project.org>
>>
>> BioC,
>>
>> I am trying to use the Mendelian error checking feature of the
>> Bioconductor package GWASTools.  When I try to create a mendelList
>> object using the constructor function mendelList(), it consistently
>> returns NULL with no warning or error message.
>>
>> I have tried changing the subject ids to character, or integer, or
>> numeric, but I continue to get NULL.  Without any error message to work
>> with I am at a loss.  Any advice?
>>
>> Should the offspring, mother and father vectors be scan ids or
>> scan/subject names?  My scan names are not numbers and so these vectors
>> would not satisfy the requirement in the manual of "a vector of
>> offspring/father/mother ID numbers."
>>
>> Should the scanID vector be the scan id of the offspring?
>>
>> Any advice would be greatly appreciated.
>>
>> Thanks,
>>
>> Sam
>>
>>    > sessionInfo()
>> R version 2.15.1 Patched (2012-07-01 r59713)
>> Platform: x86_64-unknown-linux-gnu (64-bit)
>>
>> locale:
>>     [1] LC_CTYPE=en_US.iso885915       LC_NUMERIC=C
>>     [3] LC_TIME=en_US.iso885915        LC_COLLATE=en_US.iso885915
>>     [5] LC_MONETARY=en_US.iso885915    LC_MESSAGES=en_US.iso885915
>>     [7] LC_PAPER=C                     LC_NAME=C
>>     [9] LC_ADDRESS=C                   LC_TELEPHONE=C
>> [11] LC_MEASUREMENT=en_US.iso885915 LC_IDENTIFICATION=C
>>
>> attached base packages:
>> [1] stats     graphics  grDevices datasets  utils     methods   base
>>
>> other attached packages:
>>     [1] MinimumDistance_1.1.20 CleftCNVAssoc_0.0.1    GenomicRanges_1.9.63
>>     [4] IRanges_1.15.43        GWASTools_1.2.1        sandwich_2.2-9
>>     [7] zoo_1.7-7              GWASExactHW_1.0        ncdf_1.6.6
>> [10] Biobase_2.17.6         BiocGenerics_0.3.1     BiocInstaller_1.4.7
>>
>> loaded via a namespace (and not attached):
>>     [1] affyio_1.25.0         annotate_1.35.3       AnnotationDbi_1.19.35
>>     [4] Biostrings_2.25.8     bit_1.1-8             codetools_0.2-8
>>     [7] crlmm_1.15.18         DBI_0.2-5             DNAcopy_1.31.1
>> [10] ellipse_0.3-7         ff_2.2-7              foreach_1.4.0
>> [13] genefilter_1.39.0     grid_2.15.1           iterators_1.0.6
>> [16] lattice_0.20-6        lmtest_0.9-30         msm_1.1.1
>> [19] mvtnorm_0.9-9992      oligoClasses_1.19.41  preprocessCore_1.19.0
>> [22] RSQLite_0.11.1        SNPchip_2.3.13        splines_2.15.1
>> [25] stats4_2.15.1         survival_2.36-14      tools_2.15.1
>> [28] VanillaICE_1.19.23    XML_3.9-4             xtable_1.7-0
>> [31] zlibbioc_1.3.0
>>    >
>>
>> _______________________________________________
>> Bioconductor mailing list
>> Bioconductor at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/bioconductor
>> Search the archives:
>> http://news.gmane.org/gmane.science.biology.informatics.conductor
>>
>>



More information about the Bioconductor mailing list