Skip to content

UserGuide: Basic comparisons

S.Alves edited this page Sep 2, 2021 · 2 revisions

To visually compare your lists of DEGs in a simplistic way, you can create Venn and/or UpSetR plots. Venn diagrams allow you to compare up to 4 lists while Upset allows you to make wider comparisons. However, if you have too many lists to display the graph may be unreadable.

To display the Venn diagrams, you need to specify the type of comparison wanted: all DEGs, gene expressed "down", gene expressed "up", or gene expressed "up" and "down" (in the same graph). Next, you must provide a list of the comparisons to display, but for last type of comparison you can provide only two contrasts.

For UpSetR graphs, you need to specify the type of comparison wanted: all DEGs, gene expressed "up", gene expressed "down" or gene expressed "up" and "down" (in the same graph). After, there are two methods available: display all contrast and/or display multiples graphs based on list of contrasts.

Venn diagram

To display the Venn diagrams, you need to specify the type of comparison wanted parameters$VD:

  • all : Create VennDiagrams for all differentially expressed genes
  • up : Create VennDiagrams for gene expressed UP
  • down : Create VennDiagrams for gene expressed DOWN
  • both : Create VennDiagrams for gene expressed UP and DOWN (in the same graph)

Next, you must provide a list of the comparisons to display: parameters$compaVD.
For exemple :

# this create 1 venn diagram
parameters$compaVD=c("Ctrast1-Ctrast2-Ctrast3") 
# this create 3 venn diagrams
parameters$compaVD=c("Ctrast1-Ctrast2-Ctrast3", 
                     "Ctrast4-Ctrast5-Ctrast6",
                     "Ctrast7-Ctrast8-Ctrast9")

With our data, we will make 3 Venn diagrams for the different types (all, up and down).

parameters$compaVD = c("AC1vsAC2-AC1vsAC3-AC2vsAC3",
                       "BC1vsBC2-BC1vsBC3-BC2vsBC3",
                       "AC1vsBC1-AC2vsBC2-AC3vsBC3")

# graph type "all"
parameters$VD = "all"
VD(resDEG, parameters, asko_data)

# graph type "up"
parameters$VD = "up"
VD(resDEG, parameters, asko_data)

# graph type "down"
parameters$VD = "down"
VD(resDEG, parameters, asko_data)

With the VD="both" you will only have to provide two contrasts.

# graph type "both"
parameters$compaVD = c("AC1vsBC1-AC2vsBC2",
                       "AC1vsBC1-AC3vsBC3",
                       "AC2vsBC2-AC3vsBC3")
parameters$VD = "both"
VD(resDEG, parameters, asko_data)

All graphs will appear in a folder named "DEG_test/VennDiagrams/". Some example of venn diagrams :

venn1 venn2 venn3 venn4

Upset graphs

You can display all contrast, you just need to specify the type of comparison wanted parameters$upset_basic:

  • all : Create chart for all differentially expressed genes
  • up : Create chart for gene expressed UP
  • down : Create chart for gene expressed DOWN
  • mixed : Create chart for gene expressed UP and DOWN (in the same graph)
  • NULL : Don't make graphs

You can display multiples graphs based on list of contrast parameters$upset_list, you need to precise the type of comparison parameters$upset_type.
Example:

# Precise type of comparison: all, down, up, mixed.
parameters$upset_type = "all"

# Give a list of contrast, for example:
# this create 1 graphs
parameters$upset_list = c("Ctrast1-Ctrast2-Ctrast3")   
# this create 3 graphs
parameters$upset_list = c("Ctrast1-Ctrast2-Ctrast3",  
                          "Ctrast4-Ctrast5-Ctrast6",
                          "Ctrast1-Ctrast2-Ctrast3-Ctrast4-Ctrast5")

With our data, we will make several upset charts for the different types (all, up, down and mixed), with all contrast and list of contrast.

parameters$upset_list = c("AC1vsAC2-AC1vsAC3-AC2vsAC3",
                          "BC1vsBC2-BC1vsBC3-BC2vsBC3",
                          "AC1vsBC1-AC2vsBC2-AC3vsBC3")

# graphs type "all"
parameters$upset_basic = "all" # all contrast
parameters$upset_type = "all"  # list of contrast
UpSetGraph(resDEG, data, parameters)

# graphs type "mixed"
parameters$upset_basic = "mixed" # all contrast
parameters$upset_type = "mixed"  # list of contrast
UpSetGraph(resDEG, data, parameters)

# graphs type "up"
parameters$upset_basic = "up" # all contrast
parameters$upset_type = "up"  # list of contrast
UpSetGraph(resDEG, data, parameters)

# graphs type "down"
parameters$upset_basic = "down" # all contrast
parameters$upset_type = "down"  # list of contrast
UpSetGraph(resDEG, data, parameters)

Some example of upset graphs (from subset "AC1vsBC1-AC2vsBC2-AC3vsBC3"):

upset1 upset2 upset3 upset4

Intersections of DEGs lists between contrasts. DEGs lists in each contrast and their size are shown in the horizontal histograms. The lines connected by dots represent the intersection between these lists. The vertical histograms represent the number of DEGs in each intersection. Colors (green/red) represents UP- and DOWN- regulated DEGs.

An "DEG_test/UpsetGraphs/" directory will be created with two subdirectories "DEG_test/UpsetGraphs/Global_upset/" and "DEG_test/UpsetGraphs/Subset_upset/".