Here are two small trial runs with Haplin. This will let you check your Haplin installation and get you started with some basic analyses. Make sure you install Haplin first. More details are found in the vignettes.
Read in the first file:
trialdata <- genDataRead(file.in = "HAPLIN.trialdata.txt", file.out = "trialdata_file", format = "haplin", n.vars = 0)
The format argument says that this is the classic “haplin” format. Alternatively, a “ped” format can be used. n.vars is set to zero since there is no covariate information in the file, only genetic data. The locations of file.in and file.out can be changed. Note that genDataRead creates an R object, “trialdata”, as well as a corresponding file “trialdata_file”. For details check
Pre-process the data file and save the result:
prepdata <- genDataPreprocess(data.in = trialdata, design = "triad", file.out = "prep_trialdata_file")
genDataPreprocess similarly generates an R object, “prepdata”, as well as a corresponding file “prep_trialdata_file”.
You can now, as an example, run Haplin with the command
haplin(prepdata, use.missing = T, maternal = T)
This command reads data, performs the estimation and prints and plots the result in one run.
Similarly, repeat the two first steps to read the “HAPLIN.trialdata2.txt” file instead
trialdata2 <- genDataRead(file.in = "HAPLIN.trialdata2.txt", file.out = "trialdata2_file", format = "haplin", n.vars = 2, allele.sep = "")
prepdata2 <- genDataPreprocess(data.in = trialdata2, design = "triad", file.out = "prep_trialdata2_file")
And do an analysis by, for instance,
haplin(prepdata2, use.missing = T, ccvar = 2, design = "cc.triad", reference = "ref.cat", response = "mult")
For more information on what the haplin arguments mean, see the haplin help file
For a quick overview of all available functions in Haplin, use
help(package = "Haplin")
And definitely check out the vignettes for more information.