write.pedfile: write a 'snp.matrix' object to a LINKAGE pedigree file.

Description Usage Arguments Details Value Warning Author(s) See Also Examples

View source: R/write.pedfile.R

Description

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.

Usage

1
write.pedfile(pedinf, snp.data, file, transpose=FALSE, sep=" ", eol="\n", na="0")

Arguments

pedinf

The pedigree information for the pedfile as a matrix or data frame. Altnerately, users may specify pedinf="unrelated" for unrelated subjects. See the Examples.

snp.data

A snp.matrix object containing the marker data.

file

File name for the output pedfile.

transpose

Should the pedigree file be transposed, as required by FitGMLD? Default is FALSE.

sep

Field separator (not currently used).

eol

The end-of-line character.

na

The missing data code in snp.data.

Details

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.

Value

A numeric vector comprised of the number of subjects and SNPs written to the pedigree file.

Warning

The function makes NO attempt to check the pedigree information for correctness. It is up to the user to specify valid pedigree information.

Author(s)

Sigal Blay, Jinko Graham and Brad McNeney

See Also

read.pedfile, read.snps.pedfile

Examples

 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")

Example output

Loading required package: rJava
Loading required package: chopsticks
Loading required package: survival
Warning message:
In methods:::bind_activation(TRUE) :
  methods:::bind_activation(TRUE) is deprecated;
 you should rather provide methods for cbind2() / rbind2()
[1]  5 10

rJPSGCS documentation built on May 1, 2019, 11:10 p.m.