def _insdc_location_string(location, rec_length):
 try:
  parts = location.parts
  if (location.strand == (-1)):
   return ('complement(%s(%s))' % (location.operator, ','.join((_insdc_location_string_ignoring_strand_and_subfeatures(p, rec_length) for p in parts[::(-1)]))))
  else:
   return ('%s(%s)' % (location.operator, ','.join((_insdc_location_string(p, rec_length) for p in parts))))
 except AttributeError:
  loc = _insdc_location_string_ignoring_strand_and_subfeatures(location, rec_length)
  if (location.strand == (-1)):
   return ('complement(%s)' % loc)
  else:
   return loc

def _insdc_location_string ( location , rec_length ) : try : parts = location . parts if ( location . strand == ( - 1 ) ) : return ( 'complement(%s(%s))' % ( location . operator , ',' . join ( ( _insdc_location_string_ignoring_strand_and_subfeatures ( p , rec_length ) for p in parts [ : : ( - 1 ) ] ) ) ) ) else : return ( '%s(%s)' % ( location . operator , ',' . join ( ( _insdc_location_string ( p , rec_length ) for p in parts ) ) ) ) except AttributeError : loc = _insdc_location_string_ignoring_strand_and_subfeatures ( location , rec_length ) if ( location . strand == ( - 1 ) ) : return ( 'complement(%s)' % loc ) else : return loc
build a genbank/embl location from a featurelocation .