comparison gops_join.py @ 3:ffbd1de29c28 draft

planemo upload for repository https://github.com/galaxyproject/tools-devteam/tree/master/tool_collections/gops/join commit a1517c9d22029095120643bbe2c8fa53754dd2b7
author devteam
date Wed, 11 Nov 2015 12:48:58 -0500
parents e56b47dce68a
children a10f49d9218a
comparison
equal deleted inserted replaced
2:de21bdbb8d28 3:ffbd1de29c28
6 -1, --cols1=N,N,N,N: Columns for start, end, strand in first file 6 -1, --cols1=N,N,N,N: Columns for start, end, strand in first file
7 -2, --cols2=N,N,N,N: Columns for start, end, strand in second file 7 -2, --cols2=N,N,N,N: Columns for start, end, strand in second file
8 -m, --mincols=N: Require this much overlap (default 1bp) 8 -m, --mincols=N: Require this much overlap (default 1bp)
9 -f, --fill=N: none, right, left, both 9 -f, --fill=N: none, right, left, both
10 """ 10 """
11 import sys, traceback, fileinput 11 import fileinput
12 from warnings import warn 12 import sys
13 from bx.intervals import * 13 from bx.intervals.io import NiceReaderWrapper
14 from bx.intervals.io import * 14 from bx.intervals.operations.join import join
15 from bx.intervals.operations.join import *
16 from bx.cookbook import doc_optparse 15 from bx.cookbook import doc_optparse
17 from galaxy.tools.util.galaxyops import * 16 from bx.tabular.io import ParseError
17 from galaxy.tools.util.galaxyops import fail, parse_cols_arg, skipped
18 18
19 assert sys.version_info[:2] >= ( 2, 4 ) 19 assert sys.version_info[:2] >= ( 2, 4 )
20 20
21
21 def main(): 22 def main():
22 mincols = 1 23 mincols = 1
23 upstream_pad = 0
24 downstream_pad = 0
25 leftfill = False 24 leftfill = False
26 rightfill = False 25 rightfill = False
27 26
28 options, args = doc_optparse.parse( __doc__ ) 27 options, args = doc_optparse.parse( __doc__ )
29 try: 28 try:
30 chr_col_1, start_col_1, end_col_1, strand_col_1 = parse_cols_arg( options.cols1 ) 29 chr_col_1, start_col_1, end_col_1, strand_col_1 = parse_cols_arg( options.cols1 )
31 chr_col_2, start_col_2, end_col_2, strand_col_2 = parse_cols_arg( options.cols2 ) 30 chr_col_2, start_col_2, end_col_2, strand_col_2 = parse_cols_arg( options.cols2 )
32 if options.mincols: mincols = int( options.mincols ) 31 if options.mincols:
32 mincols = int( options.mincols )
33 if options.fill: 33 if options.fill:
34 if options.fill == "both": 34 if options.fill == "both":
35 rightfill = leftfill = True 35 rightfill = leftfill = True
36 else: 36 else:
37 rightfill = options.fill == "right" 37 rightfill = options.fill == "right"