single.snp.tests(phenotype, stratum, data = sys.parent(), snp.data, rules=NULL, subset, snp.subset, uncertain = FALSE, score=FALSE)
phenotype
and
stratum
data. The row names of this are linked with the row
names of the snps
argument to establish correspondence of
phenotype and genotype data. If this argument is not supplied,
phenotype
and stratum
are evaluated in the calling
environment and should be in the same order as rows of snps
"SnpMatrix"
containing the SNP
genotypes to be tested"ImputationRules"
. If
supplied, the rules coded in this object are used, together with
snp.data
, to calculate tests for imputed SNPsphenotype
and stratum
argumentssnp.data
or, in imputation mode, as specified by rules
robust
variance estimatesTRUE
, the output object will contain, for each
SNP, the score vector and its variance-covariance matrix"SingleSnpTests"
.
If score
is set to TRUE
,
the output object will be of the extended class
"SingleSnpTestsScore"
containing additional slots holding the score statistics and their
variances (and covariances). This allows meta-analysis using the
pool
function.
When the function is used to calculate tests for imputed SNPs, the
test is still a score test. The score statistics are calculated from
the expected value, given observed SNPs, of the score statistic if the
SNP to be tested were itself observed.
The subset
argument can either be a logical vector of length
equal to the length of the vector of phenotypes, an integer vector
specifying positions in the data
frame, or a character vector
containing names of the selected rows in the data
frame. Similarly, the snp.subset
argument can be a logical,
integer, or character vector.
snp.lhs.tests
, snp.rhs.tests
,
impute.snps
, ImputationRules-class
,
pool
,
SingleSnpTests-class
,
SingleSnpTestsScore-class
data(testdata)
results <- single.snp.tests(cc, stratum=region, data=subject.data,
snp.data=Autosomes, snp.subset=1:10)
print(summary(results))
# writing to an (anonymous and temporary) csv file
csvfile <- tempfile()
write.csv(file=csvfile, as(results, 'data.frame'))
unlink(csvfile)
# QQ plot
qq.chisq(chi.squared(results, 1), 1)
qq.chisq(chi.squared(results, 2), 2)
Run the code above in your browser using DataLab