def check_track_clone_options(parser, options): options.clones = None if options.clonefile: libcommon.check_options_file(options.clonefile) options.clones = libcommon.read_list(options.clonefile) if options.track_minfreq > 1.0: parser.error("--track_minfreq is the proportion, not %, should be < 1")
def run(self): db_dir = self.args[0] sam_file = self.args[1] minsam = int(self.args[2]) outdir = self.args[3] if not os.path.exists(outdir): system("mkdir -p %s" % outdir) samples = lcommon.read_list(sam_file) c2s_dir = self.c2s_dir if c2s_dir is None: global_dir = self.getGlobalTempDir() c2s_dir = os.path.join(global_dir, "clone2sam2size_dir") system("mkdir -p %s" % c2s_dir) sizetype = 'freq' self.addChildTarget(scommon.GetClone2Samples(db_dir, c2s_dir, sizetype, samples)) self.setFollowOnTarget(OverlapClones(db_dir, c2s_dir, minsam, self.maxsam, samples, outdir))
def run(self): self.logToMaster("Setting up...\n") if not os.path.exists(self.outdir): system("mkdir -p %s" % self.outdir) #global_dir = self.getGlobalTempDir() clones = lcommon.read_list(self.clonefile) v2seq = lcommon.read_dict(self.vfile, cap=True) j2seq = lcommon.read_dict(self.jfile, cap=True) d2seq = lcommon.read_dict(self.dfile, cap=True) #get the median model model = rcommon.get_median_model(self.modeldir) modelfile = os.path.join(self.outdir, "recomb_median_model.pickle") pickle.dump(model, gzip.open(modelfile, 'wb')) self.logToMaster("Done processing the input files.\n") for clone in clones: items = clone.split('_') v = items[0] seq = items[1] j = items[2] vdels = [] for vdel, vdelfreq in model.v2del[v].iteritems(): if vdelfreq > 0: vdels.append(vdel) jdels = [] for jdel, jdelfreq in model.j2del[j].iteritems(): if jdelfreq > 0: jdels.append(jdel) vseq = v2seq[v] jseq = j2seq[j] outdir = os.path.join(self.outdir, clone) system("mkdir -p %s" % outdir) self.addChildTarget(GetCloneEvents(clone, seq, vseq, jseq, d2seq, outdir, modelfile, vdels, jdels)) self.setFollowOnTarget(CloneEventsAgg(self.outdir))
def run(self): self.logToMaster("Setting up...\n") if not os.path.exists(self.outdir): system("mkdir -p %s" % self.outdir) #global_dir = self.getGlobalTempDir() clones = lcommon.read_list(self.clonefile) v2seq = lcommon.read_dict(self.vfile, cap=True) j2seq = lcommon.read_dict(self.jfile, cap=True) d2seq = lcommon.read_dict(self.dfile, cap=True) self.logToMaster("Done processing the input files.\n") for clone in clones: items = clone.split('_') v = items[0] seq = items[1] j = items[2] vseq = v2seq[v] jseq = j2seq[j] outdir = os.path.join(self.outdir, clone) system("mkdir -p %s" % outdir) self.addChildTarget(GetCloneEvents(clone, seq, vseq, jseq, d2seq, outdir))