Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gl.read.csv

Read SNP data from a csv file into a genlight object


Description

This script takes SNP genotypes from a csv file, combines them with individual and locus metrics and creates a genlight object.

Usage

gl.read.csv(
  filename,
  transpose = FALSE,
  ind.metafile = NULL,
  loc.metafile = NULL,
  verbose = NULL
)

Arguments

filename

– name of the csv file containing the SNP genotypes [required]

transpose

– if TRUE, rows are loci and columns are individuals [default FALSE]

ind.metafile

– name of the csv file containing the metrics for individuals [optional]

loc.metafile

– name of the csv file containing the metrics for loci [optional]

verbose

– verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log ; 3, progress and results summary; 5, full report [default 2]

Details

The SNP data need to be in one of two forms. SNPs can be coded 0 for homozygous reference, 2 for homozygous alternate, and 1 for heterozygous with NA for missing values; or the SNP data can be coded A/A, A/C, C/T, G/A etc, with -/- as missing. Other formats will throw an error.

The SNP data need to be individuals as rows,labelled, and loci as columns, also labelled. If the orientation is individuals as columns and loci by rows, then set transpose=TRUE.

The individual metrics need to be in a csv file, with headings, with a mandatory id column corresponding exactly to the individual identity labels provided with the SNP data and in the same order.

The locus metadata needs to be in a csv file with headings, with a mandatory column headed AlleleID corresponding exactly to the locus identity labels provided with the SNP data and in the same order.

Note that the locus metadata will be complemented by calculable statistics corresponding to those that would be provided by Diversity Arrays Technology (e.g. CallRate)

Value

a genlight object with the SNP data and associated metadata included.

Author(s)

Arthur Georges (Post to https://groups.google.com/d/forum/dartr)


dartR

Importing and Analysing SNP and Silicodart Data Generated by Genome-Wide Restriction Fragment Analysis

v1.9.6
GPL-2
Authors
Bernd Gruber [aut, cre], Arthur Georges [aut], Jose L. Mijangos [aut], Peter J. Unmack [ctb], Oliver Berry [ctb], Lindsay V. Clark [ctb], Floriaan Devloo-Delva [ctb]
Initial release
2021-04-29

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.