View source: R/DataUtilities.R
hlaGeno2PED | R Documentation |
Convert an object of hlaSNPGenoClass
to a file of
PLINK PED format.
hlaGeno2PED(geno, out.fn)
geno |
a genotype object of |
out.fn |
the file name of output ped file |
Two files ".map" and ".ped" are created.
None.
Xiuwen Zheng
hlaBED2Geno
# make a "hlaAlleleClass" object
hla.id <- "A"
hla <- hlaAllele(HLA_Type_Table$sample.id,
H1 = HLA_Type_Table[, paste(hla.id, ".1", sep="")],
H2 = HLA_Type_Table[, paste(hla.id, ".2", sep="")],
max.resolution="4-digit", locus=hla.id, assembly="hg19")
# training genotypes
region <- 500 # kb
snpid <- hlaFlankingSNP(HapMap_CEU_Geno$snp.id, HapMap_CEU_Geno$snp.position,
hla.id, region*1000, assembly="hg19")
train.geno <- hlaGenoSubset(HapMap_CEU_Geno,
snp.sel = match(snpid, HapMap_CEU_Geno$snp.id))
hlaGeno2PED(train.geno, "test")
# delete the temporary files
unlink(c("test.map", "test.ped"), force=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.