Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MarkerBasedDecomposition overlapping genes error #38

Open
nikita-telkar opened this issue Sep 13, 2023 · 3 comments
Open

MarkerBasedDecomposition overlapping genes error #38

nikita-telkar opened this issue Sep 13, 2023 · 3 comments

Comments

@nikita-telkar
Copy link

Hello,

I'm trying to run the MarkerBasedDecomposition function, but I keep getting the error: Error in MarkerBasedDecomposition(eNorm_bulk, cell_markers, weighted = F) : No overlapping genes between markers and bulk.eset

I've throughly checked the al genes within cell_markers are present in the bulk expression matrix, and are in the same order.

My cell_markers dataframe
image

My bulk expression matrix (from an ExpressionSet assay, stored under eNorm_bulk@assayData[["exprs"]] )
image

I'm not sure how to proceed.

Thank you!

@brandonjew
Copy link
Collaborator

brandonjew commented Sep 13, 2023

Hi @nikita-telkar,

Thank you for your interest in our method! That is odd, from what I can see in the dataframe screenshots, that error should not occur. Gene ordering does not matter either. The check for that error is running the following code and throws this error if the intersect length is zero:

# Remove any marker genes that show up more than once
markers <- GetUniqueMarkers(markers, gene_col=gene_col)

intersect(unique(markers[,gene_col]), rownames(bulk.eset))

This error could be occurring due to the first line if all the genes show up more than once in the markers dataframe. If this is not the case, you can try checking what the output of the second line is. Things like trailing whitespaces can make the intersection empty.

Thanks,
Brandon

@nikita-telkar
Copy link
Author

Hi @brandonjew ,

Thank you for replying!

Yes, that's what I tried next:

# getting the function from the source page

GetUniqueMarkers <- function(x, gene_col="gene"){
keep <- ! (duplicated(x[,gene_col], fromLast = FALSE) |
duplicated(x[,gene_col], fromLast = TRUE) )
return(x[keep,])
}

Output: None of the genes were removed, but the list is empty

image
I then tried to match the rownames to the marker names, but I guess that that internally the function transposes the matrix

image

To ensure that the gene names do actually match, I transposed the bulk matrix (converting genes to column and rows to samples), and the gene names do match

image

@brandonjew
Copy link
Collaborator

Looks like rownames(eNorm_bulk) is not returning the expected list of gene names. Can you check what that function returns?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants