-
Notifications
You must be signed in to change notification settings - Fork 7
5. Explore differential coverage plots
Differential coverage plots are generated from two separate coverage files (in this example: HPminus.coverage
and HPplus.coverage
). You've already seen how to import them into a gbt
object earlier in step 3.
To make differential coverage plots instead of GC-coverage plots, simply specify a pair of samples to the slice=
parameter. For example, to have sample 1 coverage on the x-axis and sample 2 coverage on the y-axis, use the parameter slice=c(1,2)
. Differential coverage plots are automatically generated with log scales for both axes, but you can override this by specifying your own option to the log=
parameter.
Like with GC-coverage plots, you can overlay taxonomic marker genes, SSU rRNA markers, and tRNA markers, as well as add legend for the color scheme. In addition, you can choose to color the points by contig GC% instead of marker taxonomy (but you can't do both).
plot(d,slice=c(1,2)) # Basic plot. Defaults to coloring by marker genes, if data imported
plot(d,slice=c(1,2),marker=FALSE,gc=FALSE) # Uncolored plot
plot(d,slice=c(1,2),marker=TRUE,legend=TRUE) # Add legend
plot(d,slice=c(1,2),gc=TRUE,marker=FALSE) # Color by GC
plot(d,slice=c(1,2),gc=TRUE,marker=FALSE,legend=TRUE) # Add color scale for GC values
plot(d,slice=c(1,2),ssu=TRUE) # Mark scaffolds containing SSU rRNA genes with crosshairs
plot(d,slice=c(1,2),trna=TRUE) # Mark scaffolds containing tRNA genes with crosses
The same choosebin
function is used to choose a bin from a differential coverage plot, except that the slice=
parameter must be the same as the one used to draw the plot. Adding and subtracting bins works in the same way, as is fishing with Fastg information.
For example, first make a differential coverage plot from object d
using the coverage data from sample 1 (plotted on the horizontal axis) and sample 2 (plotted on the vertical axis):
plot(d,slice=c(1,2))
Now manually choose a bin d.bin1
by defining an area on the plot; use the choosebin()
function, but you must specify which coverage data were used to generate the plot in the previous step:
d.bin1 <- choosebin(d,slice=c(1,2)) # Other parameters as default
d.bin2 <- choosebin(d,slice=c(1,2),num.points=10) # Change number of points in the polygon used to define the area