I have an issue at the step in which the autoencoder is pretrained only when I give a preprocess anndata object (it works if the adata object is not preprocessed beforehand):
Preprocess data step:
# fit in data
model.get_data(adata=data, # count or expression matrix, (dense or sparse) numpy array
labels = data.obs['cluster_label'], # (optional) labels, which will be converted to string
gene_names = data.var['features'], # (optional) gene names, which will be converted to string
cell_names = data.obs['sample_name'] # (optional) cell names, which will be converted to string
)
# preprocess data
model.preprocess_data(gene_num = 2000, # (optional) maximum number of influential genes to keep (the default is 2000)
data_type = 'Gaussian', # (optional) data_type can be 'UMI', 'non-UMI' or 'Gaussian' (the default is 'UMI')
npc = 64, # (optional) number of PCs to keep if data_type='Gaussian' (the default is 64)
processed=True)
Pretrain step:
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-9-2da55840b803> in <module>
3 batch_size=256, # (Optional) the batch size for pre-training (the default is 32).
4 alpha=0.10, # (Optional) the value of alpha in [0,1] to encourage covariate adjustment. Not used if there is no covariates.
----> 5 num_epoch = 300, # (Optional) the maximum number of epoches (the default is 300).
6 )
~/anaconda3/lib/python3.7/site-packages/VITAE/VITAE.py in pre_train(self, stratify, test_size, random_state, learning_rate, batch_size, L, alpha, num_epoch, num_step_per_epoch, early_stopping_patience, early_stopping_tolerance, path_to_weights)
274 batch_size,
275 self.X[id_train].astype(tf.keras.backend.floatx()),
--> 276 self.scale_factor[id_train].astype(tf.keras.backend.floatx()))
277 self.test_dataset = train.warp_dataset(self.X_normalized[id_test],
278 None if self.c_score is None else self.c_score[id_test].astype(tf.keras.backend.floatx()),
TypeError: 'NoneType' object is not subscriptable
Hello,
I have an issue at the step in which the autoencoder is pretrained only when I give a preprocess anndata object (it works if the adata object is not preprocessed beforehand):
Thank you in advance.
Best regards.