
snpgdsBED2GDS(bed.fn, fam.fn, bim.fn, out.gdsfn, family=FALSE, snpfirstdim=NA, compress.annotation="ZIP_RA.max", compress.geno="", option=NULL, cvt.chr=c("int", "char"), cvt.snpid=c("auto", "int"), verbose=TRUE)
".ped"
TRUE
, to include family information in the
sample annotationNA
, the dimension is
determined by the BED fileadd.gdsn
add.gdsn
NULL
or an object from snpgdsOption
,
see details"int"
-- chromosome code in the GDS file is integer;
"char"
-- chromosome code in the GDS file is character"int"
-- to create an integer snp.id
starting from 1; "auto"
-- if SNP IDs in the PLINK file are not
unique, to create an an integer snp.id
, otherwise to use SNP
IDs for snp.id
BED -- the PLINK binary ped format.
The user could use option
to specify the range of code for autosomes.
For humans there are 22 autosomes (from 1 to 22), but dogs have 38 autosomes.
Note that the default settings are used for humans. The user could call
option = snpgdsOption(autosome.end=38)
for importing the BED file of dog.
It also allow define new chromosome coding, e.g.,
option = snpgdsOption(Z=27)
.
snpgdsOption
, snpgdsPED2GDS
,
snpgdsGDS2PED
# PLINK BED files
bed.fn <- system.file("extdata", "plinkhapmap.bed.gz", package="SNPRelate")
fam.fn <- system.file("extdata", "plinkhapmap.fam.gz", package="SNPRelate")
bim.fn <- system.file("extdata", "plinkhapmap.bim.gz", package="SNPRelate")
# convert
snpgdsBED2GDS(bed.fn, fam.fn, bim.fn, "HapMap.gds")
# open
genofile <- snpgdsOpen("HapMap.gds")
genofile
# close
snpgdsClose(genofile)
# delete the temporary file
unlink("HapMap.gds", force=TRUE)
Run the code above in your browser using DataLab