saezlab / transcriptutorial

This is a tutorial to guide the analysis of RNAseq dataset using footprint based tools such as DOROTHEA, PROGENY and CARNIVAL
https://saezlab.github.io/transcriptutorial/
GNU General Public License v3.0
55 stars 30 forks source link

04_Dorothea_Volcano nice failing #44

Closed Camillula closed 2 years ago

Camillula commented 2 years ago

Hi! First of all, thanks for the great tutorial. I managed to run the script and get until the bar plot with top 25 normalized enrichment scores (NES) for TFs. I also managed to load all the supporting functions. However, when I run the volcano nice in this way

volcano_nice(as.data.frame(sDEG[sDEG$ID %in% targets_STAT1,]),

  • FCIndex = 2, pValIndex = 5, IDIndex = 1,nlabels = 20, label = TRUE,
  • straight = FALSE)

I get the following error

Error in if (xpos(x) < -log(y)) { : missing value where TRUE/FALSE needed In addition: Warning messages: 1: In log(df[, pValIndex]) : NaNs produced 2: In log(y) : Error in if (xpos(x) < -log(y)) { : missing value where TRUE/FALSE needed

Would you be able to tell me what's wrong?

I will add a screenshot of what my dataframes look like sDEG targetstat

adugourd commented 2 years ago

Hey, thanks !

Looking at your df, FCIndex should be 3 and pValIndex should be 6 (instead of 2 and 5). These represent the column numbers

Cheers,

Aurelien

Camillula commented 2 years ago

Hi Aurelien! Thanks a lot, I changed the order as you suggest (see screenshot) but the issue persists, not the error is

Error in $<-.data.frame(*tmp*, "couleur", value = "0") : replacement has 1 row, data has 0 In addition: Warning messages: 1: In max(abs(df[, FCIndex])) : no non-missing arguments to max; returning -Inf 2: In max(abs(df[, FCIndex])) : no non-missing arguments to max; returning -Inf 3: In max(abs(-log(df[, pValIndex]))) :

Error in $<-.data.frame(*tmp*, "couleur", value = "0") : replacement has 1 row, data has 0

aaaa

adugourd commented 2 years ago

Can you subset your dataframe before passing it to the function ? To make sure that the dataframe that is passed to the function isn't empty.

Camillula commented 2 years ago

Dear Aurelien, Thanks this solved my issue, indeed the dataframe passed to the function was empty, as it did not recognize the rownames of the regulon targets. For users who might have the same problem, I solved renaming rows and the one column of my target

Probably there is an even easier way to do it, but still now I have my nice graphs. Thanks thanks thanks! 👯

targets_STAT1 <- as.data.frame(targets_STAT1) rownames(targets_STAT1)<- targets_STAT1[,"targets_STAT1"] colnames(targets_STAT1)<- c("ID") subset <- sDEG[sDEG$ID %in% targets_STAT1$ID,]

volcano_nice(as.data.frame(sDEG[sDEG$ID %in% targets_STAT1$ID,]), FCIndex = 2, pValIndex = 5, IDIndex = 1,nlabels = 20, label = TRUE, straight = FALSE)