示例#1
0
    def run(self):
        # split db clones by j
        js = []
        tempdir = "%s-db_jsplit" % self.outfile
        system("mkdir -p %s" % tempdir)
        for sam in os.listdir(self.db_dir):
            infile = os.path.join(self.db_dir, sam, self.v, self.l)
            if not os.path.exists(infile):
                continue
            clones = pickle.load(gzip.open(infile, "rb"))
            j2clones = lcommon.split_clones_by_j(clones)
            tempsamdir = os.path.join(tempdir, sam)
            system('mkdir -p %s' % tempsamdir)
            for j, jclones in j2clones.iteritems():
                tempjfile = os.path.join(tempsamdir, j)  #  l/v-db_jsplit/sam/jfile
                pickle.dump(jclones, gzip.open(tempjfile, 'wb'))
                if j not in js:
                    js.append(j)
        self.logToMaster("Done spliting clones by j for length %s V %s\n" %
                          (self.l, self.v))
        
        tempoutdir = "%s-llh_jsplit" % self.outfile  #  l/v-llh_jsplit/jllh
        system("mkdir -p %s" % tempoutdir)
        for j in js:
            joutfile = os.path.join(tempoutdir, j)
            self.addChildTarget(GetLenLlh_VJ(self.model, tempdir, j, joutfile))

        self.setFollowOnTarget(GetLenLlh_V_Agg(tempoutdir, self.outfile))
示例#2
0
 def run(self):
     # split db clones by j
     js = []
     tempdir = "%s-db_jsplit" % self.outfile
     system("mkdir -p %s" % tempdir)
     clones = pickle.load(gzip.open(self.db_file, "rb"))
     j2clones = lcommon.split_clones_by_j(clones)
     for j, jclones in j2clones.iteritems():
         tempjfile = os.path.join(tempdir, j)  #  v/l-db_jsplit/jfile
         pickle.dump(jclones, gzip.open(tempjfile, 'wb'))
         if j not in js:
             js.append(j)
     self.logToMaster("Done spliting clones by j for %s\n" % self.outfile)
     
     tempoutdir = "%s-llh_jsplit" % self.outfile  #  v/l-llh_jsplit/jllh
     system("mkdir -p %s" % tempoutdir)
     for j in js:
         jinfile = os.path.join(tempdir, j)
         joutfile = os.path.join(tempoutdir, j)
         self.addChildTarget(GetLlh_VJ(self.model, jinfile, joutfile))
     self.setFollowOnTarget(GetLlh_VJ_Agg(tempoutdir, self.outfile))