Learn R Programming

RADami (version 1.1-2)

consensus.pyRAD: Generate a consensus sequence for each of the loci in a pyRAD.loci object

Description

Uses consensusString [S4 method for signature 'DNAStringSet'] from the Biostrings package to create a consensus sequence for each locus in a pyRAD.loci object. All options in consensusString can be passed in. As a side-effect, writes a fasta-style file to writeFile.

Usage

consensus.pyRAD(pyIn, from = NA, to = NA, fastaNames = T,
    writeFile = 'rads.con.txt', cores = 1, ...)

Arguments

pyIn
an object of class pyRAD.loci
from
first locus to summarize (by number, sequentially from the beginning of the file), or NA if all loci are to be used
to
last locus to summarize (by number, sequentially from the beginning of the file), or NA if all loci are to be used
fastaNames
use TRUE to append a > to the front of each sequence title, making a fasta- style file
writeFile
filename to which to write the sequences
cores
number of cores to use; requires the parallel package
extra arguments to consensusString

Value

A character vector of sequences, with locus names as the vector names.

Examples

Run this code
  data(oak.rads)
  # provide filename for export in line below
  temp = consensus.pyRAD(oak.rads, from=1, to = 10, writeFile = NA)
  temp

Run the code above in your browser using DataLab