-
Notifications
You must be signed in to change notification settings - Fork 45
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
Comments
Hi Shuai,
Thank you very much for your catch. It is fixed now.
Best,
Tinyi
…On Wed, Jun 22, 2022 at 4:42 AM SG-ShuaiGuo ***@***.***> wrote:
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
—
Reply to this email directly, view it on GitHub
<#1>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB4NHSZFJUICEEBUPKLIYUDVQLGYLANCNFSM5ZPL5ZUA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
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
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
The text was updated successfully, but these errors were encountered: