From 6f99120e13663a472837c2c884b3e09a6f106f5a Mon Sep 17 00:00:00 2001
From: Andrew Waterhouse <andrew.waterhouse@unibas.ch>
Date: Thu, 14 Jun 2012 16:29:32 +0200
Subject: [PATCH] convert ? to X before running clustalw

---
 modules/bindings/pymod/clustalw.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/modules/bindings/pymod/clustalw.py b/modules/bindings/pymod/clustalw.py
index 2c2fd6eba..2795f66dd 100644
--- a/modules/bindings/pymod/clustalw.py
+++ b/modules/bindings/pymod/clustalw.py
@@ -27,6 +27,13 @@ def ClustalW(seq1, seq2=None, clustalw=None, keep_files=False, nopgap=False,
   else:
     LogError("WARNING: Specify either two SequenceHandles or one SequenceList")
     return
+
+  new_list = seq.CreateSequenceList()
+  for s in seq_list:
+    ss = seq.CreateSequence( s.GetName(), s.GetString().replace('?','X') )
+    new_list.AddSequence(ss)
+
+  seq_list = new_list
   
   temp_dir=utils.TempDirWithFiles((seq_list,))
   out=os.path.join(temp_dir.dirname, 'out.fasta')
-- 
GitLab