Документ взят из кэша поисковой машины. Адрес оригинального документа : http://kodomo.fbb.msu.ru/hg/allpy/raw-rev/df07f7c7ee56
Дата изменения: Unknown
Дата индексирования: Tue Oct 2 07:12:21 2012
Кодировка:

# HG changeset patch
# User boris
# Date 1297105340 -10800
# Node ID df07f7c7ee56177f678c523589052caa08073b79
# Parent b5970add0bd9910e743e3aed8496d15ce5b456d2# Parent fb5b4f87d7414a994670f49ac1e5d3506739786b
merge

diff -r b5970add0bd9 -r df07f7c7ee56 allpy/protein.py
--- a/allpy/protein.py Mon Feb 07 22:00:55 2011 +0300
+++ b/allpy/protein.py Mon Feb 07 22:02:20 2011 +0300
@@ -31,7 +31,7 @@
self.save_fasta(tmp_file)
tmp_file.close()
os.system("muscle -in %(tmp)s -out %(tmp)s" % {'tmp': tmp_file.name})
- sequences, body = Alignment.from_file(open(tmp_file.name))
+ sequences, body = Alignment().append_file(open(tmp_file.name))
for sequence in self.sequences:
try:
new_sequence = [i for i in sequences if sequence==i][0]
diff -r b5970add0bd9 -r df07f7c7ee56 test/usecase3.py
--- a/test/usecase3.py Mon Feb 07 22:00:55 2011 +0300
+++ b/test/usecase3.py Mon Feb 07 22:02:20 2011 +0300
@@ -1,5 +1,5 @@
from allpy import protein
-alignment = protein.Alignment.from_file(open("aln.fasta"))
+alignment = protein.Alignment().append_file(open("aln.fasta"))
#conservative = [(10,20), (40,50)]
conservative = [(0,6),(18,37)]

@@ -30,7 +30,7 @@
markup = ranges_to_markup(conservative)
blocks = markup_to_blocks(markup)
for block in blocks["-"]:
- block.flush_left()
- alignment.to_fasta(open("output.fasta", "w"))
+ block.flush("left")
+ alignment.to_file(open("output.fasta", "w"))

main()
diff -r b5970add0bd9 -r df07f7c7ee56 utils/flush_left.py
--- a/utils/flush_left.py Mon Feb 07 22:00:55 2011 +0300
+++ b/utils/flush_left.py Mon Feb 07 22:02:20 2011 +0300
@@ -9,15 +9,15 @@
from allpy import protein

def main():
- alignment = protein.Alignment.from_file(open(options.in_file))
+ alignment = protein.Alignment().append_file(open(options.in_file))
if not options.begin:
options.begin = 1
if not options.end:
options.end = len(alignment.columns)
columns = alignment.columns[options.begin-1:options.end]
block = protein.Block.from_alignment(alignment, columns=columns)
- block.flush_left()
- alignment.to_fasta(open(options.out_file, "w"))
+ block.flush("left")
+ alignment.to_file(open(options.out_file, "w"))
if options.msf:
os.system("seqret " + options.out_file + " msf::" + options.out_file.split(".")[0] + ".msf")
os.system("rm " + options.out_file)
diff -r b5970add0bd9 -r df07f7c7ee56 utils/flush_left_vblock.py
--- a/utils/flush_left_vblock.py Mon Feb 07 22:00:55 2011 +0300
+++ b/utils/flush_left_vblock.py Mon Feb 07 22:02:20 2011 +0300
@@ -9,15 +9,15 @@
from allpy import protein

def main():
- alignment = protein.Alignment.from_file(open(options.in_file))
+ alignment = protein.Alignment().append_file(open(options.in_file))
if not options.begin:
options.begin = 1
if not options.end:
options.end = len(alignment.columns)
columns = alignment.columns[options.begin-1:options.end]
block = protein.Block.from_alignment(alignment, columns=columns)
- block.flush_left()
- alignment.to_fasta(open(options.out_file, "w"))
+ block.flush("left")
+ alignment.to_file(open(options.out_file, "w"))
if options.msf:
os.system("seqret " + options.out_file + " msf::" + options.out_file.split(".")[0] + ".msf")
os.system("rm " + options.out_file)
diff -r b5970add0bd9 -r df07f7c7ee56 utils/flush_left_vblocks.py
--- a/utils/flush_left_vblocks.py Mon Feb 07 22:00:55 2011 +0300
+++ b/utils/flush_left_vblocks.py Mon Feb 07 22:02:20 2011 +0300
@@ -18,13 +18,13 @@
from allpy import protein

def main(ranges):
- alignment = protein.Alignment.from_file(open(options.in_file))
+ alignment = protein.Alignment().append_file(open(options.in_file))
for begin, end in ranges:
columns = alignment.columns[begin-1:end]
block = protein.Block.from_alignment(alignment, columns=columns)
- block.flush_left()
+ block.flush("left")

- alignment.to_fasta(open(options.out_file, "w"))
+ alignment.to_file(open(options.out_file, "w"))
if options.msf:
os.system("seqret " + options.out_file + " msf::" + options.out_file.split(".")[0] + ".msf")
os.system("rm " + options.out_file)