linkdat(ped, model=NULL, map=NULL, dat=NULL, freq=NULL, verbose=TRUE,
missing=0, ...)
## S3 method for class 'linkdat':
print(x, ..., markers)
## S3 method for class 'linkdat':
summary(object, ...)
## S3 method for class 'linkdat':
as.data.frame(x, ..., famid=F, markers=seq_len(x$nMark),
alleles=NULL, missing=NULL, singleCol=FALSE, sep="")
## S3 method for class 'linkdat':
subset(x, subset=x$orig.ids, ..., markers=seq_len(x$nMark))
write.linkdat(x, prefix="", what=c("ped", "map", "dat", "freq", "model"),
merlin=FALSE)linkdat.model object (typically y$model for some linkdat object y), or a single integer with the following meaning:
1 = autosomal dominant; 2 = autosomal recessive; 3 = X-linked dominant; 4 = X-linked recemap is non-NULL.)linkdat object.alleles=c("A","B").singleCol=TRUE.prefix="fam1" and what=c("ped", "map"), the files "fam1.ped" and "fam1.map" will be created.linkdat object, or a list of linkdat objects. A linkdat object is essentially a list with the following entries, some of which can be NULL.data.frame with 5 columns (ID, FID, MID, SEX, AFF) describing the pedigree in linkage format. (NB: Internal labeling used.)marker objects.linkdat.model object, essentially a list containing the model parameters. See setModel for details.ped must describe one or several pedigrees in standard LINKAGE format, i.e. with the following columns in correct order:
1 Family id (optional) (FAMID)
2 Individual id (ID),
3 Father id (FID),
4 Mother id (MID),
5 Gender (SEX): 1 = male, 2 = female,
6 Affection status (AFF): 1 = unaffected, 2 = affected, 0 = unknown,
7 First allele of first marker,
8 Second allele of first marker,
9 First allele of second marker,
a.s.o.
Only columns 2-6 are mandatory. The first column is automatically interpreted as family id if it has repeated elements.
Internally the individuals are relabeled as 1,2,..., but this should rarely be of concern to the end user. Some pedigree checking is done, but it is recommended to plot the pedigree before doing any analysis.
Details on the formats of map, dat and frequency files can be found in the online MERLIN tutorial: setModel, modifyPedigree, linkdat.utilsdata(toyped)
toyped
x = linkdat(toyped, model=1)
x
summary(x)
# test read/write:
x = modifyMarker(x, 1, alleles=c('B','C'), afreq=c(.9, .1), chrom=2, name="SNP1", pos=123)
write.linkdat(x, prefix="toy")
y = linkdat("toy.ped", map="toy.map", dat="toy.dat", freq="toy.freq", model=1)
unlink(c("toy.ped", "toy.map", "toy.dat", "toy.freq", "toy.model"))
stopifnot(isTRUE(all.equal(x,y)))Run the code above in your browser using DataLab