mergeprepare {happy} | R Documentation |
mergeprepare() reads in datafiles descrbing the locations and strain distribution patterns of polymorphisms (SNPs or otherwise) which have not necessarily been genotyped. The following tasks are performed:
mergefit() tests each of the polymorphisms to see if it could be a QTL. It performs the following operations on each polymorphism:
fastmergefit() is a convenience function which perfroms a complete analysis without making a prior call to happy().
condmergefit() performs a conditional analysis in which each variant is fitted conditional upon every other variant being included in turn. This is VERY SLOW.
mergeprepare( h, markerposfile, testmarkerfile, verbose=FALSE ) mergefit( h, mergedata, model='additive', covariatematrix=NULL, verbose=FALSE ) fastmergefit( datafile, allelesfile, markerposfile, testmarkerfile, generations=200, model='additive', verbose=FALSE ) condmergefit( h, mergedata, model='additive', covariatematrix=NULL, verbose=FALSE )
h |
an object returned by a previous call to happy() |
markerposfile |
the name of a text file containing the names and locations of the genotyped markers. Contains two names columns 'marker' and 'POSITION' |
testmarkerfile |
the name of a text file containign the names, positions and strain/allele distribution patterns for each polymorphism to be tested. Contains two columns 'marker' and 'POSITION' plus an additional named column for each of the strains listed in h$strains - the column names and strain names must match exactly. |
verbose |
switch to control the level of ouput sent to the screen |
mergedata |
an object created by a previous call to mergeprepare() |
model |
determine the type of model to be fitted -
either 'additive' or 'full'.
For the additive model it is assumed that the contribution to the phenotype from each chromosome is additive, ie if the founder strains at the locus being tested are s,t then the expected phenotype will be of the form T(s)+T(t). For the full model the expected phenotype will be of the form T(s,t). Analysis of variance is used to test for differences between the estimated effects T(s), T(s,t). The additive model is a submodel of the full, so for model='full' in addition a partial F-test is performed to test if the full model explains more variance than the additive. |
covariatematrix |
an optional design matrix which can be used to include additional terms in the model, such as other markers (using the matrix returned by hdesign()) and/or other covariates such as sex, age etc |
datafile |
the name of a genotype datafile to be passed to happy() |
allelesfile |
the name of the corresponding alleles datafile to be passed to happy() |
generations |
the number of generations to be passed to happy() |
mergeprepare() returns a list with the following named elements:
markerpos |
the positions of the markers |
interval |
an array. interval[m] contains the index of the genotyped marker interval in which the polymorhism p is located, or NULL if it is outside all genotyped intervals. |
markers |
|
testmarkerdata |
details about the polymorphisms to be tested |
mergefit() and fastmergefit() return an object, called say 'fit', suitable for plotting using
mergeplot(). It contains a named element 'table' containing the log-P
values as in hfit(), which can be printed using
write.table(fit$table)
.
condmergefit() returns a table with columns "position", "interval",
"sdp", "logPself", "logPmax", "logPmaxPosition" .
Richard Mott
happy(), mergeplot()
## An example session: # initialise happy ## Not run: h <- happy('Hs.data','HS.alleles') # prepare the merge files ## Not run: prep <- mergeprepare('markers.positions','testmarkers.txt') # run the merge fit ## Not run: fit <- mergefit( h, prep ) # alternative, and equivalent, use of fastmergefit(): ## Not run: fit <- fastmergefit( 'Hs.data','HS.alleles', 'markers.positions','testmarkers.txt' ) ## End(Not run) # plot the results ## Not run: mergeplot( fit, prep )