Using a script to create a binary file. Help with arguments
0
0
Entering edit mode
4.4 years ago
n.tear ▴ 80

I am currently trying to create a binary file for my results based on FDR value and LFC value

for (i in 2:nrow(de)){ # this is for the comp1 set

    if (de$cp1_LFC[i] >= 1 && de$cp1_padj[i] < .05) { # where de$comp1_logFC holds your logFC value for the first vs second factor & 2 is my logFC significance threshold
        de$cp1_up[i] <- "1"
        de$cp1_down[i] <- "0"
        de$cp1_flat[i] <- "0"
    } else if (de$cp1_LFC[i] <= -1 && de$cp1_padj[i] < .05){
        de$cp1_up[i] <- "0"
        de$cp1_down[i] <- "1"
        de$cp1_flat[i] <- "0"
    } else if ((between(de$cp1_LFC[i], -1, 1)) || (de$cp1_padj[i] >= .05)){
        de$cp1_up[i] <- "0"
        de$cp1_down[i] <- "0"
        de$cp1_flat[i] <- "1"
    } else {
        warning(paste("problem with row:",i))
    }


}

Unfortunately I get the errors

argument is of length zero

and

missing value where TRUE/FALSE needed

Can someone assist me in where I am going wrong. I am not very familiar with creating these arguments

Thanks

Nathan

R RNA-Seq • 649 views
ADD COMMENT
0
Entering edit mode

To get more help you should post the whole error message. However, it looks like either de$cp1_LFC or de$cp1_padj are not defined.

ADD REPLY

Login before adding your answer.

Traffic: 1722 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