Lan-lab / SIGNET

4 stars 5 forks source link

Error when running prune function #3

Closed ozlembahar closed 2 years ago

ozlembahar commented 2 years ago

Hi,

I get this error message when I run prune function: "Error in .addSignificantGenes(resultsTable = resultsTable, geneSets = geneSets, : There is no column 'geneSet' in the input results table. Please, confirm its format." I would appreciate your help.

Tonitrus2020 commented 2 years ago

It seems like the error generates when the Prune function calls the cisTarget function from the RcisTarget package. The basic logic of the prune function is to get rid of low credit NTFs from the original TF geneset generated by screening for outliers and the core of this function is based on the cisTarget function.

The five inputs of prune function include 1) outlier matrix generated by Screen function; 2) genesets file obtained by the Genesets function; 3) genesets_list, i.e. the rownames of the genesets file; 4) motifRankings and 5) motifAnnotation. Since I cannot conduct your codes, I can only think of following solustions. First, please make sure that you have the right format of all the input files. Second, you can try some other toy demos from the tutorial of RcisTarget to make sure that you can conduct the cisTarget function successfully. Finally, I've updated a new SIGNET.R file to fix the Prune function and you can try it again.

ozlembahar commented 2 years ago

Hey, thanks a lot for the suggestions and uploading the SIGNET.R. I started with running the updated functions from the SIGNET.R. Unfortunately, I got the same error message at the Pruning step.

I tried cisTarget function with 3 inputs: genesets_list, motifRankings, motifAnnotation. I was able to get motif enrichment table as an output. It seems cisTarget function works fine with those inputs. So I think I was able to narrow down to two files: 1) outlier matrix; 2) genesets file. I am not sure if they are in correct format but as far as understood from the functions they seem so. Nevertheless, I will attach screenshots of those files hoping that you could point out if something is wrong.

I basically copied and pasted your R workflow. Only difference is that I am not using mouse annotation database and my output files from SIGNET.py. Thus, another option comes to my mind is that I could send my output files from SIGNET.py for you to run SIGNET.R functions. Please let me know if that makes easier to find out what is wrong. If so, could you also please send your e-mail address so that I could e-mail my outputs?

Best, y

ozlembahar commented 2 years ago

Hi, Would it be a format issue related to motif/annotation versions? I am using fly database and version 9 is not available yet for motif rankings. So for both rankings and annotations I retrieved version 8.

motifAnnotations <- importAnnotations("motifs-v8-nr.flybase-m0.001-o0.0.tbl") motifRankings <- importRankings("dm6-5kb-upstream-full-tx-11species.mc8nr-2.feather")

Tonitrus2020 commented 2 years ago

Hey, Your outlier matrix and genesets_list files both are in the right format according to your screenshots except that you may double check if the row and column of the matrix are in the right position. And since your cisTarget function works fine with your genesets_list, I'm not sure if the rest part of the Prune function makes the mistake. In fact, the output of the Prune function is another matrix (called regulon matrix inside the function) similar to the outlier matrix except that some of the coexpressed relations are removed (i.e. the entries turn from 1 to 0). However, it seems that there's something going wrong with the process turing the result of cisTarget into the final regulon matrix. You also mentioned that you use the database and annotation of fly, and we didn't try such data when we developed SIGNET. Maybe there're some differences between the output of mouse and fly. It would be helpful if you can send your motif enrichment table to us and we can figure out why prune function doesn't work. And the email address is luoqh17@mails.tsinghua.edu.cn.

ozlembahar commented 2 years ago

Hey, the good news is the Prune function is now working like a charm. :) The bad news is I could not yet identified what was actually causing this error. I deleted my r environment and installed all the packages again and that basically solved my issue. Thanks a lot for your suggestions and help. Best, y