Description Usage Arguments Details Value Warning Author(s) See Also Examples
View source: R/write.pedfile.R
Write a snp.matrix object to a LINKAGE pedigree file, with
pedigree information followed by genotypes.
This function can be used to write either
post-MAKEPED or pre-MAKEPED pedigree file formats
(see Details). In addition to standard pedigree file formats
the function can optionally write transposed pedigree files, as
required by FitGMLD
.
1 | write.pedfile(pedinf, snp.data, file, transpose=FALSE, sep=" ", eol="\n", na="0")
|
pedinf |
The pedigree information for the pedfile as a matrix or data frame.
Altnerately, users may specify |
snp.data |
A |
file |
File name for the output pedfile. |
transpose |
Should the pedigree file be transposed, as required by
|
sep |
Field separator (not currently used). |
eol |
The end-of-line character. |
na |
The missing data code in |
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 |
Column 9: | Proband status (1=proband, 0=not); ignored by JPSGCS |
The pre-MAKEPED format excludes columns 5 - 7.
A numeric vector comprised of the number of subjects and SNPs written to the pedigree file.
The function makes NO attempt to check the pedigree information for correctness. It is up to the user to specify valid pedigree information.
Sigal Blay, Jinko Graham and Brad McNeney
read.pedfile
,
read.snps.pedfile
1 2 3 4 5 6 7 8 9 10 11 12 13 | data(exdat)
sdat<-as(exdat$markers,"snp.matrix") #coerce to snp.matrix
#Write a post-MAKEPED pedigree file for unrelated subjects.
pedinf<-matrix(
c( 1, 1, 0, 0, 0, 0, 0, 1, 1,
2, 1, 0, 0, 0, 0, 0, 1, 1,
3, 1, 0, 0, 0, 0, 0, 1, 1,
4, 1, 0, 0, 0, 0, 0, 1, 1,
5, 1, 0, 0, 0, 0, 0, 1, 1),
byrow=TRUE, ncol=9, nrow=5)
write.pedfile(pedinf,sdat,file="test.ped")
#clean up
unlink("test.ped")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.