Skip to content

Commit

Permalink
Update BuidTree.R
Browse files Browse the repository at this point in the history
Fix compatibility with Seurat v5
in SeuratLSIClustering
  • Loading branch information
chenweng1991 authored Oct 25, 2023
1 parent 9025fa6 commit 52e4c03
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/BuidTree.R
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,12 @@ setMethod(f="SeuratLSIClustering",
signature="redeemR",
definition=function(object,binary=T,res=0.6,lsidim=2:50,rmvariants=c("Variants310TC","Variants3109TC","Variants5764CT")){
require(Signac)
require(Seurat)
if(binary){
if (packageVersion("Seurat")>"4.9.9"){
print("Seurat5 is on, convert data structure to v4")
options(Seurat.object.assay.version = 'v4')
}
Cts.Mtx.bi<-as.matrix(object@Cts.Mtx.bi)
Cts.Mtx.bi<-Cts.Mtx.bi[,!colnames(Cts.Mtx.bi) %in% rmvariants]
Cts.Mtx.bi<-Cts.Mtx.bi[rowSums(Cts.Mtx.bi)>0,]
Expand Down Expand Up @@ -1649,4 +1654,4 @@ Clonal_Variants<-c(Clonal_Variants,list(stat))
}
names(Clonal_Variants)<-unique(meta$Clone_merge)
return(Clonal_Variants)
}
}

0 comments on commit 52e4c03

Please sign in to comment.