Learn R Programming

enrichvs (version 0.0.5)

plot_enrichment_curve: Function to plot a enrichment curve for virtual screening

Description

Function to plot a enrichment curve for virtual screening

Usage

plot_enrichment_curve(x, y, decreasing=TRUE, npoint=100, colbarwidth=1, colorize=FALSE, add=FALSE, col="black", lwd=2)

Arguments

x
a vector for scores
y
a vector for labels (0:inactive, 1:active)
decreasing
TRUE if the compounds are ranked by decreasing score
npoint
the number of points to plot the curve
colbarwidth
the width of color bar (only if colorize==TRUE)
colorize
TRUE if the plot line is colorerd by the corresponding scores
add
TRUE if the plot is add to the previous plot
col
color of the plot
lwd
line width of the plot

Value

call a plot

Details

References

See Also

Examples

Run this code
data(dud_egfr)
x <- rnorm( 88888 )                        # virtual scores for 1000 compounds
y <- c(rep(1,88), rep(0,88800))            # activity labels for "x"
plot_enrichment_curve(x, y, col="blue")

plot_enrichment_curve(dud_egfr$energy, dud_egfr$label, 
	add=TRUE, decreasing=FALSE, col="red") # Add a plot
legend("bottomrigh", legend = c("ideal", "random", "score1", "score2"),
	lty=c(2,3,1,1), col=c("black", "grey", "blue", "red"), bty="n")

Run the code above in your browser using DataLab