Closed KlausVigo closed 11 months ago
Hello Klaus, Sounds like a great idea! I had a quick look at the suggested additions. You propose
cl <- ifelse(inherits(x, "DNAbin"), "DNAbin", "AAbin")
and at then set the class of the returned object with class(x) <- cl
. That would "loose" composite classes (e.g., c("haplotype", "DNAbin")
as used in pegas). Why not have simply instead:
cl <- class(x)
Another thing is the internal function deleteGaps
which could be:
deleteGaps <- function(x, gapcode) {
i <- which(x == gapcode)
if (length(i)) x[-i] else x
}
Then we'll have something like this somewhere in the main body:
gapcode <- ifelse(inherits(x, "DNAbin"), 4, 45)
and add the additional argument each time the internal function is called. What do you think? Cheers, Emmanuel
Hi Emmanuel, all your your suggestion make total sense. I was just trying to fast subset some AA sequence and did some hacks without giving it too much thought. Cheers, Klaus
I've pushed a new version here (5.7-1.5) that should do it. Cheers, Emmanuel
Hello Emmanuel, small change to allow
del.gaps
,del.rowgapsonly
anddel.colgapsonly
also working onAAbin
objects. Regards, Klaus