Learn R Programming

TRAMPR (version 1.0-7)

load.abi: Load ABI Output Files

Description

These functions help convert data from Applied Biosystems Gene Mapper (ABI) output format into TRAMPsamples objects for analysis. Note that this operates on the summarised output (a text file), rather than the .fsa files containing data for individual runs. Details of the procedure of this function are given below, and a worked example is given in the package vignette; type vignette("TRAMPRdemo") to view it. The function peakscanner.to.genemapper is an experimental function to convert from peakscanner output to abi genemapper output. The peakscanner output is very slightly different in format, and currently load.abi is very fussy about the input file's structure. Eventially load.abi will be made more tolerant, but as an interim solution, run peakscanner.to.genemapper on your file. By default, running peakscanner.to.genemapper(myfile.csv) will produce a file myfile.txt. This can then be loaded using load.abi as described below, specifying myfile.txt as the file argument.

Usage

load.abi(file, file.template, file.info, primer.translate, ...)
load.abi.create.template(file, file.template)
load.abi.create.info(file, file.template, file.info)

peakscanner.to.genemapper(filename, output)

Arguments

file
The name of the file from which the ABI data are to be read from.
file.template
The name of the file containing the template file (see Details).
file.info
(Optional) the name of the file containing extra information associated with each sample (see Details).
primer.translate
List used to translate dye codes into primers. The same codes are assumed to apply across the whole file. See Details for format.
...
Additional objects to incorportate into a TRAMPsamples object. See TRAMPsamples for details.
filename
In peakscanner.to.genemapper, the name of the csv file containing output.
output
In peakscanner.to.genemapper, the name of the file to be output in abi format (if omitted, this will be automatically generated).

Warning

Do not change the names of any columns produced by load.abi.create.template or load.abi.create.info.

Details

Some terminology: a sample refers to a physical sample (e.g. a root tip), while a run refers to an individual TRFLP run (i.e. one enzyme and one primer). Because two primers are run at once, each runfile contains information on two runs, but each sample may contain more than one runfile. Runfiles are distinguished by different sample.file.name values in the ABI file, while different samples are distinguished by different sample.fk/sample.pk values. primer.translate is a list used to translate between the dyes recorded in the ABI file and the primers used. Each element corresponds to a different primer, and is a vector of different colour dyes. The list: list(ITS1F="B", ITS4="G") would translate all dyes with the value "B" to "ITS1F", and all dyes with the value "G" to "ITS4". The list: list(ITS1F="B", ITS4=c("G", "Y")) would do the same, except that both "G" and "Y" dyes would be converted to "ITS4". If a dye is used in the data that is not represented within primer.translate, then it will be excluded (e.g., all rows of data with dye as "R" will be excluded). The procedure for loading in ABI data is:
    %% Copied from the vignette:
  1. Create thetemplatefile. Template files are required to record which enzymes were used for each run, since that is not included in the ABI output, and to group together separate runs (typically different enzymes) that apply to the same individual. The functionload.abi.create.templatewill create a template that contains all the unique file names found in the ABI file (assample.file.name), and blank columns titledenzymeandsample.index. Runningload.abi.create.template(x)wherexis the name of your ABI file will create a template file in the same directory as the ABI file. The function will print the name and location of the template file to the console.
  2. Edit the template file and save. Theenzymeandsample.indexcolumns are initially empty and need filling in, which can be done in Excel, or another spreadsheet program. Thesample.indexcolumn linkssample.file.nameback to an individual sample; multiplesample.file.names that sharesample.indexvalues come from the same individual sample. (If editing with Excel, ignore all the warnings about incompatible file formats when saving.)sample.indexshould be a positive integer (but see Note below).
  3. Optionally create aninfofile, which is useful if you want to associate extra information against your samples. The functionload.abi.create.infowill create an info file that contains all the unique values ofsample.index, and an empty column titledspecies. Thespeciescolumn can be filled in where the species is known (e.g. from collections of sporocarps). Any additional columns may be added. Runningload.abi.create.info(x)wherexis the name of your ABI file will create an info file in the same directory as the ABI file. The function will print the name and location of the info file to the console. Edit and save this file.
  4. Create theTRAMPsamplesobject by runningload.abi. This loads your ABI data, plus the new template file, plus an optional information file. Runningmy.samples <- load.abi(x, primer.translate=primer.translate)will create an objectmy.samplescontaining your data.
By default, the filenames of the template and info files will be automatically generated: . becomes _template.csv or _info.csv. If you choose to specify file.template or file.info manually when running load.info.create.template or load.info.create.info, you must use the same values of file.template and file.info when running load.abi.

See Also

read.abi, which reads in ABI data with few modifications. TRAMPsamples, which documents the data type produced by load.abi. The package vignette, which includes a worked example of loading data using these functions; to locate the vignette, type help(library=TRAMPR), and scroll to the bottom of the page, or type: system.file("doc/TRAMPR_demo.pdf", package="TRAMPR").