read.merlin.files {fat2Lpoly} | R Documentation |
function to read input files in Merlin format
Description
Reads the pedigree, data and allele frequency input files. The data read is reformatted to be used by the function fat2Lpoly.withinR
.
Usage
read.merlin.files(pedfilenames, datfilenames, freq.data, ibdfilenames = NULL)
Arguments
pedfilenames |
vector of 1 or 2 (the number of loci involved in the |
datfilenames |
vector of 1 or 2 (the number of loci involved in the |
freq.data |
Either
(1) a vector of 1 or 2 (the number of loci involved in the |
ibdfilenames |
vector of 1 or 2 (the number of loci involved in the |
Details
All subjects included in the pedigree files must also be found in the IBD files.
All fields in the pedigree files must be numeric. No letters allowed, even for family and subject ID's.
Value
returns a list of six objects:
ped |
data frame with columns fam.id, subject.ids, endophenotype and phenotype (in the given order) |
x.all |
data frame of SNP genotypes in the format "(number of minor alleles)/2", for all SNPs listed in the file(s) in |
MA.table |
data frame giving the minor allele numbers of all the SNPs. The first column consists of |
ibd.dat.list |
list of one or two data frames containing the columns of the IBD data file(s) in |
y1.name |
affection name extracted from first line of the data file(s) |
y2.name |
affection name extracted from second line of the data file(s) |
ibdfilenames |
(same object as provided as argument) vector of 1 or 2 (the number of loci involved in the |
Author(s)
Alexandre Bureau and Jordie Croteau
References
1. http://www.sph.umich.edu/csg/abecasis/Merlin/tour/input_files.html
See Also
Examples
path.data=paste(.libPaths()[which(unlist(lapply(.libPaths(),
function(x) length(grep("fat2Lpoly",dir(x)))))>0)],
"/fat2Lpoly/extdata/",sep="")
if(length(path.data)>1) path.data=path.data[length(path.data)]
input.data=read.merlin.files(pedfilenames=
paste(path.data,c("loc1.ped","loc2.ped"),sep=""),
datfilenames=
paste(path.data,c("loc1.dat","loc2.dat"),sep=""),
freq.data=
paste(path.data,c("loc1.freq","loc2.freq"),sep=""),
ibdfilenames=
paste(path.data,c("loc1.ibd","loc2.ibd"),sep=""))
input.data2=read.merlin.files(pedfilenames=
paste(path.data,"loc2.ped",sep=""),
datfilenames=
paste(path.data,"loc2.dat",sep=""),
freq.data=
paste(path.data,"loc2.freq",sep=""),
ibdfilenames=
paste(path.data,"loc2.ibd",sep=""))