Description Usage Arguments Value Examples
Retrieves genotype data for given SNPs. Can do online HapMap queries or read ped/map (LINKAGE) or gwaa/phe (GenABEL) genotype files. For HapMap and LINKAGE mode, writes the retrieved genotype data to files as specified by the toFile argument.
1 2 3 4 5 6 7 8 | getGenotypes(
snps,
gts.source = 2,
remove.homozygous = FALSE,
return.characters = FALSE,
return.genotypes = FALSE,
toFile = "getGenotypes"
)
|
snps |
character. A vector with SNP IDs to get genotypes for. |
gts.source |
vector(1). This argument can be either a HapMap population ID (when numeric, e.g. 2 will download CEU sample genotypes), a genotype file in LINKAGE / PLINK format or a genotype file in GenABEL format (when type is character), or an object of class |
remove.homozygous |
boolean(1). Returns only genotypes of SNPs that have more than one allele state. |
return.characters |
boolean(1). When TRUE, the return value is always a matrix of character nucleotide values ACGT0 (or NULL for no data). |
return.genotypes |
boolean(1). When TRUE, the return value is always a list of |
toFile |
character(1). Has no effect when gts.source is a GenABEL file, but has always be set for HapMap / LINKAGE file genotype retrieval. In the latter case, writes gwaa/phe and ped/map files of the retrieved genotype data, e.g. for later re-use. The value of this argument serves as basename of the files to be written. |
A snp.data
object or NULL when genotypes are not available. May also return an error String when HapMap retrieval is selected and the connection is not available.
Alternatively, when
return.characters = TRUE: Returns a matrix of character values. Contains 2-character combinations of ACGT0 or NA values. SNPs are listed in columns.
return.genotypes = TRUE: Returns a list of genotype
objects. List elements are named by the SNP identifiers that have been retrieved.
1 2 3 4 5 6 | getGenotypes(
snps = c("rs172154", "rs759704"),
gts.source = system.file("extdata", "example.gwaa", package = "postgwas"),
return.characters = TRUE,
toFile = NULL
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.