def split_numpy(self): if not os.path.exists("Data/Splits"): subprocess.run("mkdir Data/Splits", shell=True) globs = glob.glob("Data/Full_Mats/gm12878_mat_high_chr1_res_"+str(self.res)+".npy") if len(globs) == 0: self.extract_create_numpy() for i in range(1,23): target = ut.splitPieces("Data/Full_Mats/gm12878_mat_high_chr"+str(i)+"_res_"+str(self.res)+".npy",self.piece_size, self.step) data = ut.splitPieces("Data/Full_Mats/gm12878_mat_low_chr"+str(i)+"_res_"+str(self.res)+".npy", self.piece_size, self.step) np.save("Data/Splits/gm12878_high_chr_"+str(i)+"_res_"+str(self.res)+"_piece_"+str(self.piece_size), target) np.save("Data/Splits/gm12878_low_chr_"+str(i)+"_res_"+str(self.res)+"_piece_"+str(self.piece_size), data)
def split_numpy(self): for i in range(CHRO, CHRO+1): data = ut.splitPieces(self.line_name+"/Full_Mats/chr"+str(i)+"_res_"+str(self.res)+".npy", self.piece_size, self.step) np.save(self.line_name+"/Splits/chr_"+str(i)+"_res_"+str(self.res)+"_piece_"+str(self.piece_size), data) print("0")
def split_numpy(self): if not os.path.exists("Data/Splits"): subprocess.run("mkdir Data/Splits", shell=True) globs = glob.glob("Data/Full_Mats/" + self.line + "_mat_high_chr4_res_" + str(self.res) + ".npy") if len(globs) == 0: self.extract_create_numpy() print("oh were doing it") for i in [4, 16, 14, 20]: target = ut.splitPieces( "Data/Full_Mats/" + self.line + "_mat_high_chr" + str(i) + "_res_" + str(self.res) + ".npy", self.piece_size, self.step) data = ut.splitPieces( "Data/Full_Mats/" + self.line + "_mat_low_chr" + str(i) + "_res_" + str(self.res) + ".npy", self.piece_size, self.step) np.save( "Data/Splits/" + self.line + "_high_chr_" + str(i) + "_res_" + str(self.res) + "_piece_" + str(self.piece_size), target) np.save( "Data/Splits/" + self.line + "_low_chr_" + str(i) + "_res_" + str(self.res) + "_piece_" + str(self.piece_size), data)