tanaylab / metacells

Metacells - Single-cell RNA Sequencing Analysis
MIT License
86 stars 8 forks source link

Why do i got ValueError: Empty feature data, giving up #33

Open chansigit opened 1 year ago

chansigit commented 1 year ago

I always got this error when running divide_and_conquer_pipeline. Why?

     64 @ut.logged()
     65 @ut.timed_call()
     66 @ut.expand_doc()
   (...)
    114     random_seed: int = pr.random_seed,
    115 ) -> AnnData:
    116     """
    117     Directly compute metacells using ``what`` (default: {what}) data.
    118 
   (...)
    278        ``dissolve_min_metacell_cells`` (default: ``dissolve_min_metacell_cells``).
    279     """
--> 280     fdata = extract_feature_data(
    281         adata,
    282         what,
    283         top_level=False,
    284         downsample_min_samples=feature_downsample_min_samples,
    285         downsample_min_cell_quantile=feature_downsample_min_cell_quantile,
    286         downsample_max_cell_quantile=feature_downsample_max_cell_quantile,
    287         min_gene_relative_variance=feature_min_gene_relative_variance,
    288         min_gene_total=feature_min_gene_total,
    289         min_gene_top3=feature_min_gene_top3,
    290         forced_gene_names=feature_gene_names,
    291         forced_gene_patterns=feature_gene_patterns,
    292         forbidden_gene_names=forbidden_gene_names,
    293         forbidden_gene_patterns=forbidden_gene_patterns,
    294         random_seed=random_seed,
    295     )
    297     if fdata is None:
    298         raise ValueError("Empty feature data, giving up")

File ~/anaconda3/envs/celltensor/lib/python3.8/site-packages/metacells/utilities/logging.py:373, in logged.<locals>.wrap.<locals>.wrapper(*args, **kwargs)
    368             if log_value is not None:
    369                 logger().log(
    370                     param_level, "%swith %s: %s", INDENT_SPACES[: 2 * INDENT_LEVEL], name, log_value
    371                 )
--> 373     return function(*args, **kwargs)
    375 finally:
    376     if logger().isEnabledFor(step_level):

File ~/anaconda3/envs/celltensor/lib/python3.8/site-packages/metacells/pipeline/feature.py:147, in extract_feature_data(adata, what, name, downsample_min_samples, downsample_min_cell_quantile, downsample_max_cell_quantile, min_gene_relative_variance, min_gene_total, min_gene_top3, forced_gene_names, forced_gene_patterns, forbidden_gene_names, forbidden_gene_patterns, random_seed, top_level)
    142 results = tl.filter_data(
    143     adata, name=name, top_level=top_level, track_var="full_gene_index", mask_var="feature_gene", var_masks=var_masks
    144 )
    146 if results is None:
--> 147     raise ValueError("Empty feature data, giving up")
    149 return results[0]

ValueError: Empty feature data, giving up

here is my code:

mc.pl.divide_and_conquer_pipeline(abm2,
                                 forbidden_gene_names=forbidden_gene_names_abm2,
                                 target_metacell_size=160000,
                                      random_seed=19940929)
orenbenkiki commented 1 year ago

Hmmm - that might indicate your data doesn't contain sufficiently variable data, so no genes satisfy the conditions for being "feature genes". Which "shouldn't" really happen. Is the data special in some way?

orenbenkiki commented 1 year ago

Just published version 0.9 which is different than 0.8 - perhaps you cloud try again and see if the problem persists?