This was before your previous edit, but I'm going to leave it for more examples for others.
I think he wants a specific gene name though, so to add onto your answer:
data_1 <- unlist(your_dataframe[your_dataframe$gene == "gene",2:48])
data_2 <- unlist(your_dataframe[your_dataframe$gene == "gene",49:128])
boxplot(data_1,data_2)
You could also do it with subset:
data_1 <- unlist(subset(your_dataframe, gene == "geneName", select=2:48))
data_2 <- unlist(subset(your_dataframe, gene == "geneName", select=49:128))
boxplot(data_1,data_2)
Or with factors and ggplot2 if you're feeling fancy:
library(ggplot2)
data <- unlist(subset(your_dataframe, gene == "geneName", select=2:128))
newFrame <- data.frame(data=data, factor=c(rep(1,47), rep(2,80))
qplot(factor(factor), data, data=newFrame, geom="boxplot")
Are you trying to make boxplot of some specific gene?
Correct but within the data frame I have information for 2 cell types and those are found:
I just edited to clarify
Do you need to do the log transformation? That is what is introducing your NaNs. The boxplot will plot negative numbers if you want to keep them non-transformed.
If you need to do the log transformation, do it like this instead:
Within my libraries there are some that have 0 counts so when trying to find the residual to mean from those libraries for that particular gene... there are some that end up being negative values.
These are being excluded from the plot when I do the log transformation. Yet following your advise and running
allows for all values to be plotted.
Yet due to some outliers I am using the log