View source: R/pipeline_functions.R
draw.GSEA.NetBID | R Documentation |
draw.GSEA.NetBID
creates a GSEA plot for drivers with more NetBID analysis information. Such as number of target genes, ranking of target genes in
differential expressed file, differential expression (DE) and differential activity (DA) values.
draw.GSEA.NetBID(
DE = NULL,
name_col = NULL,
profile_col = NULL,
profile_trend = "pos2neg",
driver_list = NULL,
show_label = driver_list,
driver_DA_Z = NULL,
driver_DE_Z = NULL,
target_list = NULL,
top_driver_number = 30,
target_nrow = 2,
target_col = "RdBu",
target_col_type = "PN",
left_annotation = "",
right_annotation = "",
main = "",
profile_sig_thre = 0,
Z_sig_thre = 1.64,
pdf_file = NULL
)
DE |
data.frame, a data.frame created either by function |
name_col |
character, the name of the column in |
profile_col |
character, the name of the column in |
profile_trend |
character, users can choose between "pos2neg" and "neg2pos". "pos2neg" means high |
driver_list |
a vector of characters, the names of top drivers. |
show_label |
a vector of characters, the names of top drivers.
If NULL, will display the names in |
driver_DA_Z |
a vector of numerics, the Z statistics of differential activity (DA) value of the |
driver_DE_Z |
a vector of numerics, the Z statistics of differential expressed (DE) value of the |
target_list |
list, the driver-to-target list object. The names of the list elements are drivers.
Each element is a data frame, usually contains at least three columns. "target", target gene names; "MI", mutual information; "spearman", spearman correlation coef- ficient.
Users can call |
top_driver_number |
numeric, number for the top significant drivers to be displayed in the plot. Default is 30. |
target_nrow |
numeric, users can choose between 1 and 2. Number of panels to mark the ranking of target genes. If 1, the ranking of target genes will be marked in one panel. If 2, the ranking of target genes will be marked in two panels. Upper panel for positively-regulated, lower panel for negatively-regulated. Default is 2. For details, please check online tutorial. |
target_col |
character, name of the color palette used for display marker line in the panel. Users can choose between "black" and "RdBu".
If "black", the marker line in the panel is black.
If "RdBu", the marker line in the panel is Red to Blue.
If |
target_col_type |
character, name of the color palette used for display target genes. This parameter works only when |
left_annotation |
character, annotation on the left of profile curve, indicating high in control group or target group. Default is "". |
right_annotation |
character, annotation on the right of profile curve, indicating high in the opposite group of |
main |
character, an overall title for the plot. Default is "". |
profile_sig_thre |
numeric, threshold value for target genes. This parameter works only when |
Z_sig_thre |
numeric, threshold value of Z statistics from |
pdf_file |
character, the file path to save figure as PDF file. If NULL, no PDF file will be saved. Default is NULL. |
Return a logical value. If TRUE, the plot has been created successfully.
analysis.par <- list()
analysis.par$out.dir.DATA <- system.file('demo1','driver/DATA/',package = "NetBID2")
NetBID.loadRData(analysis.par=analysis.par,step='ms-tab')
ms_tab <- analysis.par$final_ms_tab
comp <- 'G4.Vs.others'
DE <- analysis.par$DE[[comp]]
sig_driver <- draw.volcanoPlot(dat=ms_tab,label_col='gene_label',
logFC_col='logFC.G4.Vs.others_DA',
Pv_col='P.Value.G4.Vs.others_DA',
logFC_thre=0.4,
Pv_thre=1e-7,
main='Volcano Plot for G4.Vs.others_DA',
show_label=FALSE,
label_type = 'origin',
label_cex = 0.5)
driver_list <- rownames(sig_driver)
draw.GSEA.NetBID(DE=DE,profile_col='t',
name_col='ID',
profile_trend='neg2pos',
driver_list = driver_list,
show_label=ms_tab[driver_list,'gene_label'],
driver_DA_Z=ms_tab[driver_list,'Z.G4.Vs.others_DA'],
driver_DE_Z=ms_tab[driver_list,'Z.G4.Vs.others_DE'],
target_list=analysis.par$merge.network$target_list,
top_driver_number=5,
target_nrow=2,target_col='RdBu',
left_annotation = 'test_left',
right_annotation = 'test_right',
main='test',target_col_type='DE',
Z_sig_thre=1.64,
profile_sig_thre = 1.64)
## Not run:
analysis.par <- list()
analysis.par$out.dir.DATA <- system.file('demo1','driver/DATA/',package = "NetBID2")
NetBID.loadRData(analysis.par=analysis.par,step='ms-tab')
ms_tab <- analysis.par$final_ms_tab
comp <- 'G4.Vs.others'
DE <- analysis.par$DE[[comp]]
sig_driver <- draw.volcanoPlot(dat=ms_tab,label_col='gene_label',
logFC_col='logFC.G4.Vs.others_DA',
Pv_col='P.Value.G4.Vs.others_DA',
logFC_thre=0.4,
Pv_thre=1e-7,
main='Volcano Plot for G4.Vs.others_DA',
show_label=FALSE,
label_type = 'origin',
label_cex = 0.5)
driver_list <- rownames(sig_driver)
analysis.par$out.dir.PLOT <- getwd() ## directory for saving the pdf files
draw.GSEA.NetBID(DE=DE,profile_col='logFC',profile_trend='neg2pos',
driver_list = driver_list,
show_label=ms_tab[driver_list,'gene_label'],
driver_DA_Z=ms_tab[driver_list,'Z.G4.Vs.others_DA'],
driver_DE_Z=ms_tab[driver_list,'Z.G4.Vs.others_DE'],
target_list=analysis.par$merge.network$target_list,
top_driver_number=30,
target_nrow=2,
target_col='RdBu',
left_annotation = 'test_left',
right_annotation = 'test_right',
main='test',
target_col_type='DE',
Z_sig_thre=1.64,
profile_sig_thre = 1.64,
pdf_file=sprintf('%s/NetBID_GSEA_demo1.pdf',
analysis.par$out.dir.PLOT))
draw.GSEA.NetBID(DE=DE,profile_col='t',profile_trend='neg2pos',
driver_list = driver_list,
show_label=ms_tab[driver_list,'gene_label'],
driver_DA_Z=ms_tab[driver_list,'Z.G4.Vs.others_DA'],
driver_DE_Z=ms_tab[driver_list,'Z.G4.Vs.others_DE'],
target_list=analysis.par$merge.network$target_list,
top_driver_number=30,
target_nrow=1,
target_col='RdBu',
left_annotation = 'test_left',
right_annotation = 'test_right',
main='test',target_col_type='PN',
Z_sig_thre=1.64,profile_sig_thre = 1.64,
pdf_file=sprintf('%s/NetBID_GSEA_demo2.pdf',
analysis.par$out.dir.PLOT))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.