[Biopython-dev] need some advice regarding martel

Andreas Kuntzagk andreas.kuntzagk at mdc-berlin.de
Wed Sep 10 08:01:09 EDT 2003


Hi,

I've got some problem with the genbank changes a wanted to make.

In genbank.format I have following lines:
-----
primary_line = Martel.Group("primary_line",
                            Martel.Str("PRIMARY") +
                            blank_space +
                            Martel.Str("TPA_SPAN") +
                            blank_space +
                            Martel.Str("PRIMARY_IDENTIFIER") +
                            blank_space +
                            Martel.Str("PRIMARY_SPAN") +
                            blank_space +
                            Martel.Str("COMP") + 
                            Martel.AnyEol())

primary_ref_line =Martel.Group("primary_ref_line",
                               blank_space +
                               Martel.Re(r"\d+\-\d+")
+                         
                               blank_space +
                               Martel.Re("[\S]+") +
                               blank_space +
                               Martel.Re("\d+\-\d+")+
                               Martel.Opt(blank_space + 
Martel.Str("c"))+
                               Martel.AnyEol())
                              
primary =  Martel.Group("primary",primary_line +
                        Martel.Rep(primary_ref_line))
                                       

------
So primary_line is the line starting the whole PRIMARY-block,
primary_ref_line should be _one_ line with the actual data
and primary the combination of the two.

BUT:
In my consumer in the method primary_ref_line(self,content) content has
the data for all of the lines (except the starting "PRIMARY" line) in
one string without any newline. 

Where is my error?

At least the parser doesn't choke on this lines anymore but wouldn't it
be good, if it would extract this information?

Andreas




More information about the Biopython-dev mailing list