buenrostrolab / FigR

Functional Inference of Gene Regulation
https://buenrostrolab.github.io/FigR/
MIT License
31 stars 10 forks source link

Removing Rik genes from figR.d listing #24

Open sylestiel opened 1 year ago

sylestiel commented 1 year ago

@vkartha How may i remove the Rik genes from DORC gene listing before plotting heatmap.

vkartha commented 1 year ago

Hi @sylestiel , you can try something like this:

# Keep only gene symbols that don't end in Rik
genesToKeep <- unique(figR.d$DORC[!grepl(".*Rik$",figR.d$DORC,fixed=FALSE)])

# Make sure Rik genes are removed
genesToKeep

# See how many of these you have
length(genesToKeep)

# Then pass these to plotfigRHeatmap to subset
plotfigRHeatmap(figR.d,DORCs=genesToKeep)
sylestiel commented 1 year ago

@vkartha Can you double check .*Rik$

The Riks are still present in the heatmap.

vkartha commented 1 year ago

Are you still seeing Rik genes come up when printing the contents of genesToKeep based on the above? It shouldn't be the case. Or are you seeing the Rik genes show up in the final heatmap, with empty values?

sylestiel commented 1 year ago

I see it in the heatmap. The whole point was to remove it from the heatmap.

vkartha commented 1 year ago

Can you first confirm whether the Rik genes are printed as part of genesToKeep given my example above? Then I'll be able to tell if it's a grep issue (Tested this out already on my end) or if it's an internal dataframe wrangling issue

sylestiel commented 1 year ago

How can I check?

I can only print part of it

vkartha commented 1 year ago

First see how many genes are returned as not having Rik based on my original grep command: length(genesToKeep)

Then see if there are still any with Rik in them

table(grepl("Rik",genesToKeep)) # Returns TRUE if found

vkartha commented 1 year ago

I just tested this out on the toy dataset used in the package vignette (SHARE-seq) which is also mouse and also has Rik genes as DORCs, and the code snipped I pasted above worked to remove genes ending in Rik.

sylestiel commented 1 year ago
Screen Shot 2023-02-09 at 2 01 24 PM
sylestiel commented 1 year ago

@vkartha the genes to Keep appears to have worked. However, I cannot rid the Heatmap of it.