Entering edit mode
naglemi
▴
10
@naglemi-16588
Last seen 5.8 years ago
I'm working with a species that does not have sex chromosomes. The only part of the workflow in which I see I can note this is while building the GRM – by setting the option autosome.only to TRUE. I've looked through R documentation for assoctestMM and don't see a way to specify that there are no sex chromosomes in this dataset. How can I do this? Thanks for your time.
Here are relevant lines prior to the line causing the error, showing how I specify autosome-only to be TRUE:
grm <- snpgdsGRM(genofile, sample.id=keep, snp.id=NULL, autosome.only=TRUE, remove.monosnp=TRUE, maf=.05, missing.rate=.05, method="GCTA", num.thread=1L, with.id=TRUE, verbose=TRUE) GRM=grm$grm row.names(GRM)=grm$sample.id colnames(GRM)=grm$sample.id scanAnnotTRANS=ScanAnnotationDataFrame(mydat) LMMnullmod=fitNullMM(scanData=scanAnnotTRANS,outcome="SW3_TDZ",covMatList=GRM, family=gaussian)
Here is the line that causes the errror, and the error:
> assoc <- assocTestMM(genoData = genoData, nullMMobj = LMMnullmod, test = "Wald") Error in assocTestMM(genoData = genoData, nullMMobj = LMMnullmod, test = "Wald") : Sex values for the samples are required to compute MAF for X chromosome SNPs
Thank you for this suggestion. I've gotten it to work with a modification of the approach you suggested, and am now trying to figure out how to avoid this roundabout method. When I create a column for sex and set them all to either M or F, I get the following:
Fortunately, there are some genotypes with NA phenotypes. If I change one of these so that one genotype is M or F and all the others are the other sex, it seems to work – no error. However, this is not ideal. In the future, we'll have datasets with no NA values, so this won't work. Can you suggest a good way to get around this?
Thanks!
In the next release of GENESIS, assocTestMM will be deprecated in favor of a new function called assocTestSingle that does not have such strict requirements about chromosome and sex coding. (If you have chromosomes called X and Y and supply a sex column it will do the right thing with frequency, if not, it will treat all chromosomes the same.) If you want to try out this function sooner, you can install the development versions of GWASTools and GENESIS. Instructions for using devel are here: http://www.bioconductor.org/developers/how-to/useDevel/