Graph Data Structures

John Machin sjmachin at lexicon.net
Sat Nov 25 18:52:51 EST 2006


Nathan Harmston wrote:
> Hi,
>
> The idea is that I m going to use it to build graphs for sequence
> alignment (at the moment), I read a discussion on the corebio
> (reimplementation of biopython) group about using intervals to
> represent sequence slices. The idea being that, my graph may contain
> millions of alignments and storing the sequence (the actual ATGC) is
> not required.
>
> class Node(object):
>      pass
>
> class Interval(Node):
>     _id = "gene1"
>      _start = 50
>     _end = 200
>     _strand = 1

What is the point of subclassing Node if it's just a dummy?

>
> class Sequence(object):
>     _sequence = "atgtcgtgagagagagttgtgag................."
>
> So one interval on one sequence would align to another interval from
> another sequence, but I want changes I make to the interval to be
> reflected in the representation later. If I reverse complement it i
> want the interval to store this information but the Sequence only
> shows this later on when I call use it calling repr or str.
>
> Do you get what I mean.

Only vaguely. You use several terms which appear to be from your trade
jargon as they are not understandable when interpreted in either the
context of Python-speak or ordinary English e.g. "sequence",
"alignment", "ATGC", "reverse complement", "interval".

Two options:
(a) communicate understandably
(b) wait till your wontoks are back from holidays.




More information about the Python-list mailing list