Пример #1
0
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')
parser.add_argument(\
    '--output-sam', action='store_const', const=True, default=False, 
    help='Output SAM files if True; otherwise output BAM files')
parser.add_argument(\
    '--suppress-bam', action='store_const', const=True, default=False, 
    help='Do not write any alignments; overrides all other output parameters')

filemover.add_args(parser)
bowtie.add_args(parser)
tempdel.add_args(parser)
from alignment_handlers import add_args as alignment_handlers_add_args
alignment_handlers_add_args(parser)
args = parser.parse_args()

# Start keep_alive thread immediately
if args.keep_alive:
    from dooplicity.tools import KeepAlive
    keep_alive_thread = KeepAlive(sys.stderr)
    keep_alive_thread.start()

'''Make RNAME lengths available from reference FASTA so SAM header can be
formed; reference_index.rname_lengths[RNAME] is the length of RNAME.''' 
reference_index = bowtie_index.BowtieIndexReference(
                            os.path.expandvars(args.bowtie_idx)
                        )
# For mapping sample indices back to original sample labels
manifest_object = manifest.LabelsAndIndices(os.path.expandvars(args.manifest))
Пример #2
0
parser.add_argument('--drop-deletions',
                    action='store_const',
                    const=True,
                    default=False,
                    help='Drop deletions from coverage vectors')
parser.add_argument('--output-bam-by-chr',
                    action='store_const',
                    const=True,
                    default=False,
                    help='Final BAMs will be output by chromosome')

bowtie.add_args(parser)
manifest.add_args(parser)
partition.add_args(parser)
from alignment_handlers import add_args as alignment_handlers_add_args
alignment_handlers_add_args(parser)

# Collect Bowtie arguments, supplied in command line after the -- token
argv = sys.argv
bowtie_args = ''
in_args = False
for i, argument in enumerate(sys.argv[1:]):
    if in_args:
        bowtie_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
different command-line arguments can be passed to it for unit tests.'''
args = parser.parse_args(argv[1:])