chromatogram: Generate Chromatogram

Description Usage Arguments Details Value See Also Examples

Description

Generates a chromatogram from a sangerseq class object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
chromatogram(obj, trim5 = 0, trim3 = 0, showcalls = c("primary",
  "secondary", "both", "none"), width = 500, height = NA, cex.mtext = 1,
  cex.base = 1, ylim = 2, filename = NULL, showtrim = FALSE,
  showhets = TRUE)

## S4 method for signature 'sangerseq'
chromatogram(obj, trim5 = 0, trim3 = 0,
  showcalls = c("primary", "secondary", "both", "none"), width = 100,
  height = 2, cex.mtext = 1, cex.base = 1, ylim = 3, filename = NULL,
  showtrim = FALSE, showhets = TRUE)

Arguments

obj

sangerseq class object

trim5

Number of bases to trim from the beginning of the sequence.

trim3

Number of bases to trim from the end of the sequence.

showcalls

Which basecall sequence to show. Any value other than "primary", "secondary" or "both" will result in basecalls not being shown.

width

Approximate number of bases per line.

height

Height of each plot row. Ignored by some devices.

cex.mtext

Size factor for the text in the margins.

cex.base

Size factor for the basecall text.

ylim

Peaks larger than this many times the IQR larger than the median will be cutoff.

filename

Name of PDF file to save to. A "NULL" value outputs the chromatogram to the current device.

showtrim

If true, highlights trimmed region instead of hiding it.

showhets

Whether or not to highlight heterozygous positions.

Details

This function outputs a chromatogram to the current device or to a PDF file (filename is not NULL). Primary, Secondary or both basecalls can be shown if they are contained in the sangerseq object provided. What is shown will depend on how they were generated. If generated and provided by the ABIF or SCF file, then it will show the primary calls on the first line and the secondary calls on the second line. If generated by makeBaseCalls, then they will show the maximum and alternate basecalls only for heterozygous peaks. Finally, if the setAllelePhase has been run on the object, then the first line is the reference sequence and the second line is the alternate allele.

The range of the trace data shown is trimmed to the called sequence by default. Setting trim5 and trim3 to NULL will show the complete trace 5' and 3' of the called bases, respectively. This will generally create a very long trace. Conversely, setting trim5 and trim3 to an integer > 0 will hide the data corresponding to that number of bases at each end. For example, trim5=10 and trim3=20 will remove 10 bases from the 5' end and 20 bases from the 3' end.

Several output parameters can also be set to control how the figure appears. However, it should be noted that if the current device is too small, R will return an error and not show the chromatogram. This is common with long sequence reads. To bypass this error, we recommend that the user set filename. This will cause the chromatogram to be saved to a PDF file in the current working directory.

Value

A plot showing the chromatogram tracedata and, optionally, basecalls.

See Also

makeBaseCalls, setAllelePhase, sangerseq

Examples

1
2
3
4
5
6
hetsangerseq <- readsangerseq(system.file("extdata",
                                          "heterozygous.ab1",
                                          package = "sangerseqR"))
hetcalls <- makeBaseCalls(hetsangerseq, ratio = 0.33)
chromatogram(hetcalls, width = 100, height = 2, trim5 = 50, trim3 = 100,
             showcalls = "both", filename = "chromatogram.pdf")

Example output

Loading required package: Biostrings
Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, sd, var, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colMeans, colSums, colnames, do.call,
    duplicated, eval, evalq, get, grep, grepl, intersect, is.unsorted,
    lapply, lengths, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, rank, rbind, rowMeans, rowSums, rownames, sapply,
    setdiff, sort, table, tapply, union, unique, unsplit, which,
    which.max, which.min

Loading required package: S4Vectors
Loading required package: stats4

Attaching package: 'S4Vectors'

The following object is masked from 'package:base':

    expand.grid

Loading required package: IRanges
Loading required package: XVector

Attaching package: 'Biostrings'

The following object is masked from 'package:base':

    strsplit

Chromatogram saved to chromatogram.pdf in the current working directory

sangerseqR documentation built on Nov. 8, 2020, 6:52 p.m.