Module Expr Str Import alias alias alias alias alias Assign NameStore Str Assign NameStore Str Assign NameStore Num Assign NameStore NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Assign NameStore Num Assign NameStore Dict Assign NameStore Call NameLoad Str Assign NameStore Num Assign NameStore ListLoad For NameStore Call NameLoad Call NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore SubscriptLoad NameLoad Slice Num Num If CompareGt Call NameLoad NameLoad Num body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num orelse Assign NameStore NameLoad If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index NameLoad body Raise BinOpMod Str NameLoad If NameLoad body Assign NameStore BinOpMod Str SubscriptLoad NameLoad Index NameLoad orelse Assign NameStore BinOpMod Str SubscriptLoad NameLoad Index NameLoad If NameLoad body If SubscriptLoad NameLoad Index NameLoad body AugAssignAdd NameStore BinOpMod Str TupleLoad NameLoad SubscriptLoad NameLoad Index NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr For NameStore NameLoad body If CompareEq SubscriptLoad NameLoad Slice Num Str body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num If BoolOpAnd NameLoad CompareNotEq NameLoad NameLoad body Continue Assign NameStore BinOpAdd NameLoad NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Assign SubscriptStore NameLoad Index NameLoad Call NameLoad NameLoad AugAssignAdd NameStore Num Assign NameStore SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd SubscriptLoad NameLoad Slice Num NameLoad SubscriptLoad NameLoad Slice Num Expr Call AttributeLoad NameLoad attr Str Assign NameStore ListLoad Str For NameStore Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad SubscriptLoad NameLoad Index NameLoad NameLoad AugAssignAdd NameStore NameLoad If NameLoad body Assign NameStore Call NameLoad NameLoad Str orelse Assign NameStore AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr BinOpAdd Call AttributeLoad NameLoad attr NameLoad Str Str If NameLoad body Expr Call AttributeLoad NameLoad attr decorator_list If CompareEq NameLoad Str body TryExcept body Assign TupleStore NameStore NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice Num Str ListLoad Str Str Str Str handlers ExceptHandler type AttributeLoad NameLoad attr name NameStore body Print NameLoad Expr Call AttributeLoad NameLoad attr Num For TupleStore NameStore NameStore NameLoad body If CompareIn NameLoad TupleLoad Str Str body Assign NameStore Num orelse If CompareIn NameLoad TupleLoad Str Str body Assign NameStore NameLoad orelse If CompareIn NameLoad TupleLoad Str Str body Assign NameStore NameLoad orelse If CompareIn NameLoad TupleLoad Str Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore ListLoad Assign NameStore ListLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr BinOpMod NameLoad SubscriptLoad NameLoad Slice Num If NameLoad body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore ListLoad For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str SubscriptLoad NameLoad Slice Num If CompareEq Call NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr NameLoad orelse If CompareEq Call NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str orelse Raise Str If CompareNotEq Call NameLoad NameLoad Call NameLoad NameLoad body Raise Str orelse Assign NameStore NameLoad If NameLoad body Assign NameStore NameLoad Expr Call NameLoad NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad
N/A N/A append several pdb files.

python merge_pdb_files.py [OPTIONS] pdb_id1 pdb_id2 ...

pdb_id: four letter code. If a chain is given, only this
chain is taken, otherwise everything is output.

The chains are renamed in order of occurence.
Any other fields other than ATOM are removed.

OPTIONS:
-g, --gunzip:   files need to be decompressed
-r, --rotate:   translation vector + rotation matrix, separted by ,
 N/A sys os getopt re string N/A param_pattern_pdb /data/databases/pdb/pdb%s.ent.gz N/A param_cmd_rotate /data/bin/rotate_pdb N/A param_gunzip 0 N/A param_rotate None N/A param_target None MergePdbFiles N/A N/A pdb_ids filenames rotations target do_gunzip N/A None None None N/A N/A current_chain 0 N/A map_old2new N/A N/A current_id N/A ord A N/A index 0 N/A coord N/A N/A index N/A range N/A len pdb_ids N/A N/A N/A N/A coord append N/A MODEL            %i
 index N/A pdb_id N/A pdb_ids N/A index N/A pdb N/A pdb_id N/A 0 4 N/A N/A N/A len pdb_id 4 N/A N/A pdb_chain N/A N/A string upper N/A pdb_id N/A 4 N/A N/A pdb_chain None N/A N/A N/A N/A N/A os path exists N/A filenames N/A index N/A N/A N/A pdb file for %s not found pdb_id N/A do_gunzip N/A N/A statement N/A gunzip < %s N/A filenames N/A index N/A N/A statement N/A cat %s N/A filenames N/A index N/A rotations N/A N/A N/A rotations N/A index N/A N/A statement N/A  | %s %s N/A param_cmd_rotate N/A rotations N/A index N/A lines N/A N/A N/A N/A os popen statement readlines N/A line lines N/A N/A N/A N/A line N/A 4 ATOM N/A N/A chain N/A N/A string upper N/A line N/A 21 N/A N/A pdb_chain N/A pdb_chain chain N/A N/A N/A key N/A pdb_id chain N/A N/A N/A N/A map_old2new has_key key N/A N/A N/A map_old2new N/A key N/A chr current_id N/A current_id 1 N/A new_chain N/A map_old2new N/A key N/A N/A N/A coord append N/A N/A N/A line N/A 21 new_chain N/A line N/A 22 N/A N/A N/A coord append ENDMDL
 N/A result N/A HEADER    PROTEIN STRUCTURE ALIGNMENT N/A key N/A N/A map_old2new keys N/A N/A N/A N/A result append N/A COMPND    (%s) %s
 N/A N/A map_old2new N/A key key N/A result coord N/A target N/A N/A file N/A open target w N/A N/A file N/A sys stdout N/A N/A N/A file write N/A N/A N/A string join result N/A target N/A N/A N/A N/A file close N/A N/A N/A __name__ __main__ N/A N/A N/A N/A N/A optlist args N/A N/A getopt getopt N/A N/A sys argv N/A 1 r:t:gf: N/A rotate= target= gunzip filenames= N/A N/A N/A N/A getopt error N/A msg N/A N/A USAGE N/A N/A N/A sys exit 2 N/A N/A o a optlist N/A N/A N/A o N/A -g --gunzip N/A N/A param_gunzip 1 N/A N/A N/A o N/A -t --target N/A N/A param_target a N/A N/A N/A o N/A -r --rotate N/A N/A param_rotate a N/A N/A N/A o N/A -f --filenames N/A N/A param_filenames N/A N/A string split a , N/A pdb_ids N/A N/A pdb_files N/A N/A a args N/A N/A N/A N/A pdb_ids append a N/A N/A N/A pdb_files append N/A param_pattern_pdb N/A a N/A 4 N/A param_rotate N/A N/A lines N/A map N/A string strip N/A N/A string split param_rotate @ N/A rotations N/A N/A line lines N/A N/A data N/A N/A re split \s*,\s* N/A line N/A -1 N/A N/A N/A len data 1 N/A N/A N/A N/A rotations append None N/A N/A N/A N/A len data 12 N/A N/A N/A N/A rotations append N/A N/A string join data N/A N/A incomplete rotation matrix! N/A N/A N/A len rotations N/A len pdb_ids N/A N/A number of pdbids and rotations differ! N/A N/A rotations None N/A param_filenames N/A N/A pdb_files param_filenames N/A N/A MergePdbFiles pdb_ids pdb_files rotations target param_target do_gunzip param_gunzip