You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have 1000 sequences which I align them with DECIPHER packages AlignSeqs() function.
Then I try to convert it phyDat object using phyDat() function and run a ML based method to create a phylogenetic tree. Code is attached below. I think the error is with convertion of DECIPHER::AlignSeqs() output which is AAStringSet to phyDat object.
fastaDecipherAligned <- DECIPHER::AlignSeqs(fastaRefined62)
save(fastaDecipherAligned, file = 'fastaDecipherAligned.RData')
fastaphyDat <- phyDat(as(fastaDecipherAligned, 'matrix'), type = 'AA') ## Guessing this is not working
rm(fastaDecipherAligned)
names(fastaphyDat) <- homologySummary62[1:length(fastaphyDat),]$SequenceFullName
dm <- dist.ml(fastaphyDat, model="JTT")
tree <- NJ(dm)
## cat('Testing all models ...\n')
## (mt <- modelTest(fastaphyDat, model="all", multicore=multiCoreBool))
## env <- attr(mt, "env")
## fitStart <- eval(get(mt$Model[which.min(mt$BIC)], env), env)
## fitNJ <- pml(tree, fastaphyDat, model=fitStart$model, k=4, inv=.2)
fitNJ <- pml(tree, fastaphyDat, model = 'JTT', k=4, inv=.2)
fit <- optim.pml(fitNJ, rearrangement = "stochastic",
optInv=TRUE, optGamma=TRUE)
fit
## Code truncated and also commented out modelTest as it also returned memory not mapped error
The code is run on the server and the following is the complete output.
nohup: ignoring input
Loading required package: methods
Loading required package: BiocGenerics
Loading required package: parallel
Attaching package: ‘BiocGenerics’
The following objects are masked from ‘package:parallel’:
clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
clusterExport, clusterMap, parApply, parCapply, parLapply,
parLapplyLB, parRapply, parSapply, parSapplyLB
The following objects are masked from ‘package:stats’:
IQR, mad, sd, var, xtabs
The following objects are masked from ‘package:base’:
anyDuplicated, append, as.data.frame, cbind, colMeans, colnames,
colSums, do.call, duplicated, eval, evalq, Filter, Find, get, grep,
grepl, intersect, is.unsorted, lapply, lengths, Map, mapply, match,
mget, order, paste, pmax, pmax.int, pmin, pmin.int, Position, rank,
rbind, Reduce, rowMeans, rownames, rowSums, sapply, setdiff, sort,
table, tapply, union, unique, unsplit, which, which.max, which.min
Loading required package: S4Vectors
Loading required package: stats4
Attaching package: ‘S4Vectors’
The following object is masked from ‘package:base’:
expand.grid
Loading required package: IRanges
Loading required package: XVector
Attaching package: ‘Biostrings’
The following object is masked from ‘package:base’:
strsplit
Attaching package: ‘seqinr’
The following object is masked from ‘package:Biostrings’:
translate
Attaching package: ‘ape’
The following objects are masked from ‘package:seqinr’:
as.alignment, consensus
The following object is masked from ‘package:Biostrings’:
complement
Attaching package: ‘rphast’
The following object is masked from ‘package:ape’:
complement
The following object is masked from ‘package:msa’:
msa
The following object is masked from ‘package:Biostrings’:
complement
Loading required package: RSQLite
Loading required package: ggplot2
Loading required package: treeio
Attaching package: ‘treeio’
The following object is masked from ‘package:phangorn’:
getRoot
The following objects are masked from ‘package:ape’:
drop.tip, Nnode, Ntip
The following object is masked from ‘package:Biostrings’:
mask
ggtree v1.10.5 For help: https://guangchuangyu.github.io/ggtree
If you use ggtree in published research, please cite:
Guangchuang Yu, David Smith, Huachen Zhu, Yi Guan, Tommy Tsan-Yuk Lam. ggtree: an R package for visualization and annotation of phylogenetic trees with their covariates and other associated data. Methods in Ecology and Evolution 2017, 8(1):28-36, doi:10.1111/2041-210X.12628
Attaching package: ‘ggtree’
The following object is masked from ‘package:ape’:
rotate
The following object is masked from ‘package:Biostrings’:
collapse
The following object is masked from ‘package:IRanges’:
collapse
The following object is masked from ‘package:S4Vectors’:
expand
negative edges length changed to 0!
*** caught segfault ***
address 0x2616e4c0, cause 'memory not mapped'
Traceback:
1: .Call("PML0", dlist = data, el, as.double(g), nr, nc, k, eig, as.double(bf), node, edge, nTips, nco, contrast, N = as.integer(length(edge)))
2: pml.fit(tree, data, bf, shape = shape, k = k, Q = Q, levels = attr(data, "levels"), inv = inv, rate = rate, g = g, w = w, eig = eig, INV = INV, ll.0 = ll.0, llMix = llMix, wMix = wMix, site = TRUE)
3: pml(tree, fastaphyDat, model = "JTT", k = 4, inv = 0.2)
4: phylogeneticTreeCreate(homologySummary = homologyResults, uniprot.db = "uniprot_sprot.fasta", numberOfSeq = 1000, multiCoreBool = TRUE, useExistingAlignment = TRUE, alignmentType = "DECIPHER")
An irrecoverable exception occurred. R is aborting now ...
[1] "mtArt+G"
*** caught segfault ***
address 0x1005c5ac0, cause 'memory not mapped'
Traceback:
1: pml.fit(tree, data, bf, shape = shape, k = k, Q = Q, levels = attr(data, "levels"), inv = inv, rate = rate, g = g, w = w, eig = eig, INV = INV, ll.0 = ll.0, llMix = llMix, wMix = wMix, site = TRUE)
2: update.pml(fittmp, k = k)
3: update(fittmp, k = k)
4: FUN(X[[i]], ...)
5: lapply(X = S, FUN = FUN, ...)
6: doTryCatch(return(expr), name, parentenv, handler)
7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
8: tryCatchList(expr, classes, parentenv, handlers)
9: tryCatch(expr, error = function(e) { call <- conditionCall(e) if (!is.null(call)) { if (identical(call[[1L]], quote(doTryCatch))) call <- sys.call(-4L) dcall <- deparse(call)[1L] prefix <- paste("Error in", dcall, ": ") LONG <- 75L msg <- conditionMessage(e) sm <- strsplit(msg, "\n")[[1L]] w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") if (is.na(w)) w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], type = "b") if (w > LONG) prefix <- paste0(prefix, "\n ") } else prefix <- "Error : " msg <- paste0(prefix, conditionMessage(e), "\n") .Internal(seterrmessage(msg[1L])) if (!silent && identical(getOption("show.error.messages"), TRUE)) { cat(msg, file = outFile) .Internal(printDeferredWarnings()) } invisible(structure(msg, class = "try-error", condition = e))})
10: try(lapply(X = S, FUN = FUN, ...), silent = TRUE)
11: sendMaster(try(lapply(X = S, FUN = FUN, ...), silent = TRUE))
12: FUN(X[[i]], ...)
13: lapply(seq_len(cores), inner.do)
14: mclapply(model, fitPar, fit, G, I, k, FREQ, mc.cores = mc.cores)
15: modelTest(fastaphyDat, model = "all", multicore = multiCoreBool)
16: phylogeneticTreeCreate(homologySummary = homologyResults, uniprot.db = "uniprot_sprot.fasta", numberOfSeq = 1000, multiCoreBool = TRUE, useExistingAlignment = TRUE, alignmentType = "DECIPHER")
An irrecoverable exception occurred. R is aborting now ...
[1] "HIVw+G"
*** caught segfault ***
address 0x1005c5ac0, cause 'memory not mapped'
Traceback:
1: pml.fit(tree, data, bf, shape = shape, k = k, Q = Q, levels = attr(data, "levels"), inv = inv, rate = rate, g = g, w = w, eig = eig, INV = INV, ll.0 = ll.0, llMix = llMix, wMix = wMix, site = TRUE)
2: update.pml(fittmp, k = k)
3: update(fittmp, k = k)
4: FUN(X[[i]], ...)
5: lapply(X = S, FUN = FUN, ...)
6: doTryCatch(return(expr), name, parentenv, handler)
7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
8: tryCatchList(expr, classes, parentenv, handlers)
9: tryCatch(expr, error = function(e) { call <- conditionCall(e) if (!is.null(call)) { if (identical(call[[1L]], quote(doTryCatch))) call <- sys.call(-4L) dcall <- deparse(call)[1L] prefix <- paste("Error in", dcall, ": ") LONG <- 75L msg <- conditionMessage(e) sm <- strsplit(msg, "\n")[[1L]] w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") if (is.na(w)) w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], type = "b") if (w > LONG) prefix <- paste0(prefix, "\n ") } else prefix <- "Error : " msg <- paste0(prefix, conditionMessage(e), "\n") .Internal(seterrmessage(msg[1L])) if (!silent && identical(getOption("show.error.messages"), TRUE)) { cat(msg, file = outFile) .Internal(printDeferredWarnings()) } invisible(structure(msg, class = "try-error", condition = e))})
10: try(lapply(X = S, FUN = FUN, ...), silent = TRUE)
11: sendMaster(try(lapply(X = S, FUN = FUN, ...), silent = TRUE))
12: FUN(X[[i]], ...)
13: lapply(seq_len(cores), inner.do)
14: mclapply(model, fitPar, fit, G, I, k, FREQ, mc.cores = mc.cores)
15: modelTest(fastaphyDat, model = "all", multicore = multiCoreBool)
16: phylogeneticTreeCreate(homologySummary = homologyResults, uniprot.db = "uniprot_sprot.fasta", numberOfSeq = 1000, multiCoreBool = TRUE, useExistingAlignment = TRUE, alignmentType = "DECIPHER")
An irrecoverable exception occurred. R is aborting now ...
Error in x[[jj]][iseq] <- vjj : replacement has length zero
Calls: phylogeneticTreeCreate -> modelTest -> [<- -> [<-.data.frame
Execution halted
Hi @alptaciroglu,
I can't really make a call what is going wrong without the data. Can you send me the data or provide me with a link where I can download them.
Regards,
Klaus
Thank you so much for your email. I am adding a link for the data for download in .RData format. First code chunk in OP is how I tried to proceed with. (Out of topic note: I could use other packages but somehow only decipher package seemed to align my sequences)
Hello,
I have 1000 sequences which I align them with DECIPHER packages AlignSeqs() function.
Then I try to convert it phyDat object using phyDat() function and run a ML based method to create a phylogenetic tree. Code is attached below. I think the error is with convertion of DECIPHER::AlignSeqs() output which is AAStringSet to phyDat object.
The code is run on the server and the following is the complete output.
sessionInfo
The text was updated successfully, but these errors were encountered: