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 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("-"))
> Cheers,
> Emmanuel
> 
> Le 2 Nov 21, à 19:23, Vojtěch Zeisek vo...@trapa.cz a écrit :
> > 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 attaching one example (I have almost 1000 of them, so I'd like
> > to avoid to edit all of them manually:-).
> > Sincerely,
> > V.
> > 
> > Dne úterý 2. listopadu 2021 12:36:53 CET jste napsal(a):
> >> 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 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(), but it didn't lead to success. I haven't found
> >> > any other way how to trim protein alignment in R similar to what
> >> > these two function do. Is there any way?
> >> > Sincerely,
> >> > V.
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/
https://lab-allience.natur.cuni.cz/
https://botany.natur.cuni.cz/brassiploidy/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
https://www.ibot.cas.cz/en/
Computing cluster
https://sorbus.ibot.cas.cz/en/start


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


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("-"))

Cheers,
Emmanuel

- Le 2 Nov 21, à 19:23, Vojtěch Zeisek vo...@trapa.cz a écrit :

> 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 attaching one example (I have
> almost 1000 of them, so I'd like to avoid to edit all of them manually:-).
> Sincerely,
> V.
> 
> Dne úterý 2. listopadu 2021 12:36:53 CET jste napsal(a):
>> 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 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(), but it didn't lead to success. I haven't found
>> > any other way how to trim protein alignment in R similar to what
>> > these two function do. Is there any way?
>> > Sincerely,
>> > V.
> --
> Vojtěch Zeisek
> https://trapa.cz/en/
> 
> Department of Botany, Faculty of Science
> Charles University, Prague, Czech Republic
> https://www.natur.cuni.cz/biology/botany/
> https://lab-allience.natur.cuni.cz/
> 
> Institute of Botany, Czech Academy of Sciences
> Průhonice, Czech Republic
> https://www.ibot.cas.cz/en/
> Computing cluster
> https://sorbus.ibot.cas.cz/en/start
> 
> ___
> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


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 attaching one example (I have 
almost 1000 of them, so I'd like to avoid to edit all of them manually:-).
Sincerely,
V.

Dne úterý 2. listopadu 2021 12:36:53 CET jste napsal(a):
> 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 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(), but it didn't lead to success. I haven't found
> > any other way how to trim protein alignment in R similar to what
> > these two function do. Is there any way?
> > Sincerely,
> > V.
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/
https://lab-allience.natur.cuni.cz/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
https://www.ibot.cas.cz/en/
Computing cluster
https://sorbus.ibot.cas.cz/en/start
>Musa
MFSSFSSSGDPSLHHPEFCSATSPQGLFPDANSAFPSSSPPCTSFSSESYLHTHSLPFHHHYIPDSLNQPLYSSSPCDYLDFNAGPVRRVLSTGNLQGGNGLHENSSQEGGVAGKVGRYSAEERKERIERYRSKRNQRNFHKKITYECRKTLADSRPRVRGRFARNGETETEAAVEMETGTDTGAAAVNCFDNYEQNQLGGNGSDCWRQLQAALAMDDEDEYSYDEEFLASFSDFYSMNTL
>C1
HPPYCDYLDFKAGPVRR
>C2
CDYLDFHAAPVR-
>C3
-YFDWSIGAHSRPLHHHIA--ELIYPTYSSSPCDYLDFNAEPVRR
>C4
-YFDGSISAHSRPLHHHVA--ELIYPTYSSSPCDYLDFNAEPVRR
>C5
CDYLDFHAAPVR-
>C6
-YFDGSISAHSRPLHHHVA--ELIYPTYSSSPCDYLDFNAEPVRR
>C7
CDYLDFHAAPVR-


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


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
> 
> > On 2. Nov 2021, at 11:38, Vojtěch Zeisek wrote:
> > 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(), but it didn't lead to success. I haven't found
> > any other way how to trim protein alignment in R similar to what
> > these two function do. Is there any way?
> > Sincerely,
> > V.
-- 
Vojtěch Zeisek
https://trapa.cz/en/

Department of Botany, Faculty of Science
Charles University, Prague, Czech Republic
https://www.natur.cuni.cz/biology/botany/
https://lab-allience.natur.cuni.cz/

Institute of Botany, Czech Academy of Sciences
Průhonice, Czech Republic
https://www.ibot.cas.cz/en/
Computing cluster
https://sorbus.ibot.cas.cz/en/start


signature.asc
Description: This is a digitally signed message part.
___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/


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 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(), but it didn't
> lead to success. I haven't found any other way how to trim protein alignment
> in R similar to what these two function do. Is there any way?
> Sincerely,
> V.
> 
> --
> Vojtěch Zeisek
> https://trapa.cz/en/
> 
> Department of Botany, Faculty of Science
> Charles University, Prague, Czech Republic
> https://www.natur.cuni.cz/biology/botany/
> https://lab-allience.natur.cuni.cz/
> 
> Institute of Botany, Czech Academy of Sciences
> Průhonice, Czech Republic
> https://www.ibot.cas.cz/en/
> Computing cluster
> https://sorbus.ibot.cas.cz/en/start
> 
> ___
> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

___
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/