geneScatter | R Documentation |
Visualize gene expression data in 1, 2, and 3 dimension scatter/waterfall plots for exploratory data analysis.
geneScatter(
x,
genes = NULL,
color = NULL,
shape = NULL,
size = NULL,
trendline = FALSE,
symbol = "GeneSymbol",
legend = NULL,
main = TRUE,
na.rm = TRUE,
facet = NULL,
shiny = FALSE,
useNormCounts = TRUE,
...
)
x |
R data object; Most typically this is an |
genes |
character vector; Names of genes or or phenotype data that can be coerced into a numeric vector. |
color |
vector/character; Should either be factor of values used to color points or the name of a gene/phenotype that can be used to construct one. |
shape |
vector/character; Should either be factor of values used to control the shape (i.e. |
size |
vector/character; Should either be factor of values used to control the shape (i.e. |
trendline |
character; Valid options include |
symbol |
character; Column name of of gene symbols in the feature data of |
legend |
logical or character; Draws a figure legend. Use to set the legend title which defaults to "Legend" if equals |
main |
character; The main plot title. Defaults to true for automated generation. |
na.rm |
logical; Removes |
facet |
factor or name of factor to be exacted from |
shiny |
logical; Use |
useNormCounts |
logical; By default |
... |
Any valid bvt plotting parameter that can be found in |
Details will be forthcoming. Makes a 2D or 3D scatter plot.
A list of class npData
. This contains data necessary to regenerate the plot as well as summary statistics.
niceScatter
, niceDensity
#While bioinformatic data sets are the intended use case, bvt functions can be used with as regular
#plotting functions with data such as iris. As geneScatter is expecting expression data with
#patients as columns and genes as rows, it is necessary to take the transpose of the data set first.
data("iris")
#basic usage
geneScatter(t(iris[,1:2]), color=iris$Species, shape=iris$Species, size=iris$Petal.Length,
legend=c("Species", "Petal Length"), main="Basic Scatter")
#using adding a trendline
a<-geneScatter(t(iris[,3:4]), color=iris$Species, trendline=TRUE, theme=npGGTheme, verbose=TRUE,
corMethod="spearman", pointSize=.8,logScale=10, minorTick=3, minorGuides=TRUE, main="Using Trend Lines")
#to access the linear model or cor.test statics later:
a$stats
#multiple trend lines
geneScatter(t(iris[,1:2]), color=iris$Species=="setosa", shape=iris$Species,
trendline="color", theme=npColorTheme, legend=c("Is Setosa?","Species"), main="Multiple Trend Lines")
#single variable plotting
geneScatter(t(iris[,3]), color=iris$Species, main="Single Variable Plotting")
#waterfall version of the above. Note type is the same as in base plotting \(i.e. "p","b","h","l"\)
orderedIris<-order(iris[,3], decreasing = TRUE)
geneScatter(t(iris[orderedIris,3]), color=iris$Species[orderedIris], type="h", main="Waterfall Example")
#3D plotting. You can set useRgl=TRUE for rgl based interactive graphics
geneScatter(t(iris[,1:3]), color=iris$Species, logScale=2, size=iris[,4] ,pointSize=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.