theislab / scarches

Reference mapping for single-cell genomics
https://docs.scarches.org/en/latest/
BSD 3-Clause "New" or "Revised" License
327 stars 51 forks source link

scarches.models has no attribute scgen #66

Closed ShaowenJ closed 3 years ago

ShaowenJ commented 3 years ago

Hi,

I was following the tutorial of Reference maping using scGen. But stuck with the initial step Here is the ERROR image

And here is my following code

import os import sys sys.path.insert(0, "../")

import warnings warnings.simplefilter(action='ignore', category=FutureWarning) warnings.simplefilter(action='ignore', category=UserWarning) import scanpy as sc import scarches as sca from scarches.dataset.trvae.data_handling import remove_sparsity import matplotlib.pyplot as plt import numpy as np import gdown sc.settings.set_figure_params(dpi=200, frameon=False) sc.set_figure_params(dpi=200) sc.set_figure_params(figsize=(4, 4))

condition_key = 'study' cell_type_key = 'cell_type' target_conditions = ['Pancreas CelSeq2', 'Pancreas SS2']

epoch = 50

early_stopping_kwargs = { "early_stopping_metric": "val_loss", "patience": 20, "threshold": 0, "reduce_lr": True, "lr_patience": 13, "lr_factor": 0.1, } adata = sc.read('../pancreas.h5ad') adata = remove_sparsity(adata) # remove sparsity source_adata = adata[~adata.obs[condition_key].isin(target_conditions)].copy() target_adata = adata[adata.obs[condition_key].isin(target_conditions)].copy()

network = sca.models.scgen(adata = source_adata, hidden_layer_sizes=[256,128])

ShaowenJ commented 3 years ago

My scArches version image

Koncopd commented 3 years ago

Yes, thanks, it is not in the latest release yet, but it is on master.

ShaowenJ commented 3 years ago

Thanks for the response? Can I take a trial? Where to download the master?

M0hammadL commented 3 years ago

you can siply clone the repo and pip install -e .

ShaowenJ commented 3 years ago

Great, thanks.