Permalink
Browse files

Removing Bio.ECell which was deprecated in Biopython 1.47 (also added…

… missing trailing periods in DEPRECATED file)
  • Loading branch information...
1 parent edb3ac6 commit bbfff83bd745b89eb3fc1f91e720ff120159110c @peterjc peterjc committed Oct 1, 2008
Showing with 23 additions and 800 deletions.
  1. +0 −275 Bio/ECell/Record.py
  2. +0 −409 Bio/ECell/__init__.py
  3. +0 −92 Bio/ECell/ecell_format.py
  4. +23 −23 DEPRECATED
  5. +0 −1 setup.py
View
275 Bio/ECell/Record.py
@@ -1,275 +0,0 @@
-# Copyright 2001 by Katharine Lindner. All rights reserved.
-# This code is part of the Biopython distribution and governed by its
-# license. Please see the LICENSE file that should have been included
-# as part of this package.
-
-"""Martel based parser to read ECell formatted files.
-
-This is a huge regular regular expression for Ecell, built using
-the 'regular expressiona on steroids' capabilities of Martel.
-
-#http://www.bioinformatics.org/ecell2/
-
-
-
-Notes:
-Just so I remember -- the new end of line syntax is:
- New regexp syntax - \R
- \R means "\n|\r\n?"
- [\R] means "[\n\r]"
-
-This helps us have endlines be consistent across platforms.
-
-"""
-# standard library
-import string
-
-
-
-
-
-"""Hold ECell data in a straightforward format.
-
-classes:
-o Record - All of the information in an ECell record.
-"""
-
-class Record:
- """Hold ECell information in a format similar to the original record.
-
-
- """
- def __init__(self):
- self.cell_dict = {}
- self._max_dict = {}
- self._duplicates = []
- self._ecell_version = '0.9.4.6'
- self._name = 'Ecell module'
- self._version = ''
- self.include_buf = ''
- self.num_systems = 0
- self.num_substances = 0
- self.num_reactors = 0
- self.include_block = ''
- self.contains_concentration = 0
-
-
- def __str__( self ):
- output = '# this is ecell rule file for E-CELL' + self._ecell_version + '\n'
- output = output + '# converted by %s %s\n\n' % ( self._name, self._version )
- if( self.contains_concentration ):
- output = output + 'include(qty.er)\n'
- output = output + self.include_buf
- system_output = self._print_systems()
- substance_output = self._print_substances()
- reactor_output = self._print_reactors( substance_output )
- output = output + system_output + reactor_output
- return output
-
- def _print_systems( self ):
- output = ''
- for system in range( 1, self.num_systems + 1 ):
- composite_key = 'system' + str( system ) + 'class0'
- output = output + '\nsystem %s' % self.cell_dict[ composite_key ]
- composite_key = 'system' + str( system ) + 'path0'
- output = output + '(%s:' % self.cell_dict[ composite_key ]
- composite_key = 'system' + str( system ) + 'id0'
- output = output + '%s,' % self.cell_dict[ composite_key ]
- composite_key = 'system' + str( system ) + 'name0'
- output = output + '"%s")\n' % self.cell_dict[ composite_key ]
- output = output + '{\n'
-
- output = output + '\tStepper SlaveStepper;\n'
- composite_key = 'system' + str( system ) + 'inside0'
- if( self.cell_dict.has_key( composite_key ) ):
- output = output + '\tInside %s;\n' % self.cell_dict[ composite_key ]
- composite_key = 'system' + str( system ) + 'outside0'
- if( self.cell_dict.has_key( composite_key ) ):
- output = output + '\tOutside %s;\n' % self.cell_dict[ composite_key ]
- composite_key = 'system' + str( system ) + 'volumeindex0'
- if( self.cell_dict.has_key( composite_key ) ):
- output = output + '\tVolumeIndex %s;\n' % self.cell_dict[ composite_key ]
- output = output + '}\n'
- return output
-
- def _print_substances( self ):
- output = ''
- for substance in range( 1, self.num_substances + 1 ):
- composite_key = 'substance' + str( substance ) + 'class0'
- if( self.cell_dict.has_key( composite_key ) ):
- output = output + 'substance %s' % self.cell_dict[ composite_key ]
- composite_key = 'substance' + str( substance ) + 'path0'
- output = output + '(%s:' % get_entry( self.cell_dict, composite_key )
- composite_key = 'substance' + str( substance ) + 'id0'
- output = output + '%s,' % get_entry( self.cell_dict, composite_key )
- composite_key = 'substance' + str( substance ) + 'name0'
- output = output + '"%s")\n' % get_entry( self.cell_dict, composite_key )
- composite_key = 'substance' + str( substance ) + 'qty0'
- output = output + '{\n\tQuantity %s;\n}\n' % get_entry( self.cell_dict, composite_key )
- else:
- composite_key = 'substance' + str( substance ) + 'path0'
- output = output + 'substance %s:' % get_entry( self.cell_dict, composite_key )
- composite_key = 'substance' + str( substance ) + 'id0'
- output = output + '%s ' % get_entry( self.cell_dict, composite_key )
- composite_key = 'substance' + str( substance ) + 'name0'
- output = output + '"%s" ' % get_entry( self.cell_dict, composite_key )
- composite_key = 'substance' + str( substance ) + 'qty0'
- output = output + '%s;\n' % get_entry( self.cell_dict, composite_key )
- qty_key = 'substance' + str( substance ) + 'qty1'
- conc_key = 'substance' + str( substance ) + 'conc1'
- if( get_entry( self.cell_dict, qty_key ).lower() == 'fix' ):
- composite_key = 'substance' + str( substance ) + 'path0'
- output = output + 'fix %s:' % get_entry( self.cell_dict, composite_key )
- composite_key = 'substance' + str( substance ) + 'id0'
- output = output + '%s;\n' % get_entry( self.cell_dict, composite_key )
- elif( get_entry( self.cell_dict, conc_key ).lower() == 'fix' ):
- composite_key = 'substance' + str( substance ) + 'path0'
- output = output + 'fix %s:' % get_entry( self.cell_dict, composite_key )
- composite_key = 'substance' + str( substance ) + 'id0'
- output = output + '%s;\n' % get_entry( self.cell_dict, composite_key )
- return output
-
- def _print_reactors( self, output ):
- volume_buf = '\n'
- self._check_duplicates()
- for reactor in range( 1, self.num_reactors + 1 ):
- output = output + '\nreactor '
- prefix = 'reactor' + str( reactor )
- composite_key = prefix + 'class0'
- output = output + self.cell_dict[ composite_key ]
- composite_key = prefix + 'path0'
- output = output + '(%s:' % self.cell_dict[ composite_key ]
- composite_key = prefix + 'id0'
- output = output + '%s,' % self.cell_dict[ composite_key ]
- composite_key = prefix + 'name0'
- output = output + '"%s")\n' % self.cell_dict[ composite_key ]
-
- composite_key = 's_' + str( reactor )
- num_substrates = get_entry( self._max_dict, composite_key )
- output = output + '{\n'
- for substrate in range( 1, num_substrates + 1 ):
- output = output + '\tSubstrate '
- composite_key = prefix + 's_path' + str( substrate )
- output = output + get_entry( self.cell_dict, composite_key )
- composite_key = prefix + 's_id' + str( substrate )
- output = output + ':%s ' % get_entry( self.cell_dict, composite_key )
- composite_key = prefix + 's_coeff' + str( substrate )
- output = output + '%s' % get_entry( self.cell_dict, composite_key )
- output = output + ';\n'
-
- composite_key = 'p_' + str( reactor )
- num_products = get_entry( self._max_dict, composite_key )
- for product in range( 1, num_products + 1 ):
- output = output + '\tProduct '
- composite_key = prefix + 'p_path' + str( product )
- output = output + get_entry( self.cell_dict, composite_key )
- composite_key = prefix + 'p_id' + str( product )
- output = output + ':%s ' % get_entry( self.cell_dict, composite_key )
- composite_key = prefix + 'p_coeff' + str( product )
- output = output + '%s' % get_entry( self.cell_dict, composite_key )
- output = output + ';\n'
-
- composite_key = 'c_' + str( reactor )
- num_catalysts = get_entry( self._max_dict, composite_key )
- for catalyst in range( 1, num_catalysts + 1 ):
- output = output + '\tCatalyst '
- composite_key = prefix + 'c_path' + str( catalyst )
- output = output + get_entry( self.cell_dict, composite_key )
- composite_key = prefix + 'c_id' + str( catalyst )
- output = output + ':%s' % get_entry( self.cell_dict, composite_key )
- output = output + ';\n'
-
- composite_key = 'e_' + str( reactor )
- num_effectors = get_entry( self._max_dict, composite_key )
- for effector in range( 1, num_effectors + 1 ):
- output = output + '\tEffector '
- composite_key = prefix + 'e_path' + str( effector )
- output = output + get_entry( self.cell_dict, composite_key )
- composite_key = prefix + 'e_id' + str( effector )
- output = output + ':%s ' % get_entry( self.cell_dict, composite_key )
- composite_key = prefix + 'e_coeff' + str( effector )
- output = output + '%s;\n' % get_entry( self.cell_dict, composite_key )
- output = output + ';\n'
-
- composite_key = 'o_' + str( reactor )
- num_options = get_entry( self._max_dict, composite_key )
- for option in range( 1, num_options + 1 ):
- composite_key = prefix + 'o_type' + str( option )
- output = output + '\t%s ' % get_entry( self.cell_dict, composite_key )
- composite_key = prefix + 'o_path' + str( option )
- output = output + get_entry( self.cell_dict, composite_key )
- composite_key = prefix + 'o_id' + str( option )
- output = output + ':%s ' % get_entry( self.cell_dict, composite_key )
- composite_key = prefix + 'o_coeff' + str( option )
- output = output + '%s;\n' % get_entry( self.cell_dict, composite_key )
- output = output + ';\n'
-
- composite_key = 'arg_tag' + str( reactor )
- num_args = get_entry( self._max_dict, composite_key )
- for arg in range( 1, num_args + 1 ):
- composite_key = prefix + 'arg_tag' + str( arg )
- output = output + '\t%s ' % get_entry( self.cell_dict, composite_key )
- composite_key = prefix + 'arg_coeff' + str( arg )
- output = output + '%s;\n' % get_entry( self.cell_dict, composite_key )
-
- for system in range( 1, self.num_systems + 1 ):
- path_key = prefix + 'path0'
- id_key = prefix + 'id0'
- reactor_path = get_entry( self.cell_dict, path_key )
- reactor_id = get_entry( self.cell_dict, id_key )
- path_id = '%s:%s' % ( reactor_path, reactor_id )
- volume_key = 'system' + str( system ) + 'volumeindex0'
- volume_index = get_entry( self.cell_dict, volume_key )
- if( path_id == volume_index ):
- output = output + '\tInitialActivity '
- init_act_key = prefix + 'init_act0'
- init_act0 = get_entry( self.cell_dict, init_act_key )
- if( init_act0 == '' ):
- init_act0 = get_entry( self.cell_dict, prefix + 'init_act1' )
- output = output + '%s;\n' % init_act0
- if( not ( system in self._duplicates ) ):
- volume_buf = volume_buf + R'_SETVOLUME('
- volume_buf = volume_buf + '%s,%s)\n' % ( reactor_path, init_act0 )
- volume_buf = volume_buf.replace( r'//', '\/' )
-
- output = output + '}\n'
-
- if( self.contains_concentration ):
- output = volume_buf + output
- return output
-
- def _check_duplicates( self ):
- self._duplicates = []
- for system in range( 1, self.num_systems + 1 ):
- target_path_key = 'system' + str( system ) + 'path0'
- target_id_key = 'system' + str( system ) + 'id0'
- for other in range( 1, system ):
- match_path_key = 'system' + str( other ) + 'path0'
- match_id_key = 'system' + str( other ) + 'id0'
- if( self.cell_dict.has_key( target_path_key ) and \
- self.cell_dict.has_key( target_id_key ) ):
- if self._match_cell_dict_entry( target_path_key, match_path_key ):
- if self._match_cell_dict_entry( target_id_key, match_id_key ):
- self._duplicates.append( system )
-
- def _match_cell_dict_entry( self, key, other_key ):
- if( get_entry( self.cell_dict, key ) == get_entry( self.cell_dict, other_key ) ):
- return 1
- return 0
-
-
-def get_entry( dict, key ):
- try:
- entry = dict[ key ]
- except KeyError:
- entry = ''
- return entry
-
-
-
-
-
-
-
-
-
View
409 Bio/ECell/__init__.py
@@ -1,409 +0,0 @@
-# Copyright 2001 by Katharine Lindner. All rights reserved.
-# This code is part of the Biopython distribution and governed by its
-# license. Please see the LICENSE file that should have been included
-# as part of this package.
-"""For reading the ECell spreadsheet format from Ecell2 (DEPRECATED).
-
-Ecell converts the ECell input from spreadsheet format to an intermediate
-format, described in http://www.e-cell.org/manual/chapter2E.html#3.2. It
-provides an alternative to the perl script supplied with the Ecell2
-distribution at http://bioinformatics.org/project/?group_id=49.
-
-ECell expects a spreadsheet exported in delimited text format. The file should
-be read with FilteredReader using the default filter chain to remove extraneous
-characters.
-"""
-import warnings
-warnings.warn("Bio.ECell was deprecated, as it does not seem to have any" \
- + " users. If you do use this module, please contact the"\
- + " Biopython developers at biopython-dev@biopython.org to"\
- + " avoid permanent removal of this module", DeprecationWarning)
-
-# standard library
-import sys
-import string
-import copy
-import array
-import os
-import re
-import sgmllib
-import urlparse
-
-# XML from python 2.0
-from xml.sax import handler
-
-# Martel
-import Martel
-from Martel import RecordReader
-
-from Bio.ParserSupport import EventGenerator
-from Bio.ParserSupport import AbstractConsumer
-from Bio import File
-from Bio.Align.Generic import Alignment
-import Bio.Alphabet
-import ecell_format
-import Record
-
-class Error( Exception ):
- """
- """
- def __init__( self ):
- pass
-
-class ECellError( Error ):
-
- """
- message - description of error
- """
-
- def __init__( self, message ):
- self.message = message
-
-
-
-class Iterator:
- """Iterator interface to move over a file of ecell entries one at a time.
- """
- def __init__(self, handle, parser = None):
- """Initialize the iterator.
-
- Arguments:
- o handle - A handle with ECell entries to iterate through.
- o parser - An optional parser to pass the entries through before
- returning them. If None, then the raw entry will be returned.
- """
- self.handle = File.UndoHandle( handle )
- self._reader = RecordReader.Everything( self.handle )
- self._parser = parser
-
- def next(self):
- """Return the next ecell record from the handle.
-
- Will return None if we ran out of records.
- """
- data = self._reader.next()
-
- if self._parser is not None:
- if data:
- dumpfile = open( 'dump', 'w' )
- dumpfile.write( data )
- dumpfile.close()
- return self._parser.parse(File.StringHandle(data))
-
- return data
-
- def __iter__(self):
- return iter(self.next, None)
-
-
-
-class _Scanner:
- """Start up Martel to do the scanning of the file.
-
- This initialzes the Martel based parser and connects it to a handler
- that will generate events for a Feature Consumer.
- """
- def __init__(self, debug = 0):
- """Initialize the scanner by setting up our caches.
-
- Creating the parser takes a long time, so we want to cache it
- to reduce parsing time.
-
- Arguments:
- o debug - The level of debugging that the parser should
- display. Level 0 is no debugging, Level 2 displays the most
- debugging info (but is much slower). See Martel documentation
- for more info on this.
- """
- # a listing of all tags we are interested in scanning for
- # in the MartelParser
- self.interest_tags = [ 'header_line', 'system_line', 'substance_multiline', \
- 'reactor_multiline', 'include_line' ]
-
- # make a parser that returns only the tags we are interested in
- expression = Martel.select_names( ecell_format.ecell_record, self.interest_tags)
- self._parser = expression.make_parser(debug_level = debug)
-
- def feed(self, handle, consumer):
- """Feed a set of data into the scanner.
-
- Arguments:
- o handle - A handle with the information to parse.
- o consumer - The consumer that should be informed of events.
- """
- self._parser.setContentHandler( EventGenerator(consumer,
- self.interest_tags))
-# self._parser.setErrorHandler(handle.ErrorHandler())
-
- self._parser.parseFile(handle)
-
-class _RecordConsumer:
- """Create an ECell Record object from scanner generated information.
- """
- def __init__(self):
- self.data = Record.Record()
- self._header = []
- self._database = {}
- self._state = ''
-
- def include_line( self, line ):
- self.data.include_buf = self.data.include_buf + line
-
- def header_line( self, lines ):
- for line in lines:
- items = line.split( '\t')
- items[ 0 ] = items[ 0 ].lower()
- self._header = []
- self._state = items[ 0 ]
- for item in items:
- item = item.strip()
- self._header.append( item.lower() )
-
-
- def system_line( self, lines ):
- for line in lines:
- line_dict = self._make_line_dict( line )
- if( not self._check_missing_header( line_dict ) ):
- raise EcellError( "invalid header" )
- self.data.num_systems = self.data.num_systems + 1
- _set_defaults( line_dict )
- self._build_system_entry( line_dict )
-
-
- def substance_multiline( self, multiline ):
- for line in multiline:
- self.parse_substance_lines( line )
-
- def parse_substance_lines( self, multiline ):
- lines = multiline.splitlines()
- line_no = 0
- for line in lines:
- line_dict = self._make_line_dict( line )
- try:
- if( not _is_valid_substance( line_dict ) ):
- raise ECellError( "quantity and concentration are mutually exclusive" )
- except ECellError, e:
- print sys.stderr, e.message
-
- qty = Record.get_entry( line_dict, 'qty' )
- conc = Record.get_entry( line_dict, 'conc' )
- if( ( qty.lower() != 'fix' ) and ( conc.lower() != 'fix' ) ):
- self.data.num_substances = self.data.num_substances + 1
- else:
- line_no = line_no + 1
- if( line.lower().startswith( 'substance' ) ):
- _set_defaults( line_dict )
- self._convert_conc( line_dict )
-
- self._build_substance_entry( line_dict, line_no )
-
- def reactor_multiline( self, multiline ):
- for line in multiline:
- self.parse_reactor_lines( line )
-
- def parse_reactor_lines( self, multiline ):
- lines = multiline.splitlines()
- for line in lines:
- line_dict = self._make_line_dict( line )
- if( line.lower().startswith( 'reactor' ) ):
- if( not self._check_missing_header( line_dict ) ):
- raise ECellError( "invalid header" )
- try:
- if( not is_only_digits( line_dict[ 's_coeff' ] ) ):
- raise ECellError( 's_coeff must contain only digits' )
- if( not is_only_digits( line_dict[ 'p_coeff' ] ) ):
- raise ECellError( 'p_coeff must contain only digits' )
- except KeyError:
- pass
- if( line.lower().startswith( 'reactor' ) ):
- _set_reactor_defaults( line_dict )
- line_dict = self._remove_if_inconsistent( line_dict )
-
- if( line_dict.has_key( 'class' ) ):
- self.data.num_reactors = self.data.num_reactors + 1
- num_substrates = 0
- num_products = 0
- num_catalysts = 0
- num_effectors = 0
- num_options = 0
- num_args = 0
- if( line_dict.has_key( 's_id' ) ): num_substrates = num_substrates + 1
- if( line_dict.has_key( 'p_id' ) ): num_products = num_products + 1
- if( line_dict.has_key( 'c_id' ) ): num_catalysts = num_catalysts + 1
- if( line_dict.has_key( 'e_id' ) ): num_effectors = num_effectors + 1
- if( line_dict.has_key( 'o_type' ) ): num_options = num_options + 1
- if( line_dict.has_key( 'arg_tag' ) ): num_args = num_args + 1
- counter_dict = { \
- 's_' : num_substrates, \
- 'p_' : num_products, \
- 'c_' : num_catalysts, \
- 'e_' : num_effectors, \
- 'o_' : num_options, \
- 'arg_tag' : num_args
- }
- self._set_max( counter_dict )
- self._build_reactor_entry( line_dict, counter_dict )
-
-
- def _set_max( self, counter_dict ):
- num_reactors = self.data.num_reactors
- for key in counter_dict.keys():
- composite_key = key + str( num_reactors )
- self.data._max_dict[ composite_key ] = counter_dict[ key ]
-
- def _build_system_entry( self, line_dict ):
- for key in line_dict.keys():
- item = line_dict[ key ]
- composite_key = 'system' + str( self.data.num_systems ) + key + '0'
-
- if( not self.data.cell_dict.has_key( composite_key ) ):
- self.data.cell_dict[ composite_key ] = item
-
- def _build_substance_entry( self, line_dict, line_no ):
- for key in line_dict.keys():
- item = line_dict[ key ]
- composite_key = 'substance' + str( self.data.num_substances ) + key + \
- str( line_no )
- if( not self.data.cell_dict.has_key( composite_key ) ):
- self.data.cell_dict[ composite_key ] = item
-
- def _convert_conc( self, line_dict ):
- if( line_dict.has_key( 'conc' ) ):
- if( not line_dict.has_key( 'qty' ) ):
- contents = 'QTY(%s,%s)' % ( line_dict[ 'conc' ], line_dict[ 'path' ] )
- composite_key = 'substance' + str( self.data.num_substances ) + 'qty' + '0'
- self.data.cell_dict[ composite_key ] = contents
- self.data.contains_concentration = 1
-
- def _build_reactor_entry( self, line_dict, counter_dict ):
- for key in line_dict.keys():
- item = line_dict[ key ]
- prefix = key[ :2 ]
- if( key.startswith( 'arg_' ) ):
- index = counter_dict[ 'arg_tag' ]
- elif( counter_dict.has_key( prefix ) ):
- index = counter_dict[ prefix ]
- else:
- index = '0'
- composite_key = 'reactor' + str( self.data.num_reactors ) + str( key ) + str( index )
- if( not self.data.cell_dict.has_key( composite_key ) ):
- self.data.cell_dict[ composite_key ] = item
-
-
- def _check_missing_header( self, line_dict ):
- ok = 1
- items = [ 'id', 'path', 'class' ]
- for item in items:
- if( line_dict.has_key( item ) == 0 ):
- others = copy.deepcopy( items )
- others.remove( item )
- for other in others:
- if( line_dict.has_key( other ) ):
- if( item.lower() != 'class' ):
- ok = 0
- break
- return ok
-
- def _remove_if_inconsistent( self, list_dict ):
- valid_keys = list_dict.keys()
- for label in [ 'id', 'path', 'type' ]:
- for prefix in [ 's_', 'p_', 'c_', 'e_' ]:
- node = prefix + label
- valid_keys = self._consistency_filter( prefix, node, valid_keys )
- for key in list_dict.keys():
- if( not key in valid_keys ):
- del list_dict[ key ]
- return list_dict
-
- def _consistency_filter( self, prefix, tag, valid_keys ):
- block = []
- for suffix in [ 'id', 'path', 'coeff', 'type' ]:
- node = prefix + suffix
- block.append( node )
- for node in block:
- if( ( not tag in valid_keys ) and ( node in valid_keys ) ):
- if( ( prefix == 'o_' ) or ( not tag.endswith( 'type' ) ) ):
- valid_keys.remove( node )
- return valid_keys
-
- def _make_line_dict( self, line ):
- line_dict = {}
- items = line.split( '\t' )
- num = 0
- for item in items:
- item = item.strip()
- if( item != '' ):
- line_dict[ self._header[ num ] ] = item
- num = num + 1
- return line_dict
-
-def _clear_bad_block( block, items ):
- for label in block:
- items = items.remove( items.index( label ) )
- return items
-
-def _is_valid_substance( line_dict ):
- ok = 1
- if( line_dict.has_key( 'qty' ) and line_dict.has_key( 'conc' ) ):
- if( not ( line_dict[ 'qty' ] == 'QTY' ) ):
- ok = 0
- return ok
-
-def is_only_digits( line ):
- ok = 1
- text = line.strip()
- if( text != '' ):
- if( not text.isdigit() ):
- ok = 0
- return ok
-
-def _set_reactor_defaults( line_dict ):
- line_dict = _set_defaults( line_dict )
- for item in [ 's_', 'p_', 'c_', 'e_' ]:
- id = item + 'id'
- coeff = item + 'coeff'
- path = item + 'path'
- if( line_dict.has_key( id ) ):
- if( not line_dict.has_key( coeff ) ):
- line_dict[ coeff ] = 1
- if( not line_dict.has_key( path ) ):
- line_dict[ path ] = line_dict[ 'path' ]
-
- return( line_dict )
-
-def _set_defaults( line_dict ):
- if( not line_dict.has_key( 'name' ) ):
- line_dict[ 'name' ] = line_dict[ 'id' ]
- if( line_dict.has_key( 'arg_tag' ) ):
- if( not line_dict.has_key( 'arg_coeff' ) ):
- line_dict[ 'arg_coeff' ] = 0
-
- return( line_dict )
-
-
-
-
-
-
-
-class RecordParser:
- """Parse ECell files into Record objects
- """
- def __init__(self, debug_level = 0):
- """Initialize the parser.
-
- Arguments:
- o debug_level - An optional argument that specifies the amount of
- debugging information Martel should spit out. By default we have
- no debugging info (the fastest way to do things), but if you want
- you can set this as high as two and see exactly where a parse fails.
- """
- self._scanner = _Scanner(debug_level)
-
- def parse(self, handle):
- """Parse the specified handle into an ECell record.
- """
- self._consumer = _RecordConsumer()
- self._scanner.feed(handle, self._consumer)
- return self._consumer.data
-
View
92 Bio/ECell/ecell_format.py
@@ -1,92 +0,0 @@
-# Copyright 2001 by Katharine Lindner. All rights reserved.
-# This code is part of the Biopython distribution and governed by its
-# license. Please see the LICENSE file that should have been included
-# as part of this package.
-
-"""Martel based parser to read ECell formatted files.
-
-This is a huge regular regular expression for ECell, built using
-the 'regular expressiona on steroids' capabilities of Martel.
-
-http://www.bioinformatics.org/ecell2/
-Notes:
-Just so I remember -- the new end of line syntax is:
- New regexp syntax - \R
- \R means "\n|\r\n?"
- [\R] means "[\n\r]"
-
-This helps us have endlines be consistent across platforms.
-
-"""
-# standard library
-#http://www.bioinformatics.org/ecell2/
-import string
-
-# Martel
-import Martel
-from Martel import RecordReader
-from Martel import Str
-from Martel import AnyEol
-from Martel import ToEol
-from Martel import Group
-from Martel import Alt
-from Martel import Rep
-from Martel import Rep1
-from Martel import Any
-from Martel import AnyBut
-from Martel import Expression
-
-
-
-
-
-# --- first set up some helper constants and functions
-# Copyright 2001 by Katharine Lindner. All rights reserved.
-# This code is part of the Biopython distribution and governed by its
-# license. Please see the LICENSE file that should have been included
-# as part of this package.
-
-
-excluded_chars = ' ' + chr( 0x09 ) + chr( 10 ) + chr( 13 )
-
-block_type = Group( "block_type", Expression.NoCase( Str( "Type" ) ) )
-header_line = Group( "header_line", \
- block_type + ToEol())
-tab = Group( "tab", Str( '\t' ) )
-system_tag = Group( "system_tag", Expression.NoCase( Str( "system" ) ) )
-reactor_tag = Group( "reactor_tag", Expression.NoCase( Str( "Reactor" ) ) )
-substance_tag = Group( "substance_tag", Expression.NoCase( Str( "Substance" ) ) )
-system_line = Group( "system_line", system_tag + ToEol() )
-reactor_line = Group( "reactor_line", reactor_tag + ToEol() )
-substance_line = Group( "substance_line", substance_tag + ToEol() )
-continuation_line = Group( "continuation_line", tab + ToEol() )
-include_line = Group( "include_line", Str( 'include' ) + ToEol())
-
-substance_multiline = Group( "substance_multiline", \
- substance_line +
- Rep( continuation_line ) )
-
-reactor_multiline = Group( "reactor_multiline", \
- reactor_line +
- Rep( continuation_line ) )
-
-system_block = Group( "system_block", \
- Rep1( system_line ) )
-reactor_block = Group( "reactor_block", \
- Rep1( reactor_multiline ) )
-substance_block = Group( "substance_block", \
- Rep1( substance_multiline ) )
-valid_block = Group( "valid_block",
- header_line +
- Alt( system_block, reactor_block, substance_block ) )
-valid_contents = Group( "valid_contents", Rep1( valid_block ) )
-ecell_record = valid_contents
-
-
-
-
-
-
-
-
-
View
46 DEPRECATED
@@ -10,19 +10,19 @@ imports, but C modules will not work. Please move to NumPy.
Martel
======
-Declared obsolete in Release 1.48, deprecated in Release 1.49
+Declared obsolete in Release 1.48, deprecated in Release 1.49.
Bio.Mindy
=========
-Declared obsolete in Release 1.48, deprecated in Release 1.49
+Declared obsolete in Release 1.48, deprecated in Release 1.49.
Bio.builders, Bio.Std, Bio.StdHandler, Bio.Decode
=================================================
-Part of the Martel/Mindy infrastructure, these were deprecated in Release 1.49
+Part of the Martel/Mindy infrastructure, these were deprecated in Release 1.49.
Bio.Writer and Bio.writers
==========================
-Deprecated in Release 1.48
+Deprecated in Release 1.48.
Bio.Emboss.Primer
=================
@@ -31,7 +31,7 @@ Bio.Emboss.PrimerSearch instead.
Bio.MetaTool
============
-Deprecated in Release 1.48, this was a parser from the output of MetaTool 3.5
+Deprecated in Release 1.48, this was a parser for the output of MetaTool 3.5
which is now obsolete.
Bio.GenBank
@@ -47,17 +47,17 @@ in the following release. Please use Bio.Entrez instead.
Bio.EUtils
==========
-Deprecated in favor of Bio.Entrez in Release 1.48
+Deprecated in favor of Bio.Entrez in Release 1.48.
Bio.Blast.NCBIWWW
=================
-The HTML BLAST parser was deprecated as of Release 1.48
-The deprecated functions blast and blasturl were removed in Release 1.44
+The HTML BLAST parser was deprecated as of Release 1.48.
+The deprecated functions blast and blasturl were removed in Release 1.44.
Bio.Saf
=======
Deprecated as of Release 1.48, as it appears to have no users, and relies
-on Martel which doesn't work properly with mxTextTools 3.0
+on Martel which doesn't work properly with mxTextTools 3.0.
Bio.NBRF
========
@@ -70,7 +70,7 @@ Deprecated as of Release 1.48 in favor of the "ig" format in Bio.SeqIO
Bio.ECell
=========
Deprecated as of Release 1.47, as it appears to have no users, and the code
-does not seem relevant for ECell 3.
+does not seem relevant for ECell 3. Removed in Release 1.49.
Bio.SGMLExtractor
=================
@@ -103,39 +103,39 @@ is now available from Bio.SCOP, Bio.InterPro and Bio.ExPASy instead.
Bio.SeqIO
=========
The old Bio.SeqIO.FASTA and Bio.SeqIO.generic were deprecated in favour of
-the new Bio.SeqIO module as of Release 1.44, removed in Release 1.47
+the new Bio.SeqIO module as of Release 1.44, removed in Release 1.47.
Bio.Medline.NLMMedlineXML
=========================
-Deprecated in Release 1.44, removed in 1.46
+Deprecated in Release 1.44, removed in 1.46.
Bio.MultiProc
=============
-Deprecated in Release 1.44, removed in 1.46
+Deprecated in Release 1.44, removed in 1.46.
Bio.MarkupEditor
================
-Deprecated in Release 1.44, removed in 1.46
+Deprecated in Release 1.44, removed in 1.46.
Bio.lcc
=======
-Deprecated in favor of Bio.SeqUtils.lcc in Release 1.44, removed in 1.46
+Deprecated in favor of Bio.SeqUtils.lcc in Release 1.44, removed in 1.46.
Bio.crc
=======
-Deprecated in favor of Bio.SeqUtils.CheckSum in Release 1.44, removed in 1.46
+Deprecated in favor of Bio.SeqUtils.CheckSum in Release 1.44, removed in 1.46.
Bio.FormatIO
============
-This was removed in Release 1.44
+This was removed in Release 1.44 (a deprecation was not possible).
Bio.expressions (and therefore Bio.config, Bio.dbdefs, Bio.formatdefs, Bio.dbdefs)
===============
-These were deprecated in Release 1.44, and removed in Release 1.49
+These were deprecated in Release 1.44, and removed in Release 1.49.
Bio.Kabat
=========
-This was deprecated in Release 1.43 and removed in Release 1.44
+This was deprecated in Release 1.43 and removed in Release 1.44.
Bio.SeqUtils
============
@@ -151,12 +151,12 @@ Use the functions 'complement' and 'reverse_complement' in Bio.Seq instead.
Bio.sequtils
============
-Deprecated as of Release 1.30, removed in Release 1.42
+Deprecated as of Release 1.30, removed in Release 1.42.
Use Bio.SeqUtils instead.
Bio.SVM
=======
-Deprecated as of Release 1.30, removed in Release 1.42
+Deprecated as of Release 1.30, removed in Release 1.42.
The Support Vector Machine code in Biopython has been superceeded by a
more robust (and maintained) SVM library, which includes a python
interface. We recommend using LIBSVM:
@@ -165,15 +165,15 @@ http://www.csie.ntu.edu.tw/~cjlin/libsvm/
Bio.RecordFile
==============
-Deprecated as of Release 1.30, removed in Release 1.42
+Deprecated as of Release 1.30, removed in Release 1.42.
RecordFile wasn't completely implemented and duplicates the work
of most standard parsers. We recommend using a specific iterator
(Bio.Fasta.Iterator for example) without a parser to get back
text records.
Bio.kMeans and Bio.xkMeans
==========================
-Deprecated as of Release 1.30, removed in Release 1.42
+Deprecated as of Release 1.30, removed in Release 1.42.
The k-Means algorithm is an algorithm for unsupervised clustering of data.
Biopython includes an implementation of the k-means clustering algorithm
View
1 setup.py
@@ -248,7 +248,6 @@ def is_Numpy_installed():
'Bio.Clustalw',
'Bio.Crystal',
'Bio.Data',
- 'Bio.ECell',
'Bio.Emboss',
'Bio.Encodings',
'Bio.Entrez',

0 comments on commit bbfff83

Please sign in to comment.