Reading character matrices into memory one by one

7 views
Skip to first unread message

Markus Englund

unread,
Nov 8, 2015, 5:42:50 AM11/8/15
to DendroPy Users
Hi,

Is there some way to read and process multiple character matrices in a file one by one so I don't have to load them all into memory at the same time?

The pseudocode might look something like this:

Open the input file for reading
Read character matrix 1 into memory
Process character matrix 1
Read character matrix 2 into memory
Process character matrix 2
Close the input file

Cheers,
Markus

Jeet Sukumaran

unread,
Nov 9, 2015, 10:23:12 AM11/9/15
to dendrop...@googlegroups.com
This would definitely be useful and can be implemented. However this
would have to be done at the parser level, and thus each file format
would need to have a different implementation. I presume you mean for
NEXUS or NeXML format, as neither Phylip nor FASTA standards specify
multiple alignments in their standard?
> --
> You received this message because you are subscribed to the Google
> Groups "DendroPy Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to dendropy-user...@googlegroups.com
> <mailto:dendropy-user...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.

--



--------------------------------------
Jeet Sukumaran
--------------------------------------
jeetsu...@gmail.com
--------------------------------------
Blog/Personal Pages:
http://jeetworks.org/
GitHub Repositories:
http://github.com/jeetsukumaran
Photographs (as stream):
http://www.flickr.com/photos/jeetsukumaran/
Photographs (by galleries):
http://www.flickr.com/photos/jeetsukumaran/sets/
--------------------------------------

Markus Englund

unread,
Nov 9, 2015, 12:45:26 PM11/9/15
to DendroPy Users
Sounds great! I was primarily thinking of the NEXUS format in my case. I suppose it could also be implemented for the Phylip format, even if the standard does not specify multiple matrices. I know that for example PhyML do read multiple alignments in that format.

Best,
Markus

Jeet Sukumaran

unread,
Nov 9, 2015, 12:48:19 PM11/9/15
to dendrop...@googlegroups.com
I think it would be valid to support this feature in NEXUS. I would not
be so enthusiastic about Phylip because it mean introducing an arbitrary
non-standard convention to describe the multiple matrices.

So, the good news is "yes, we can". The bad news is that I cannot
promise when it will happen! If you don't mind submitting an issue on
the github page, I can promise that it will make the "todo" list,
though. Which is the best I can promise right now :)
> > an email to dendropy-user...@googlegroups.com <javascript:>
> > <mailto:dendropy-user...@googlegroups.com <javascript:>>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
> --
>
>
>
> --------------------------------------
> Jeet Sukumaran
> --------------------------------------
> jeetsu...@gmail.com <javascript:>
> --------------------------------------
> Blog/Personal Pages:
> http://jeetworks.org/
> GitHub Repositories:
> http://github.com/jeetsukumaran <http://github.com/jeetsukumaran>
> <http://www.flickr.com/photos/jeetsukumaran/sets/>
> --------------------------------------
>
> --
> You received this message because you are subscribed to the Google
> Groups "DendroPy Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to dendropy-user...@googlegroups.com
> <mailto:dendropy-user...@googlegroups.com>.

Markus Englund

unread,
Nov 9, 2015, 1:27:41 PM11/9/15
to DendroPy Users
NEXUS format will be just fine! I understand that time is limited. I'll create a feature request on GitHub.
Markus
>      > <mailto:dendropy-users+unsub...@googlegroups.com <javascript:>>.
>      > For more options, visit https://groups.google.com/d/optout
>     <https://groups.google.com/d/optout>.
>
>     --
>
>
>
>     --------------------------------------
>     Jeet Sukumaran
>     --------------------------------------
>     jeetsu...@gmail.com <javascript:>
>     --------------------------------------
>     Blog/Personal Pages:
>     http://jeetworks.org/
>     GitHub Repositories:
>     http://github.com/jeetsukumaran <http://github.com/jeetsukumaran>
>     Photographs (as stream):
>     http://www.flickr.com/photos/jeetsukumaran/
>     <http://www.flickr.com/photos/jeetsukumaran/>
>     Photographs (by galleries):
>     http://www.flickr.com/photos/jeetsukumaran/sets/
>     <http://www.flickr.com/photos/jeetsukumaran/sets/>
>     --------------------------------------
>
> --
> You received this message because you are subscribed to the Google
> Groups "DendroPy Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to dendropy-user...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages