def _loc(loc_str, expected_seq_length, strand):
 if (':' in loc_str):
  (ref, loc_str) = loc_str.split(':')
 else:
  ref = None
 try:
  (s, e) = loc_str.split('..')
 except ValueError:
  assert ('..' not in loc_str)
  if ('^' in loc_str):
   (s, e) = loc_str.split('^')
   if ((int(s) + 1) == int(e)):
    pos = _pos(s)
   elif ((int(s) == expected_seq_length) and (e == '1')):
    pos = _pos(s)
   else:
    raise ValueError(('Invalid between location %s' % repr(loc_str)))
   return SeqFeature.FeatureLocation(pos, pos, strand, ref=ref)
  else:
   s = loc_str
   e = loc_str
 return SeqFeature.FeatureLocation(_pos(s, (-1)), _pos(e), strand, ref=ref)

def _loc ( loc_str , expected_seq_length , strand ) : if ( ':' in loc_str ) : ( ref , loc_str ) = loc_str . split ( ':' ) else : ref = None try : ( s , e ) = loc_str . split ( '..' ) except ValueError : assert ( '..' not in loc_str ) if ( '^' in loc_str ) : ( s , e ) = loc_str . split ( '^' ) if ( ( int ( s ) + 1 ) == int ( e ) ) : pos = _pos ( s ) elif ( ( int ( s ) == expected_seq_length ) and ( e == '1' ) ) : pos = _pos ( s ) else : raise ValueError ( ( 'Invalid between location %s' % repr ( loc_str ) ) ) return SeqFeature . FeatureLocation ( pos , pos , strand , ref = ref ) else : s = loc_str e = loc_str return SeqFeature . FeatureLocation ( _pos ( s , ( - 1 ) ) , _pos ( e ) , strand , ref = ref )
featurelocation from non-compound non-complement location .