Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/allpy/rev/6a735d0e920c
Дата изменения: Unknown
Дата индексирования: Tue Oct 2 01:19:35 2012
Кодировка:
allpy: 6a735d0e920c

allpy

changeset 820:6a735d0e920c

pair_cores: more information in exceptions when reading input and loading pdb
author boris (kodomo) <bnagaev@gmail.com>
date Fri, 15 Jul 2011 12:27:21 +0400
parents 6adcfe433ce2
children 91e73fb1ac79
files pair_cores/pair_cores.py
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line diff
     1.1 --- a/pair_cores/pair_cores.py	Fri Jul 15 12:23:35 2011 +0400
     1.2 +++ b/pair_cores/pair_cores.py	Fri Jul 15 12:27:21 2011 +0400
     1.3 @@ -37,8 +37,9 @@
     1.4          raise Exception("Provide input alignment or markup file")
     1.5      try:
     1.6          alignment = Alignment().append_file(input_file, format=input_file_format)
     1.7 -    except:
     1.8 -        raise Exception("Can not read input file %s" % input_file)
     1.9 +    except Exception, e:
    1.10 +        raise Exception("Can not read input file %s (%s: %s)" % \
    1.11 +            (input_file, e.__class__, e))
    1.12      unique_sequence_names = set([s.name for s in alignment.sequences])
    1.13      if len(unique_sequence_names) != len(alignment.sequences):
    1.14          raise Exception("Duplicate sequence names in %s" % input_file)
    1.15 @@ -48,8 +49,9 @@
    1.16                  sequence.markups['pdb_resi'].add_pdb(download_pdb=pdb_getter, xyz_only=True)
    1.17              else:
    1.18                  sequence.auto_pdb(xyz_only=True, pdb_getter=pdb_getter)
    1.19 -        except:
    1.20 -            raise Exception("Can't load structure for sequence %s from file %s" % (sequence.name, input_file))
    1.21 +        except Exception, e:
    1.22 +            raise Exception("Can't load structure for sequence %s from file %s (%s: %s)" % \
    1.23 +                (sequence.name, input_file, e.__class__, e))
    1.24      if len(alignment.sequences) < 2:
    1.25          raise Exception("Alignment from file %s has too few sequences" % input_file)
    1.26      block = Block.from_alignment(alignment)