lilab-bcb/pegasus

After loading an 10X h5 highly variable features does not run

Closed this issue · 1 comments

This makes it impossible to run subsequent analyses.

adata = pg.read_input("xxx_10x.h5")
pg.qc_metrics(adata)
pg.highly_variable_features(adata, consider_batch = False)

Traceback

--------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-40-44c88c0d83e9> in <module>
      1 pg.qc_metrics(adata)
----> 2 pg.highly_variable_features(adata, consider_batch = False)

/usr/local/lib/python3.7/dist-packages/pegasusio/decorators.py in wrapper_timer(*args, **kwargs)
     10                 def wrapper_timer(*args, **kwargs):
     11                         start = time.perf_counter()
---> 12                         result = func(*args, **kwargs)
     13                         end = time.perf_counter()
     14                         message = f"Function '{func.__name__}' finished in {{:.{precision}f}}s.".format(end - start)

/usr/local/lib/python3.7/dist-packages/pegasus/tools/hvf_selection.py in highly_variable_features(data, consider_batch, flavor, n_top, span, min_disp, max_disp, min_mean, max_mean, n_jobs)
    378 
    379     if flavor == "pegasus":
--> 380         select_hvf_pegasus(data, consider_batch, n_top=n_top, span=span)
    381     else:
    382         assert flavor == "Seurat"

/usr/local/lib/python3.7/dist-packages/pegasus/tools/hvf_selection.py in select_hvf_pegasus(data, consider_batch, n_top, span)
    132     """
    133     if "robust" not in data.var:
--> 134         raise ValueError("Please run `qc_metrics` to identify robust genes")
    135 
    136     estimate_feature_statistics(data, consider_batch)

ValueError: Please run `qc_metrics` to identify robust genes
bli25 commented

Hi @tariqdaouda, you need to first select HVGs before running PCA. Please refer to the tutorial here: https://pegasus.readthedocs.io/en/latest/_static/tutorials/pegasus_analysis.html