snp.matrix object
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=".")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).
FALSE.
snp.matrix object; not used.
snp.datasnp.matrix object holding the genotypes,subject.supportsnp.support.map or .info file was found.| 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 |
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).
write.pedfile,
read.snps.pedfile
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