luxai commited on
Commit
09c71ee
1 Parent(s): f8fd7df

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. yolksac_human.py +3 -2
yolksac_human.py CHANGED
@@ -124,13 +124,14 @@ class RNAExp(datasets.ArrowBasedBuilder):
124
  def _generate_tables(self, expression_file,batch_size,split):
125
  idx = 0
126
  adata = ad.read_h5ad(expression_file)
127
- self.info.description = adata.var.index.str.lower().tolist() #"+".join(adata.var.index.str.lower().tolist())
128
- self.column_names = adata.var.index.str.lower().tolist()
129
  for batch in range(0,adata.shape[0],batch_size):
130
  chunk = adata.X[batch:batch+batch_size].todense().astype('int32')
131
  df = pd.DataFrame(chunk,columns=adata.var.index.str.lower())
132
  df["raw_counts"] = [x for x in df.to_numpy()]
133
  df = df[["raw_counts"]]
 
 
134
  df[",".join(adata.var.index.str.lower().tolist())] = True
135
  for feature in self.config.features:
136
  if feature != "raw_counts":
 
124
  def _generate_tables(self, expression_file,batch_size,split):
125
  idx = 0
126
  adata = ad.read_h5ad(expression_file)
127
+ # self.info.description = adata.var.index.str.lower().tolist() #"+".join(adata.var.index.str.lower().tolist())
 
128
  for batch in range(0,adata.shape[0],batch_size):
129
  chunk = adata.X[batch:batch+batch_size].todense().astype('int32')
130
  df = pd.DataFrame(chunk,columns=adata.var.index.str.lower())
131
  df["raw_counts"] = [x for x in df.to_numpy()]
132
  df = df[["raw_counts"]]
133
+ ## We create a dummy column with all the names of the genes as list. We don't use this as value since this would unnecessarily increase the size of the dataset
134
+ ## Another option would be to replace the description with the list of genes
135
  df[",".join(adata.var.index.str.lower().tolist())] = True
136
  for feature in self.config.features:
137
  if feature != "raw_counts":