buenrostrolab/FigR

Removing Rik genes from figR.d listing

Opened this issue · 10 comments

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

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)


@vkartha
Can you double check .*Rik$

The Riks are still present in the heatmap.

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?

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

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

How can I check?

I can only print part of it

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

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.

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