snp.matrix objectThis function
reads post-MAKEPED pedigree files (used by JPSGCS)
into a snp.matrix object.
The post-MAKEPED format includes nine columns of pedigree structure and
subject characteristics (see Details below)
before the marker data. By contrast, pre-MAKEPED
pedigree file format has only six column of pedigree and subject data
before the marker data. This function was adapted from the
read.snps.pedfile function
in the chopsticks package (formerly
snpMatrix), which reads pre-MAKEPED pedigree files.
read.pedfile(file, snp.names=NULL, assign=NULL, missing=NULL,
X=FALSE, sep=".")The name of the pedigree file to be read.
A character vector of SNP names. If NULL the function will look
for SNP names in a corresponding .map or .info file with
the same file name root as file
(e.g., if file="myfile.ped" it will look for myfile.map
or myfile.info).
A list of named mappings from letters to alleles; not currently used.
Missing data code in the pedigree file; not currently used.
Is the pedigree file comprised of X-chromosome SNPs? Default is FALSE.
Character string to separate Family and Member IDs in the row.names of
the output snp.matrix object; not used.
A list with three components:
snp.dataa snp.matrix object holding the genotypes,
subject.supporta data frame containing the first nine columns of the pedigree file, and
snp.supporta data frame of SNP information. NB: this is
only meaningful if a .map or .info file was found.
JPSGCS pedigree files are in post-MAKEPED format (though much of this information is ignored):
| Column 1: | Pedigree number |
| Column 2: | Individual ID number |
| Column 3: | ID of father; 0=no father in pedigree |
| Column 4: | ID of mother; 0=no mother in pedigree |
| Column 5: | First offspring ID; ignored by JPSGCS |
| Column 6: | Next paternal sibling ID; ignored by JPSGCS |
| Column 7: | Next maternal sibling ID; ignored by JPSGCS |
| Column 8: | Sex; 1=male, 2=female |
The pre-MAKEPED format excludes columns 5 - 7.
read.pedfile is essentially
read.snps.pedfile for post-MAKEPED
pedigree files, except that the option low.mem of
read.snps.pedfile
has not been implemented.
As in read.snps.pedfile, when reading in SNP genotype data
the function looks for a corresponding
.map or .info file with information on the SNPs such
as physical map positions. For example, if file="test.ped",
the function looks for test.map or test.info to read
SNP information. Any SNP information that is found is saved in
the element snp.support of the output object (see Value).
# NOT RUN {
data(exdat)
sdat<-as(exdat$markers,"snp.matrix") #coerce to snp.matrix
#Write pedigree file for unrelated subjects
write.pedfile(pedinf="unrelated",snp.data=sdat,file="test.ped")
#Read it back into R
sdat2<-read.pedfile("test.ped")
#clean up
unlink("test.ped")
# }
Run the code above in your browser using DataLab