Learn R Programming

seedy (version 1.3)

plotobservedsnps: Plot expected frequency of polymorphic sites in a model deep sequencing project

Description

Given an average depth of coverage and per base sequencing error rate, estimate the read frequency of most common polymorphic sites.

Usage

plotobservedsnps(data, timepoint=1, coverage=50, error=0.001, iterations=100, maxsnp=50, 
            legend=TRUE, ylim=c(0,1.5*coverage), ...)

Arguments

data
Full sequence data generated from the simulatepopulation function.
timepoint
Which sampling time should be used.
coverage
Coverage depth.
error
Sequencing erorr rate per base.
iterations
Number of iterations to generate confidence bounds.
maxsnp
Number of polymorphic sites to show.
legend
Should a legend be plotted?
ylim
Bounds of y axis.
...
Additional arguments to be passed to plot.

Value

  • Returns an iterations x maxsnp matrix. Each column represents a polymorphic site, and each row one iteration. Each entry provides the number of reads containing the polymorphism in a given iteration. Columns are ordered by frequency.

Details

Plots the expected number of reads containing the most frequent polymorphisms, with a 95% confidence interval, derived from repeated random draws. Additionally shows the frequency of false positive observations arising through sequencing error.

Examples

Run this code
data(deepseq)

# At the 25th time point
plotobservedsnps(data=deepseq, timepoint=25, xaxt="n", xlab="Ranked polymorphic sites", 
      ylab="Reads", yaxs="i", las=1)
# At the 50th time point
plotobservedsnps(data=deepseq, timepoint=50, xaxt="n", xlab="Ranked polymorphic sites", 
      ylab="Reads", yaxs="i", las=1)

Run the code above in your browser using DataLab