This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Plotting genes in terms of fold change in different grouping

Sorry,

I have a lists of differentially expressed genes; I have the log fold change of them. These genes coming from 2 quenching platforms (immune and biomarker). Also these genes are related to 2 group of patient prognosis TRG12 vs TRG45. How I can plot these genes in a way I can show them related to platform and TRG? I guess something like a volcano although I am not sure

Gene    Fold Change Panel   TRG
CHGA    -1.5652029  Both    TRG 4-5 Signature
IL1B    -1.3159235  Both    TRG 4-5 Signature
CXCL8   -1.231194003    Both    TRG 4-5 Signature
ALB -1.2116047  Biomarker   TRG 4-5 Signature
PTGS2   -1.1674647  Both    TRG 4-5 Signature
CSF3    -1.12757675 Both    TRG 4-5 Signature
OSM -1.113489387    Both    TRG 4-5 Signature
IL6 -1.107777024    Both    TRG 4-5 Signature
ISG15   -1.070607929    Both    TRG 4-5 Signature
IFIT1   -1.0214389  Immune  TRG 4-5 Signature
CT45_family -1.0097384  Immune  TRG 4-5 Signature
CXCL6   -1.003206221    Both    TRG 4-5 Signature
MAGEA1  -1.001533309    Both    TRG 4-5 Signature
S100A7A 1.0501062   Biomarker   TRG 1-2 Signature 
KIF5C   1.146357    Immune  TRG 1-2 Signature 
HLA-DQA2    1.1829847   Immune  TRG 1-2 Signature 
KRT14   1.338032    Biomarker   TRG 1-2 Signature 
MPPED1  1.3464259   Immune  TRG 1-2 Signature 
CDK6    1.43895365  Both    TRG 1-2 Signature 
KLK5    1.470414    Biomarker   TRG 1-2 Signature 
ANKRD30A    1.4728634   Immune  TRG 1-2 Signature 
CALML5  1.4947388   Biomarker   TRG 1-2 Signature

For example this code gives something weird

with (top,
      points(
          x = top$TRG,
          y = top$Fold.Change,
          col = "green",
          pch = 16,
          cex=2
      ))

enter image description here

Thank you for any help

enter image description here

edgeseq rna-seq r ggplot2

2 answers

dd <- tibble::tribble(
          ~Gene, ~Fold_Change,      ~Panel,                ~TRG,
         "CHGA",   -1.5652029,      "Both", "TRG_4-5_Signature",
         "IL1B",   -1.3159235,      "Both", "TRG_4-5_Signature",
        "CXCL8", -1.231194003,      "Both", "TRG_4-5_Signature",
          "ALB",   -1.2116047, "Biomarker", "TRG_4-5_Signature",
        "PTGS2",   -1.1674647,      "Both", "TRG_4-5_Signature",
         "CSF3",  -1.12757675,      "Both", "TRG_4-5_Signature",
          "OSM", -1.113489387,      "Both", "TRG_4-5_Signature",
          "IL6", -1.107777024,      "Both", "TRG_4-5_Signature",
        "ISG15", -1.070607929,      "Both", "TRG_4-5_Signature",
        "IFIT1",   -1.0214389,    "Immune", "TRG_4-5_Signature",
  "CT45_family",   -1.0097384,    "Immune", "TRG_4-5_Signature",
        "CXCL6", -1.003206221,      "Both", "TRG_4-5_Signature",
       "MAGEA1", -1.001533309,      "Both", "TRG_4-5_Signature",
      "S100A7A",    1.0501062, "Biomarker", "TRG_1-2_Signature",
        "KIF5C",     1.146357,    "Immune", "TRG_1-2_Signature",
     "HLA-DQA2",    1.1829847,    "Immune", "TRG_1-2_Signature",
        "KRT14",     1.338032, "Biomarker", "TRG_1-2_Signature",
       "MPPED1",    1.3464259,    "Immune", "TRG_1-2_Signature",
         "CDK6",   1.43895365,      "Both", "TRG_1-2_Signature",
         "KLK5",     1.470414, "Biomarker", "TRG_1-2_Signature",
     "ANKRD30A",    1.4728634,    "Immune", "TRG_1-2_Signature",
       "CALML5",    1.4947388, "Biomarker", "TRG_1-2_Signature"
  )

## box plot 
dd %>% ggplot() + geom_boxplot(aes(y = Fold_Change , x = TRG, fill = TRG) )  + facet_wrap(~Panel) + theme_bw(base_size = 15) + coord_flip()

pp2

## joy plot 
ggplot(dd)  + ggridges::stat_density_ridges(geom = "density_ridges_gradient" , mapping = aes(x = Fold_Change, y = Panel, fill = 0.5 - abs(0.5 - ..ecdf..)) , calc_ecdf = TRUE ) + facet_wrap(~TRG , ncol = 1) + theme_bw(base_size = 15) + guides(fill=guide_legend(title="Prob"))

pp3

To be honest the plots are amazing, I did not expect those

Thanks a lot man

Well, one way using traditional R graphics here:

# Underscores added to posted space-delimited variable names and values
par(mfrow=c(1,2))
stripchart(Fold_Change ~ TRG, data=top, method="jitter", vertical=TRUE, jitter=0.05, col=c(1,2), 
           ylab="log2FC", xlab="Prognosis", pch=19, main="FC by Prognosis group")
stripchart(Fold_Change ~ Panel, data=top, method="jitter", vertical=TRUE, jitter=0.05, col=1:3, 
           ylab="log2FC", xlab="Panel", pch=19, main="FC by Panel")

b20190109

Log in to answer this question.