allpy
changeset 715:2c3bd08e1f1d
pair_cores: add required option for output file with classes of homology
* method blocks_to_homology() of structure.AlignmentMixin was used (see #58)
* other output files are now optional
* command line option -y corresponds output homology file
author | boris <bnagaev@gmail.com> |
---|---|
date | Fri, 08 Jul 2011 00:23:51 +0200 |
parents | 6faac45a3a17 |
children | 83a40cd34923 |
files | pair_cores/pair_cores.py |
diffstat | 1 files changed, 9 insertions(+), 7 deletions(-) [+] |
line diff
1.1 --- a/pair_cores/pair_cores.py Fri Jul 08 00:18:42 2011 +0200 1.2 +++ b/pair_cores/pair_cores.py Fri Jul 08 00:23:51 2011 +0200 1.3 @@ -57,14 +57,15 @@ 1.4 raise Exception() 1.5 1.6 block = Block.from_alignment(alignment) 1.7 - 1.8 remove_monomers_without_structure(block) 1.9 1.10 - block.to_file(args.o) 1.11 + blocks = block.pair_core_parts(max_delta=args.d, timeout=0) 1.12 1.13 - blocks = block.pair_core_parts(max_delta=args.d, timeout=0) 1.14 - block.blocks_to_file(args.b, blocks) 1.15 - 1.16 + alignment.blocks_to_homology(args.y, blocks) 1.17 + if args.o: 1.18 + block.to_file(args.o) 1.19 + if args.b: 1.20 + block.blocks_to_file(args.b, blocks) 1.21 if args.H: 1.22 block.blocks_to_html(args.H, blocks, open(html_template).read()) 1.23 1.24 @@ -83,9 +84,10 @@ 1.25 1.26 p.add_argument('-v','--version',action='version',version='%(prog)s 2.0') 1.27 p.add_argument('-i',help='Input alignment file',metavar='FILE',type=r,required=True) 1.28 + p.add_argument('-y',help='Output homology file',metavar='FILE',type=w, required=True) 1.29 p.add_argument('-d',help='Distance spreading',metavar='float',type=float,default=2.0) 1.30 - p.add_argument('-o',help='Output alignment file',metavar='FILE',type=w, required=True) 1.31 - p.add_argument('-b',help='Output pair_cores file',metavar='FILE',type=w, required=True) 1.32 + p.add_argument('-o',help='Output alignment file',metavar='FILE',type=w) 1.33 + p.add_argument('-b',help='Output pair_cores file',metavar='FILE',type=w) 1.34 p.add_argument('-H',help='Output HTML file',metavar='FILE',type=w) 1.35 1.36 args = p.parse_args()