Comments (3)
Hi @bmplaw! Thanks for your message. The fc_cutoff works on the overall radial fold change, r, where:
In this case Z is the Fold change for each comparison. You can check out this parameter using: NK_polar_limma@polar$r_fc
If you want to add a fold-change cutoff for your pairwise comparisons a quick workaround would be to intercept the polar_coords output. Does it work if you try something like this:
# check the original groups
table(NK_polar_limma@polar$sig)
# Set up the FC values and cut-off
fc_cutoff <- 5
fc_df <- NK_polar_limma@pvalues[, grepl("FC", colnames(NK_polar_limma@pvalues))]
# Find which genes do not pass the fold change cut-off.
#-- I used !any() to change the genes to non-sig if NO pairwise comparisons
#-- reach the FC cutoff. You can easily change the condition.
non_sig <- unlist(apply(fc_df, 1, function(x) ! any(x > fc_cutoff) ))
NK_polar_limma@polar$sig[non_sig] <- NK_polar_limma@non_sig_name
# check the new group breakdown - you should have more non-significant
table(NK_polar_limma@polar$sig)
volcano3D(NK_polar_limma)
I will look into adding pairwise cut-offs to the functions when I have more time.
from volcano3d.
Thank you so much! You are right, the numbers of non-significant genes have increased a lot. However, does this code also make genes non-significant if the fold-change is less than 5?
To demonstrate this, in the below example, I set the fc_cutoff using your method to 4. Wouldn't we consider B3GAT1 a significant gene even when we set the fc_cutoff to 4?
I adjusted your code to:
non_sig <- unlist(apply(fc_df, 1, function(x) ! any(x > fc_cutoff) ))
and it seems to do that job? I'm fairly new to R and your input is much appreciated.
#Original
NK_polar_limma <- polar_coords(sampledata = z_meta,
contrast = "group",
pvalues = Pvals_limma_NK2,
expression = z_count,
p_col_suffix = "pvalue",
padj_col_suffix = "padj",
multi_group_prefix = "Overall",
non_sig_name = "Not Significant",
fc_col_suffix = 'log2FoldChange',
significance_cutoff = 0.05,
label_column = NULL,
cutoff_criteria = "padj")
radial_plotly(polar = NK_polar_limma,
hover=hovertext)
#KatrionaGoldmann's code; fc_cutoff = 4
#Set up the FC values and cut-off
fc_cutoff <- 4
fc_df <- NK_polar_limma@pvalues[, grepl("FC", colnames(NK_polar_limma@pvalues))]
non_sig <- unlist(apply(fc_df, 1, function(x) ! any(x > fc_cutoff) ))
NK_polar_limma@polar$sig[non_sig] <- NK_polar_limma@non_sig_name
radial_plotly(polar = NK_polar_limma,
hover=hovertext)
#KatrionaGoldmann's code; fc_cutoff = 4: adjusted
#Set up the FC values and cut-off
fc_cutoff <- 4
fc_df <- NK_polar_limma@pvalues[, grepl("FC", colnames(NK_polar_limma@pvalues))]
non_sig <- unlist(apply(fc_df, 1, function(x) ! any(abs(x) > fc_cutoff) ))
NK_polar_limma@polar$sig[non_sig] <- NK_polar_limma@non_sig_name
radial_plotly(polar = NK_polar_limma,
hover=hovertext)
from volcano3d.
Hi, so if I understand correctly you want B3GAT1 to be considered significant as in your last plot? You are completely correct to add the abs()
since we are considering negative FC as well!
In more detail...
The command I wrote classes genes as non significant if there are not any FC comparisons greater than the cutoff (! any(abs(x) > fc_cutoff)
), but in your case there would be since abs(CD56DimCD57Neg vs CD56DimCD57Pos logFC) > 4. So if, for example, you were more interesting in saying genes should be treated as non-significant if there are any comparisons below the cutoff you would want something more like :
# treated as non-significant if any comparisons are below fc_cutoff:
non_sig <- unlist(apply(fc_df, 1, function(x) any(abs(x) < fc_cutoff) ))
# treated as non-significant if there are not any comparisons above fc_cutoff:
# non_sig <- unlist(apply(fc_df, 1, function(x) ! any(abs(x) > fc_cutoff) ))
Hope this helps.
from volcano3d.
Related Issues (20)
- Allow instances with no significant features HOT 1
- Allow cases where one comparison may be a substring of another HOT 1
- Volcano3d and radial_plotly not interactive HOT 2
- How significance groups are determined? HOT 1
- Is there any way to use volcano3D on single cell seurat object? HOT 5
- r_zscore/-log10 p-value HOT 1
- bug on colors ordering in the volcano3D function HOT 1
- consider changing defaults to polar_coords HOT 1
- Allow volcano_trio plot to be colour coded by significance group HOT 2
- qval function requiring charm package HOT 2
- Set the fc_cutoff in ‘deseq_polar’ HOT 2
- label show incomplete HOT 1
- P cutoff HOT 1
- legend too far from figure HOT 2
- boxplot_trio(ploar,value="COBL") fails HOT 1
- Colour_code_labels in radial_plotly (green3 and gold2 not working) HOT 2
- Question about the radial plot HOT 2
- Create function to extract information about specific populations HOT 1
- Height of Volcano 3D plot HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from volcano3d.