Re: [R-sig-phylo] Trimming protein alignment

2021-11-03 Thread Vojtěch Zeisek
Yes! Thank You, Emmanuel! This works perfectly. In same way I edited also del.rowgapsonly() Sincerely, V. Dne úterý 2. listopadu 2021 15:12:47 CET, Emmanuel Paradis napsal(a): > Ha! That's because gaps are coded with dashes in your files; I assumed > it was X's (as returned by ape::trans). So

Re: [R-sig-phylo] Trimming protein alignment

2021-11-02 Thread Emmanuel Paradis
Ha! That's because gaps are coded with dashes in your files; I assumed it was X's (as returned by ape::trans). So this line 7 should be: foo <- function(x) sum(x == 0x58 | x == 0x2d) Or (probably easier to modify): foo <- function(x) sum(x == charToRaw("X") | x == charToRaw("-"))

Re: [R-sig-phylo] Trimming protein alignment

2021-11-02 Thread Vojtěch Zeisek
Thank You, Emmanuel, I thought I must do something with line 7, but I had no idea what. :-) Unfortunately it didn't work. I still get "All sequences of the same length: 249" after running the edited function as 'aln.ng <- del.colgapsonly(x=aln, threshold=0.25, freq.only=FALSE)'... :-( I'm

Re: [R-sig-phylo] Trimming protein alignment

2021-11-02 Thread Vojtěch Zeisek
Hello, thank You, but it seems that trimEnds() requires DNAbin. I checked also other functions from ips, and it seems to be the same... Sincerely, V. Dne úterý 2. listopadu 2021 12:13:06 CET jste napsal(a): > Dear Vojtech, > Did you check this https://rdrr.io/cran/ips/man/trimEnds.html > Franz >

Re: [R-sig-phylo] Trimming protein alignment

2021-11-02 Thread Emmanuel Paradis
Hi Vojtěch, In addition to removing lines 3 and 4, replace line 7: foo <- function(x) sum(x == 4) by: foo <- function(x) sum(x == 0x58) That sh(c)ould do it. Best, Emmanuel - Le 2 Nov 21, à 17:37, Vojtěch Zeisek vo...@trapa.cz a écrit : > Hello, > I try to trim protein

[R-sig-phylo] Trimming protein alignment

2021-11-02 Thread Vojtěch Zeisek
Hello, I try to trim protein alignments in R. I see del.colgapsonly() and del.rowgapsonly() from ape can trim only class DNAbin. As DNAbin as basically same matrix as AAbin (Isn't it?), I thought it should be easy. I commented out lines 3 and 4 in both del.colgapsonly() and del.rowgapsonly(),