Package Bio :: Package IntelliGenetics :: Module intelligenetics_format
[hide private]
[frames] | no frames]

Source Code for Module Bio.IntelliGenetics.intelligenetics_format

 1  # Copyright 2001 by Katharine Lindner.  All rights reserved. 
 2  # This code is part of the Biopython distribution and governed by its 
 3  # license.  Please see the LICENSE file that should have been included 
 4  # as part of this package. 
 5   
 6  """Martel regular expression for Intelligenetic format (DEPRECATED). 
 7   
 8  This is a huge regular regular expression for the IntelliGenetics/MASE format, 
 9  built using the 'regular expressions on steroids' capabilities of Martel. 
10  """ 
11  # standard library 
12  #http://immuno.bme.nwu.edu/seqhunt.html 
13  import string 
14   
15  # Martel 
16  import Martel 
17  from Martel import RecordReader 
18   
19  # --- first set up some helper constants and functions 
20  comment_line = Martel.Group( "comment_line", \ 
21                               Martel.Str( ';' ) + 
22                               Martel.ToEol( "comment" ) ) 
23  comment_lines = Martel.Group( "comment_lines", Martel.Rep( comment_line ) ) 
24  title_line = Martel.Group( "title_line", \ 
25      Martel.Expression.Assert( Martel.Str( ';' ), 1 ) + 
26      Martel.ToEol() ) 
27  residue_line = Martel.Group( "residue_line", \ 
28      Martel.Expression.Assert( Martel.Str( ';' ), 1 ) + 
29      Martel.ToEol( "sequence" ) ) 
30  residue_lines = Martel.Group( "residue_lines", Martel.Rep1( residue_line ) ) 
31  intelligenetics_record =  comment_lines + title_line + residue_lines 
32