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

View source: R/consensus.pyRAD.R

consensus.pyRADR Documentation

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.

Author(s)

Andrew Hipp

Examples

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

andrew-hipp/RADami documentation built on Nov. 9, 2023, 5:40 p.m.