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

convert monolce3 into GeneSwitches #6

Open
junjunjing opened this issue Apr 23, 2021 · 5 comments
Open

convert monolce3 into GeneSwitches #6

junjunjing opened this issue Apr 23, 2021 · 5 comments

Comments

@junjunjing
Copy link

Hello,
I am new to GeneSwitches and I just started to learn how to import monocle3 instead of monocle2 as input for GeneSwitches. Is there a way to archive this? Thanks for your help.
Junjun

@seqyuan
Copy link

seqyuan commented Jun 9, 2021

我是这样做的:

# rds 为seurat对象,cds为monolce3对象
rds@meta.data$pseudotime <- cds@principal_graph_aux$UMAP$pseudotime
Seurat2GSsce <- function(Seuratrds, clusters){
    Seuratrds <- subset(Seuratrds, seurat_clusters %in% clusters)
    sce <- SingleCellExperiment(assays = List(expdata = Seuratrds@assays$RNA@data))
    colData(sce)$Pseudotime <- Seuratrds@meta.data$pseudotime
    UMAP <- Seuratrds@reductions$umap@cell.embeddings
    reducedDims(sce) <- SimpleList(UMAP = UMAP)
    return (sce)
}

# 根据monocle3的轨迹判断有两条发育路线
sce_p1 <- Seurat2GSsce(rds, c(11,4,13,10,2,1))
sce_p2 <- Seurat2GSsce(rds, c(11,4,13,12,15,6,5))

sce_p1 <- binarize_exp(sce_p1, ncores = 2)
sce_p2 <- binarize_exp(sce_p2, ncores = 2)
# 后面可以比较 sce_p1和sce_p2

但是我遇到的问题是binarize_exp运行步骤 总是被 Killed 任务退出,或者出现下面的错误

WARNING! NOT CONVERGENT! 
number of iterations= 1000 
Error in oupBinary$mu2 - oupBinary$mu1 : 
  non-numeric argument to binary operator
Calls: binarize_exp -> [ -> [.data.frame
In addition: Warning message:
In mclapply(rownames(LogCountsadd), function(iGene) { :
  scheduled core 1 encountered error in user code, all values of the job will be affected
Execution halted

@pushpinder-bu
Copy link

@junjunjing You found a way how to import monocle3 object?

@Jiayi-Zheng
Copy link

I tried the code from seqyuan and encountered:

> sce <- binarize_exp(sce, ncores = 2)
Error in `*tmp*`[oupBinary$lambda1 < 0.1, ] : 
  incorrect number of dimensions
In addition: Warning messages:
1: In mclapply(rownames(LogCountsadd), function(iGene) { :
  all scheduled cores encountered errors in user code
2: In oupBinary$passBinary <- TRUE : Coercing LHS to a list

@SheldonXu1999
Copy link

I tried the code from seqyuan and encountered:

> sce <- binarize_exp(sce, ncores = 2)
Error in `*tmp*`[oupBinary$lambda1 < 0.1, ] : 
  incorrect number of dimensions
In addition: Warning messages:
1: In mclapply(rownames(LogCountsadd), function(iGene) { :
  all scheduled cores encountered errors in user code
2: In oupBinary$passBinary <- TRUE : Coercing LHS to a list

I used to have the same problem, and setting the "fix_cutoff" parameter TRUE works for me.
sce_p1 <- binarize_exp(sce_p1, fix_cutoff = TRUE, binarize_cutoff = 0.2)

@SheldonXu1999
Copy link

我是这样做的:

# rds 为seurat对象,cds为monolce3对象
rds@meta.data$pseudotime <- cds@principal_graph_aux$UMAP$pseudotime
Seurat2GSsce <- function(Seuratrds, clusters){
    Seuratrds <- subset(Seuratrds, seurat_clusters %in% clusters)
    sce <- SingleCellExperiment(assays = List(expdata = Seuratrds@assays$RNA@data))
    colData(sce)$Pseudotime <- Seuratrds@meta.data$pseudotime
    UMAP <- Seuratrds@reductions$umap@cell.embeddings
    reducedDims(sce) <- SimpleList(UMAP = UMAP)
    return (sce)
}

# 根据monocle3的轨迹判断有两条发育路线
sce_p1 <- Seurat2GSsce(rds, c(11,4,13,10,2,1))
sce_p2 <- Seurat2GSsce(rds, c(11,4,13,12,15,6,5))

sce_p1 <- binarize_exp(sce_p1, ncores = 2)
sce_p2 <- binarize_exp(sce_p2, ncores = 2)
# 后面可以比较 sce_p1和sce_p2

但是我遇到的问题是binarize_exp运行步骤 总是被 Killed 任务退出,或者出现下面的错误

WARNING! NOT CONVERGENT! 
number of iterations= 1000 
Error in oupBinary$mu2 - oupBinary$mu1 : 
  non-numeric argument to binary operator
Calls: binarize_exp -> [ -> [.data.frame
In addition: Warning message:
In mclapply(rownames(LogCountsadd), function(iGene) { :
  scheduled core 1 encountered error in user code, all values of the job will be affected
Execution halted

I used to have the same problem shows
Error in oupBinary$mu2 - oupBinary$mu1 : non-numeric argument to binary operator,
and setting the "fix_cutoff" parameter TRUE works for me.
sce_p1 <- binarize_exp(sce_p1, fix_cutoff = TRUE, binarize_cutoff = 0.2)

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

5 participants