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

Errors when running BayesPrism with gene symbles. #1

Open
Sphingosine opened this issue Jun 22, 2022 · 1 comment
Open

Errors when running BayesPrism with gene symbles. #1

Sphingosine opened this issue Jun 22, 2022 · 1 comment

Comments

@Sphingosine
Copy link

Sphingosine commented Jun 22, 2022

Hi,

I was running BayesPrism using gene symbols and met this error when running functions plot.scRNA.outlier and plot.bulk.outlier:

" Error in input.genes.short %in% gene.df[gene.df[, 1] == gene.group.i, :
object 'input.genes.short' not found "

I found it's due to the function "assign.category" in "process_input.R" and made a very slight change to make it work:
#detect if EMSEMBLE ID (starts with ENS) or gene symbol is used
if( sum(substr(input.genes,1,3)=="ENS")> length(input.genes)*0.8 ){
cat("EMSEMBLE IDs detected.\n")
input.genes.short <- unlist(lapply(input.genes, function(gene.id) strsplit(gene.id,split="\.")[[1]][1]))
gene.df <- gene.list[,c(1,2)]
gene.group.matrix <- do.call(cbind.data.frame, lapply(unique(gene.df[,1]),
function(gene.group.i) input.genes.short %in% gene.df[gene.df[,1]== gene.group.i,2]))
}
else{
cat("Gene symbols detected. Recommend to use EMSEMBLE IDs for more unique mapping.\n")
gene.df <- gene.list[,c(1,3)]
gene.group.matrix <- do.call(cbind.data.frame, lapply(unique(gene.df[,1]),
function(gene.group.i) input.genes %in% gene.df[gene.df[,1]== gene.group.i,2]))
}

Hope it helps : )

Thanks!
Shuai

@tinyi
Copy link
Collaborator

tinyi commented Jun 22, 2022 via email

tinyi added a commit that referenced this issue Nov 4, 2022
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