aertslab / scenicplus

SCENIC+ is a python package to build gene regulatory networks (GRNs) using combined or separate single-cell gene expression (scRNA-seq) and single-cell chromatin accessibility (scATAC-seq) data.
Other
186 stars 29 forks source link

NameError: name 'run_cistarget' is not defined #347

Closed w1973145618 closed 7 months ago

w1973145618 commented 7 months ago

Describe the bug NameError: name 'run_cistarget' is not defined

To Reproduce

from scenicplus.wrappers.run_pycistarget import *
run_pycistarget(
    region_sets = region_sets,
    ctx_db_path = rankings_db,
    species = 'homo_sapiens',
    save_path = os.path.join(work_dir, 'motifs'),
    dem_db_path = scores_db,
    run_without_promoters = True,
    biomart_host = 'http://www.ensembl.org',
    promoter_space = 500,
    ctx_auc_threshold = 0.005,
    ctx_nes_threshold = 3.0,
    ctx_rank_threshold = 0.05,
    dem_log2fc_thr = 0.5,
    dem_motif_hit_thr = 3.0,
    dem_max_bg_regions = 500,
    path_to_motif_annotations = motif_annotation,
    annotation_version = 'v10nr_clust',
    annotation = ['Direct_annot', 'Orthology_annot'],
    n_cpu = 1,
    _temp_dir = os.path.join(tmp_dir, 'ray_spill'),
    )

Error output

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Cell In[14], line 2
      1 from scenicplus.wrappers.run_pycistarget import *
----> 2 run_pycistarget(
      3     region_sets = region_sets,
      4     ctx_db_path = rankings_db,
      5     species = 'homo_sapiens',
      6     save_path = os.path.join(work_dir, 'motifs'),
      7     dem_db_path = scores_db,
      8     run_without_promoters = True,
      9     biomart_host = 'http://www.ensembl.org',
     10     promoter_space = 500,
     11     ctx_auc_threshold = 0.005,
     12     ctx_nes_threshold = 3.0,
     13     ctx_rank_threshold = 0.05,
     14     dem_log2fc_thr = 0.5,
     15     dem_motif_hit_thr = 3.0,
     16     dem_max_bg_regions = 500,
     17     path_to_motif_annotations = motif_annotation,
     18     annotation_version = 'v10nr_clust',
     19     annotation = ['Direct_annot', 'Orthology_annot'],
     20     n_cpu = 1,
     21     _temp_dir = os.path.join(tmp_dir, 'ray_spill'),
     22     )

File ~/anaconda3/envs/scenicplus311/lib/python3.11/site-packages/scenicplus/wrappers/run_pycistarget.py:191, in run_pycistarget(region_sets, species, save_path, custom_annot, save_partial, ctx_db_path, dem_db_path, run_without_promoters, biomart_host, promoter_space, ctx_auc_threshold, ctx_nes_threshold, ctx_rank_threshold, dem_log2fc_thr, dem_motif_hit_thr, dem_max_bg_regions, annotation, motif_similarity_fdr, path_to_motif_annotations, annotation_version, n_cpu, _temp_dir, exclude_motifs, exclude_collection, **kwargs)
    189 ## DEFAULT
    190 log.info('Running cisTarget for '+key)
--> 191 menr['CTX_'+key+'_All'] = run_cistarget(ctx_db = ctx_db,
    192                        region_sets = regions,
    193                        specie = species,
    194                        auc_threshold = ctx_auc_threshold,
    195                        nes_threshold = ctx_nes_threshold,
    196                        rank_threshold = ctx_rank_threshold,
    197                        annotation = annotation,
    198                        motif_similarity_fdr = motif_similarity_fdr,
    199                        path_to_motif_annotations = path_to_motif_annotations,
    200                        n_cpu = n_cpu,
    201                        _temp_dir= _temp_dir,
    202                        annotation_version = annotation_version,
    203                        **kwargs)
    204 out_folder = os.path.join(save_path,'CTX_'+key+'_All')
    205 check_folder = os.path.isdir(out_folder)

NameError: name 'run_cistarget' is not defined
SeppeDeWinter commented 7 months ago

Hi @w1973145618

Are you using the development version of the code by any chance?

All the best,

Seppe

w1973145618 commented 7 months ago

Hi @w1973145618

Are you using the development version of the code by any chance?

All the best,

Seppe

Dear Seppe: Yes, I am using the development version of the code.

SeppeDeWinter commented 7 months ago

Hi

In the development version this function does not exists anymore, please see this tutorial https://scenicplus.readthedocs.io/en/development/tutorials.html on how to use the new version of the code.

All the best,

Seppe