| gl2gapit | R Documentation |
Converts a genlight object containing SNP data into a hapmap-style data.frame as expected by GAPIT (Genome Association and Prediction Integrated Tool) and writes it to file as tab-delimited text.
gl2gapit(x, outfile = "gl_gapit", outpath = NULL, verbose = NULL)
x |
Name of the genlight object containing the SNP data [required]. |
outfile |
File name of the output file [default 'gl_gapit']. |
outpath |
Path where to save the output file [default global working directory or if not specified, tempdir()]. |
verbose |
Verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log; 3, progress and results summary; 5, full report [default NULL, adopting the global verbosity set by gl.set.verbosity(), or 2 if no global is set]. |
The returned data.frame follows the hapmap layout that GAPIT reads with header = FALSE: the first row repeats the column names, the first eleven columns are the hapmap descriptors (rs, alleles, chrom, pos, strand, assembly, center, protLSID, assayLSID, panel, QCcode) and each remaining column carries one individual. Genotypes double the allele letters (for example CC, CT) and missing data is coded 00.
Chromosome names are recoded to integer codes assigned in alphabetical order of the distinct names; the name-to-code mapping is reported at verbose >= 2. If the chromosome or position slot is empty, dummy values are used (chromosome 1 for all loci; positions 1 to the number of loci) with a warning at verbose >= 2.
The data.frame is written to file.path(outpath, outfile) as tab-delimited text without quotes, ready for GAPIT to read.
The hapmap-style data.frame, returned invisibly.
Author(s): Luis Mijangos. Custodian: Luis Mijangos – Post to https://groups.google.com/d/forum/dartr
Other linker:
gi2gl(),
gl2bayesAss(),
gl2bayescan(),
gl2bpp(),
gl2demerelate(),
gl2eigenstrat(),
gl2faststructure(),
gl2gds(),
gl2genalex(),
gl2genepop(),
gl2geno(),
gl2gi(),
gl2hapmap(),
gl2hiphop(),
gl2related(),
gl2snapper(),
gl2structure(),
gl2treemix(),
gl2vcf()
t1 <- platypus.gl
# assigning chromosome
t1$chromosome <- t1$other$loc.metrics$Chrom_Platypus_Chrom_NCBIv1
# assigning SNP position
t1$position <- t1$other$loc.metrics$ChromPos_Platypus_Chrom_NCBIv1
res <- gl2gapit(t1, outpath = tempdir())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.