From 7870ddc578ba791bc06de20b5b5bc52db84ba347 Mon Sep 17 00:00:00 2001 From: Ilya Vorontsov Date: Wed, 30 Nov 2016 14:05:52 +0300 Subject: [PATCH] better formatting of transfac files --- lib/formatters.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/formatters.rb b/lib/formatters.rb index f7eaed5..d31da74 100644 --- a/lib/formatters.rb +++ b/lib/formatters.rb @@ -48,9 +48,9 @@ def in_transfac_format(motif_pcms) result << "BF #{uniprot}; Species: #{species}\n" end result << "XX\n" - result << 'P0 ' + ['A', 'C', 'G', 'T'].join("\t") << "\n" + result << "P0 A C G T\n" rounded_pcm.matrix.each_with_index do |pos, pos_index| - result << ('%02d ' % (pos_index + 1)) + [*pos, consensus[pos_index]].join("\t") << "\n" + result << "%02d %6.20g %6.20g %6.20g %6.20g %s\n" % [pos_index + 1, *pos, consensus[pos_index]] end result << "XX\n" result << "//\n"