def __init__(self, in_dir, out_dir, num_procs = 1): self.in_dir = in_dir self.out_dir = out_dir self.num_procs = num_procs self.assembly, self.chroms = _common.find_genome_files(self.in_dir) if os.path.exists(self.out_dir): raise ValueError("Output directory %s already exists!" % (self.out_dir,)) os.mkdir(self.out_dir)
def __init__(self, in_dir, out_dir, num_procs=1): self.in_dir = in_dir self.out_dir = out_dir self.num_procs = num_procs self.assembly, self.chroms = _common.find_genome_files(self.in_dir) if os.path.exists(self.out_dir): raise ValueError("Output directory %s already exists!" % (self.out_dir, )) os.mkdir(self.out_dir)
def parse_options(arguments): global options, args parser = OptionParser(usage="%prog [options] <assembly> <sample1.sam> [...sampleN.sam]", version="%prog " + str(__version__)) parser.add_option("-o", dest="output_dir", metavar="[./txome_out]", default="./txome_out", help="write output files to this directory") parser.add_option("-p", dest="num_threads", type="int", metavar="[1]", default=1, help="number of threads used during analysis") parser.add_option("-L", dest="labels", metavar="sample1,...sampleN", default=None, help="comma-separated list of condition labels") parser.add_option("-r", dest="reference", metavar="reference.gtf", default=None, help="reference annotation (i.e. refGene) GTF file") parser.add_option("-M", dest="mask", metavar="mask.gtf", default=None, help="ignore all alignment within transcripts in this file") parser.add_option("--prerun", dest="prerun", action="store_true", default=False, help="perform only the 'discovery' Cufflinks/Scripture runs") parser.add_option("--pool-transcripts", dest="pool_transcripts", action="store_true", default=False, help="pool transcripts with Cuffcompare") parser.add_option("--realrun", dest="realrun", action="store_true", default=False, help="perform only the quantitation Cufflinks runs") options, args = parser.parse_args() if len(args) < 2: print "Error: Not enough arguments" parser.print_help() sys.exit(0) if options.labels != None: options.labels = options.labels.split(",") if len(options.labels) <> len(args) - 1: print "Error: When using -L, must specify a label for every condition" parser.print_help() sys.exit(0) else: options.labels = ["sample%s" % (x,) for x in range(len(args))] options.genome_dir = _common.genome_fasta[args[0]] options.assembly, options.chroms = _common.find_genome_files(options.genome_dir) if options.assembly != args[0]: print "Error: Specified assembly does not match assembly found" parser.print_help() sys.exit(0)