Skip to content

Optimize code and fix a bug #3

@victorzhu30

Description

@victorzhu30

In 2023_r46_volcano/r46.R
1.

dat2$regulate <- ifelse(dat2$log2FoldChange >= 0, 'up', 'down')
dat2$regulate[dat2$padj > 0.05] = 'no'
dat2$regulate[abs(dat2$log2FoldChange) < 1] <- 'no' 

The code segment is redundant and can be simplified to:

dat2$regulate <- ifelse(dat2$padj > 0.05 | abs(dat2$log2FoldChange) < 1, 'no', ifelse(dat2$log2FoldChange >= 0, 'up', 'down'))
  geom_vline(xintercept = c(-log2(1.5),log2(1.5)),  colour="gray88", linetype="dashed") 

Incorrect xintercept in geom_vline

c(-1,1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions