Hello, I am trying to make a volcano plot for different clusters. I have 2 conditions, untreated vs. treated. I have a differential expression excel file that cellranger generated for me but within the file it has multiple clusters each which have a fold change and p value. How do I create a volcano plot that contains all the clusters rather than one? Would I have to do a volcano plot for each cluster and then combine them all somehow?
I use this code to generate the plot for just one of the clusters...
macrophage_list <- read.table("differential_expression_macrophage.csv", header = T, sep = ",")
EnhancedVolcano(macrophage_list, lab = as.character(macrophage_list$FeatureName), x = 'untreated.Log2.Fold.Change', y = 'untreated.P.Value', xlim = c(-8,8), title = 'Macrophage', pCutoff = 10e-5, FCcutoff = 1.5, pointSize = 3.0, labSize = 3.0)
Any help and suggestions is greatly appreciated.
Hi Kevin,
So create a volcano plot for each of my 20 clusters and then combine them with the code you gave me?
Thanks
If you want.
I uploaded only 2 of the cluster as a test, ran the following code and got the following error.
Hey, how did you create
v1_macrophage
andv2_macrophage
?Could you just try:
v1_macrophage <- read.table("cluster1_marcophage.csv", header = T, sep = ",") v2_macrophage <- read.table("cluster2_marcophage.csv", header = T, sep = ",")
Got this error for the following command:
Error in
$<-.data.frame
(*tmp*
, "wrapvp", value = list(x = 0.5, y = 0.5, : replacement has 17 rows, data has 31328Oh, they should be separate EnhancedVolcano objects, like this:
Hi Kevin,
I created 2 separate EnhancedVolcano objects for 2 of the clusters. Everything worked fine, but I was wondering how I would combine the data into one plot rather than having 20 separate volcano plots?
I appreciate your help.
Then, you will have to try the other option, i.e., merge (
rbind()
) the results tables and just use that.How do I go about merging the results table since all the p values and log fold change values are already in my file. They're just labeled based on which cluster it belongs to?
Thanks again for your help.
Oh, they are already in the same file? Can you paste an example of the data?
These are the headers.