Bo Yang wrote: > I try to do a multiple structural alignment using the example of > "salign.py" script. The command went through, but the alignment file > only contained the last template sequence. I have attached my script and > the alignment files generated.
You have a bug in your script:
> aln = alignment(env) > for (code) in (('2HI4-1A2'), ('1PQ2-2C8A'), ('1OG5-2C9A')): > mdl = model(env, file=code, model_segment=('FIRST:@', 'END:')) > aln.append_model(mdl, atom_files=code, align_codes=code)
This should read:
> aln = alignment(env) > for (code) in (('2HI4-1A2'), ('1PQ2-2C8A'), ('1OG5-2C9A')): > mdl = model(env, file=code, model_segment=('FIRST:@', 'END:')) > aln.append_model(mdl, atom_files=code, align_codes=code)
i.e. the last line must be indented to line up with the 'mdl = model' line. Indentation is important in Python scripts; the indented line runs within the 'for' loop (and thus for all sequences) while an unindented line runs outside the loop, and thus only for the last sequence.
Ben Webb, Modeller Caretaker