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

Description Usage Arguments Value Author(s) Examples

View source: R/consensus.pyRAD.R

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

1
2
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

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

Example output

Loading required package: ape
                                             >locus.1 
 "AGATCTCACCTGRTATGACATTAGTCTTGCTATCCTTAAACATTAATGAG" 
                                             >locus.2 
 "GCTGAGTGATGTAAATAAATTAGAGAAATTTATCAARATGAAAGGGAAAC" 
                                             >locus.3 
 "GTAAAAGAGAATGAGTCTGCTCTCTTGCCTTATACCGAACTCGACTCTCC" 
                                             >locus.4 
 "TTCTTCTTCGCTCTGCATCCTTTTTGTCCAATGCTTCTAATCTACGTTTA" 
                                             >locus.5 
 "CTTTTGTTTTTCTTCTTCACTTGTTGCCGCCTTTATTTTCCTATTAAAAA" 
                                             >locus.6 
 "CGTTATGGTTGATTTAGAAGAGGAAGAAAAGAAGGAAATGGTTCTCTGYC" 
                                             >locus.7 
 "TGTAACCAGGTTGAAGCTTAATGGAGGCACCAAAGTAGCCAGATCGAAAT" 
                                             >locus.8 
 "TGTCATTGGAATGGGGGTAAAGTAGTAAGAAAATAGAGGGTTACTTCAKT" 
                                             >locus.9 
 "AGRTTGGTGGAGGAAGAGGGTTGCTCGGTTTCGGAGCCCGATTCACTCGG" 
                                            >locus.10 
"TGCTAGGCTAGTCTTCCTGNTTAAAAAGGACAAATTGGCAATTTGGGTGCG" 

RADami documentation built on May 30, 2017, 8:23 a.m.