From df439707f0c757bbb58526634c47b38a36aba580 Mon Sep 17 00:00:00 2001 From: juergen <juergen@5a81b35b-ba03-0410-adc8-b2c5c5119f08> Date: Mon, 3 May 2010 16:20:27 +0000 Subject: [PATCH] optimising handling properties of sequences in clustalw wrapper git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2171 5a81b35b-ba03-0410-adc8-b2c5c5119f08 --- modules/bindings/pymod/clustalw.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/modules/bindings/pymod/clustalw.py b/modules/bindings/pymod/clustalw.py index 38678cc78..fdf024ebc 100644 --- a/modules/bindings/pymod/clustalw.py +++ b/modules/bindings/pymod/clustalw.py @@ -16,17 +16,14 @@ def ClustalW(seq1, seq2, clustalw=None): out) ps=subprocess.Popen(command, shell=True, stdout=subprocess.PIPE) ps.stdout.readlines() - taln=io.LoadAlignment(out) - aln=seq.CreateAlignment() - if (seq1.HasAttachedView() and seq2.HasAttachedView()): - seq00=taln.GetSequence(0).Copy() - seq00.AttachView(seq1.GetAttachedView().Copy()) - seq01=taln.GetSequence(1).Copy() - seq01.AttachView(seq2.GetAttachedView().Copy()) - aln.AddSequence(seq00) - aln.AddSequence(seq01) - else: - aln=taln.Copy() + aln=io.LoadAlignment(out) + aln.SetSequenceOffset(0,seq1.GetSequenceOffset()) + aln.SetSequenceOffset(1,seq2.GetSequenceOffset()) + if seq1.HasAttachedView(): + aln.AttachView(0,seq1.GetAttachedView().Copy()) + if seq2.HasAttachedView(): + aln.AttachView(1,seq2.GetAttachedView().Copy()) + #~ temp_dir.Cleanup() -- GitLab