allpy
changeset 405:df07f7c7ee56
merge
author | boris <bnagaev@gmail.com> |
---|---|
date | Mon, 07 Feb 2011 22:02:20 +0300 |
parents | b5970add0bd9 fb5b4f87d741 |
children | faa7e19bffd9 |
files | |
diffstat | 5 files changed, 13 insertions(+), 13 deletions(-) [+] |
line diff
1.1 --- a/allpy/protein.py Mon Feb 07 22:00:55 2011 +0300 1.2 +++ b/allpy/protein.py Mon Feb 07 22:02:20 2011 +0300 1.3 @@ -31,7 +31,7 @@ 1.4 self.save_fasta(tmp_file) 1.5 tmp_file.close() 1.6 os.system("muscle -in %(tmp)s -out %(tmp)s" % {'tmp': tmp_file.name}) 1.7 - sequences, body = Alignment.from_file(open(tmp_file.name)) 1.8 + sequences, body = Alignment().append_file(open(tmp_file.name)) 1.9 for sequence in self.sequences: 1.10 try: 1.11 new_sequence = [i for i in sequences if sequence==i][0]
2.1 --- a/test/usecase3.py Mon Feb 07 22:00:55 2011 +0300 2.2 +++ b/test/usecase3.py Mon Feb 07 22:02:20 2011 +0300 2.3 @@ -1,5 +1,5 @@ 2.4 from allpy import protein 2.5 -alignment = protein.Alignment.from_file(open("aln.fasta")) 2.6 +alignment = protein.Alignment().append_file(open("aln.fasta")) 2.7 #conservative = [(10,20), (40,50)] 2.8 conservative = [(0,6),(18,37)] 2.9 2.10 @@ -30,7 +30,7 @@ 2.11 markup = ranges_to_markup(conservative) 2.12 blocks = markup_to_blocks(markup) 2.13 for block in blocks["-"]: 2.14 - block.flush_left() 2.15 - alignment.to_fasta(open("output.fasta", "w")) 2.16 + block.flush("left") 2.17 + alignment.to_file(open("output.fasta", "w")) 2.18 2.19 main()
3.1 --- a/utils/flush_left.py Mon Feb 07 22:00:55 2011 +0300 3.2 +++ b/utils/flush_left.py Mon Feb 07 22:02:20 2011 +0300 3.3 @@ -9,15 +9,15 @@ 3.4 from allpy import protein 3.5 3.6 def main(): 3.7 - alignment = protein.Alignment.from_file(open(options.in_file)) 3.8 + alignment = protein.Alignment().append_file(open(options.in_file)) 3.9 if not options.begin: 3.10 options.begin = 1 3.11 if not options.end: 3.12 options.end = len(alignment.columns) 3.13 columns = alignment.columns[options.begin-1:options.end] 3.14 block = protein.Block.from_alignment(alignment, columns=columns) 3.15 - block.flush_left() 3.16 - alignment.to_fasta(open(options.out_file, "w")) 3.17 + block.flush("left") 3.18 + alignment.to_file(open(options.out_file, "w")) 3.19 if options.msf: 3.20 os.system("seqret " + options.out_file + " msf::" + options.out_file.split(".")[0] + ".msf") 3.21 os.system("rm " + options.out_file)
4.1 --- a/utils/flush_left_vblock.py Mon Feb 07 22:00:55 2011 +0300 4.2 +++ b/utils/flush_left_vblock.py Mon Feb 07 22:02:20 2011 +0300 4.3 @@ -9,15 +9,15 @@ 4.4 from allpy import protein 4.5 4.6 def main(): 4.7 - alignment = protein.Alignment.from_file(open(options.in_file)) 4.8 + alignment = protein.Alignment().append_file(open(options.in_file)) 4.9 if not options.begin: 4.10 options.begin = 1 4.11 if not options.end: 4.12 options.end = len(alignment.columns) 4.13 columns = alignment.columns[options.begin-1:options.end] 4.14 block = protein.Block.from_alignment(alignment, columns=columns) 4.15 - block.flush_left() 4.16 - alignment.to_fasta(open(options.out_file, "w")) 4.17 + block.flush("left") 4.18 + alignment.to_file(open(options.out_file, "w")) 4.19 if options.msf: 4.20 os.system("seqret " + options.out_file + " msf::" + options.out_file.split(".")[0] + ".msf") 4.21 os.system("rm " + options.out_file)
5.1 --- a/utils/flush_left_vblocks.py Mon Feb 07 22:00:55 2011 +0300 5.2 +++ b/utils/flush_left_vblocks.py Mon Feb 07 22:02:20 2011 +0300 5.3 @@ -18,13 +18,13 @@ 5.4 from allpy import protein 5.5 5.6 def main(ranges): 5.7 - alignment = protein.Alignment.from_file(open(options.in_file)) 5.8 + alignment = protein.Alignment().append_file(open(options.in_file)) 5.9 for begin, end in ranges: 5.10 columns = alignment.columns[begin-1:end] 5.11 block = protein.Block.from_alignment(alignment, columns=columns) 5.12 - block.flush_left() 5.13 + block.flush("left") 5.14 5.15 - alignment.to_fasta(open(options.out_file, "w")) 5.16 + alignment.to_file(open(options.out_file, "w")) 5.17 if options.msf: 5.18 os.system("seqret " + options.out_file + " msf::" + options.out_file.split(".")[0] + ".msf") 5.19 os.system("rm " + options.out_file)