adding new characters to matrix

9 views
Skip to first unread message

László Nagy

unread,
Sep 11, 2012, 9:33:30 AM9/11/12
to bio-...@googlegroups.com
Hi,

this sort of a is a follow-up on a previous conversation on how to add annotations to characters (in nexml, https://groups.google.com/forum/?fromgroups=#!topic/bio-phylo/b2xDbT2dxHo). Thanks to Rutger's example script (http://biophylo.blogspot.com/2012/05/reading-and-writing-complex-character.html), it is now clear how to add annotations, but what if I want to add new characters to the matrix? I have two options at this point. One is to create the matrix (I am generating characters one by one through simulation), write the matrix to a readable format using my own package (e.g. nexus) and try to parse it later in an other script using Bio::Phylo (and add annotations). The other option would be to add characters one by one to a Bio::Phylo matrix as I the simulation goes, write it to file as neXML and parse this neXML file by the next script (I need to write and re-parse the matrix anyway). The latter would be more elegant and maybe more bulletproof. I may miss something here, but I cant figure out how to add new characters to a matrix.

Thanks,
Laszlo Nagy

Rutger Vos

unread,
Sep 12, 2012, 5:16:05 AM9/12/12
to bio-...@googlegroups.com
Hi László,

the list of characters is automatically updated as the matrix
grows/shrinks. This is done by means of a listener subroutine:
Bio::Phylo::Matrices::Matrix::_update_characters()

As for your second question, I would recommend staying within NeXML if
you want to preserve annotations that cannot be serialized to NEXUS.

Best wishes,

Rutger
> --
> You received this message because you are subscribed to the Google Groups
> "bio-phylo" group.
> To post to this group, send email to bio-...@googlegroups.com.
> To unsubscribe from this group, send email to
> bio-phylo+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/bio-phylo?hl=en.



--
Dr. Rutger A. Vos
Bioinformaticist
NCB Naturalis
Visiting address: Office A109, Einsteinweg 2, 2333 CC, Leiden, the Netherlands
Mailing address: Postbus 9517, 2300 RA, Leiden, the Netherlands
http://rutgervos.blogspot.com
Reply all
Reply to author
Forward
0 new messages