Filter out pct.2 <0.5
1
0
Entering edit mode
14 months ago
Chris ▴ 260

Hi all,

Would you remind me how to filter out pct.2 < 0.5 in this case:

markers %>%
    group_by(cluster) %>% 
    slice_min(n = 2, order_by = avg_log2FC)

I tried filter(markers, markers$pct.2 < 0.5) but I got error.

Thank you so much!

findallmarker • 497 views
ADD COMMENT
1
Entering edit mode
14 months ago
LChart 3.9k

With the %>% syntax in dplyr, you do not need to reference the input variable/table: %>% filter(pct.2 < 0.5) should work.

ADD COMMENT
0
Entering edit mode

Thank you so much!

markers <- markers %>%
        group_by(cluster) %>% 
        slice_max(n = 2, order_by = avg_log2FC) %>% filter(pct.2 < 0.5)
En_Vol <- EnhancedVolcano(markers, x = "avg_log2FC", y = "p_val", lab = rownames(markers),
                pCutoff = 1e-4, FCcutoff = 1)

I don't know why after I assigned it back to markers, the volcano plot only has a few dots with numbers, not the gene names as before.

ADD REPLY

Login before adding your answer.

Traffic: 2498 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6