BaderLab / EnrichmentMapApp

The EnrichmentMap Cytoscape App allows you to visualize the results of gene-set enrichment as a network.
http://apps.cytoscape.org/apps/enrichmentmap
GNU Lesser General Public License v2.1
31 stars 12 forks source link

R shiny issue building EM via mastermap #467

Closed rosscm closed 2 years ago

rosscm commented 3 years ago

I'm attempting to build an R shiny app that takes pathway enrichment results generated via fedup (a package I recently developed) and run it through EnrichmentMap. This works perfectly fine in a standard R environment, but I'm running into an issue now implementing this with shiny.

With the shiny app, the user supplies an input file that is stored in a temp directory. Then the files needed to run EnrichmentMap are generated and stored in a temp directory (the same one the user input file is in) to be supplied to enrichmentmap mastermap rootFolder. The directory structure looks like this

├── b040784a09c73bbe0b52ed15
│   └── 0.txt
├── femap_FASN_negative.txt
├── femap_FASN_positive.txt
└── pathwaysGMTe62f6d6c508.gmt

0.txt is the user input file (not for EM) and the rest are the files that I want to supply to rootFolder (2 datasets and 1 gmt file). However, rootFolder also reads 0.txt which causes an error since this is not an EM file. Screen Shot 2021-07-08 at 1 05 36 PM

Is there any way I could pattern match with rootFolder command? I feel like I've asked something similar to this in the past ... if not, is there any workaround to have rootFolder somehow ignore the subfolder? I've tried simply moving 0.txt but shiny doesn't like that.

Any help would be much appreciated!

mikekucera commented 2 years ago

The mastermap command has an argument called pattern that can be used to filter out subfolders...

pattern=<String>:
A glob-style path filter. Sub-folders inside the root folder that do not match the pattern will be ignored. For more details on syntax see https://docs.oracle.com/javase/8/docs/api/java/nio/file/FileSystem.html#getPathMatcher-java.lang.String-