Gitlab is now using https://gitlab.lcsb.uni.lu as it's primary address. Please update your bookmarks. FAQ.

Commit aa67e6fe authored by heintzbu's avatar heintzbu
Browse files

cursed recursion

parent 4ea333c9
Pipeline #27461 failed with stages
in 0 seconds
......@@ -257,6 +257,7 @@ find.cutoff <- function(data,k=2,proba=0.5) {
}
muClus <- function(clusterName,cRes,resFile,recDepth){
print(recDepth)
covcol <- which(colnames(contigInfo)=="MG_depth")
dInfo <- contigInfo[cRes$cluster==clusterName,]
if(dip.test(log10(1+dInfo[,covcol][dInfo$essentialGene!="notEssential"]))$p.value<0.05){
......@@ -269,10 +270,11 @@ muClus <- function(clusterName,cRes,resFile,recDepth){
cRes$cluster[cRes$contig %in% subs1$contig] <- paste(gsub("D","E",cRes$cluster[cRes$contig %in% subs1$contig]),1,sep=".")
} else if(num1/uni1<=1.2){
cRes$cluster[cRes$contig %in% subs1$contig] <- paste(gsub("D","C",cRes$cluster[cRes$contig %in% subs1$contig]),1,sep=".")
} else if(recDepth <= 10){
} else if(recDepth < 900){
cRes$cluster[cRes$contig %in% subs1$contig] <- paste(cRes$cluster[cRes$contig %in% subs1$contig],1,sep=".")
cRes <- muClus(unique(cRes$cluster[cRes$contig %in% subs1$contig]),cRes,resFile,recDepth+1)
print(recDepth)
}else{
cRes$cluster[cRes$contig %in% subs1$contig] <- paste(gsub("D","B",cRes$cluster[cRes$contig %in% subs1$contig]),1,sep=".")
}
subs2 <- dInfo[log10(1+dInfo[,covcol])>=cuto,]
num2 <- length(unlist(sapply(subs2$essentialGene[subs2$essentialGene!="notEssential"],function(x) unlist(strsplit(x,split=";")))))
......@@ -281,10 +283,11 @@ muClus <- function(clusterName,cRes,resFile,recDepth){
cRes$cluster[cRes$contig %in% subs2$contig] <- paste(gsub("D","E",cRes$cluster[cRes$contig %in% subs2$contig]),2,sep=".")
} else if(num2/uni2<=1.2){
cRes$cluster[cRes$contig %in% subs2$contig] <- paste(gsub("D","C",cRes$cluster[cRes$contig %in% subs2$contig]),2,sep=".")
} else if(recDepth <= 10){
} else if(recDepth < 900){
cRes$cluster[cRes$contig %in% subs2$contig] <- paste(cRes$cluster[cRes$contig %in% subs2$contig],2,sep=".")
cRes <- muClus(unique(cRes$cluster[cRes$contig %in% subs2$contig]),cRes,resFile,recDepth+1)
print(recDepth)
} else{
cRes$cluster[cRes$contig %in% subs2$contig] <- paste(gsub("D","B",cRes$cluster[cRes$contig %in% subs2$contig]),2,sep=".")
}
} else {
cRes$cluster[cRes$contig %in% dInfo$contig] <- gsub("^.","B",cRes$cluster[cRes$contig %in% dInfo$contig])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment