This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Using a script to create a binary file. Help with arguments

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

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.

0 answers

No answers yet.

Log in to answer this question.