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. 
 7   
 8  http://hiv-web.lanl.gov/ALIGN_97/HIV12SIV-index.html 
 9  """ 
10  # standard library 
11  #http://immuno.bme.nwu.edu/seqhunt.html 
12  import string 
13   
14  # Martel 
15  import Martel 
16  from Martel import RecordReader 
17   
18  # --- first set up some helper constants and functions 
19  comment_line = Martel.Group( "comment_line", \ 
20                               Martel.Str( ';' ) + 
21                               Martel.ToEol( "comment" ) ) 
22  comment_lines = Martel.Group( "comment_lines", Martel.Rep( comment_line ) ) 
23  title_line = Martel.Group( "title_line", \ 
24      Martel.Expression.Assert( Martel.Str( ';' ), 1 ) + 
25      Martel.ToEol() ) 
26  residue_line = Martel.Group( "residue_line", \ 
27      Martel.Expression.Assert( Martel.Str( ';' ), 1 ) + 
28      Martel.ToEol( "sequence" ) ) 
29  residue_lines = Martel.Group( "residue_lines", Martel.Rep1( residue_line ) ) 
30  intelligenetics_record =  comment_lines + title_line + residue_lines 
31