'--stranded', action='store_const', const=True, default=False, help='Assume input reads come from the sense strand; then partitions ' 'in output have terminal + and - indicating sense strand') parser.add_argument('--score-min', type=int, required=False, default=48, help='Bowtie2 minimum CONSTANT score to use') parser.add_argument('--gzip-level', type=int, required=False, default=3, help='Gzip compression level to use for temporary Bowtie input file') parser.add_argument('--intermediate-dir', type=str, required=False, default='./', help='Where to put transcript index if it needs to be downloaded') # Add command-line arguments for dependencies bowtie.add_args(parser) filemover.add_args(parser) tempdel.add_args(parser) # Collect Bowtie arguments, supplied in command line after the -- token argv = sys.argv bowtie2_args = '' in_args = False for i, argument in enumerate(sys.argv[1:]): if in_args: bowtie2_args += argument + ' ' if argument == '--': argv = sys.argv[:i + 1] in_args = True '''Now collect other arguments. While the variable args declared below is global, properties of args are also arguments of the go() function so
description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) parser.add_argument(\ '--out', metavar='URL', type=str, required=False, default='None', help='Bowtie index files are written to this URL. DEFAULT IS CURRENT ' 'WORKING DIRECTORY.') parser.add_argument(\ '--basename', type=str, required=False, default='junction', help='Basename for index to be written') parser.add_argument(\ '--keep-alive', action='store_const', const=True, default=False, help='Prints reporter:status:alive messages to stderr to keep EMR ' 'task alive') filemover.add_args(parser) bowtie.add_args(parser) tempdel.add_args(parser) args = parser.parse_args() import time start_time = time.time() output_filename, output_stream, output_url = [None] * 3 output_url = Url(args.out) if args.out is not None \ else Url(os.getcwd()) # Set up temporary destination import tempfile temp_dir_path = make_temp_dir(tempdel.silentexpandvars(args.scratch)) # For deleting temporary directory, even on unexpected exit register_cleanup(tempdel.remove_temporary_directories, [temp_dir_path])