Help with SCENIC+
1
0
Entering edit mode
13 months ago
Chris ▴ 340

Hi Biostars,

I try to run SCENIC + tutorial and had error at this cell:

from scenicplus.wrappers.run_pycistarget import run_pycistarget
run_pycistarget(
    region_sets = region_sets,
    species = 'homo_sapiens',
    save_path = os.path.join(work_dir, 'motifs'),
    ctx_db_path = rankings_db,
    dem_db_path = scores_db,
    path_to_motif_annotations = motif_annotation,
    run_without_promoters = True,
    n_tpu = 1,
    _temp_dir = os.path.join(tmp_dir, 'ray_spill'),
    annotation_version = 'v10nr_clust',
    )
AssertionError                            Traceback (most recent call last)
Input In [61], in <cell line: 2>()
      1 from scenicplus.wrappers.run_pycistarget import run_pycistarget
----> 2 run_pycistarget(
      3     region_sets = region_sets,
      4     species = 'homo_sapiens',
      5     save_path = os.path.join(work_dir, 'motifs'),
      6     ctx_db_path = rankings_db,
      7     dem_db_path = scores_db,
      8     path_to_motif_annotations = motif_annotation,
      9     run_without_promoters = True,
     10     n_tpu = 1,
     11     _temp_dir = os.path.join(tmp_dir, 'ray_spill'),
     12     annotation_version = 'v10nr_clust',
     13     )

File /apps/software/jupyter/python_3.9/lib/python3.9/site-packages/scenicplus/wrappers/run_pycistarget.py:182, 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)
    180 ## CISTARGET
    181 regions = region_sets[key]
--> 182 ctx_db = cisTargetDatabase(ctx_db_path, regions)  
    183 if exclude_motifs is not None:
    184     out = pd.read_csv(exclude_motifs, header=None).iloc[:,0].tolist()

File /apps/software/jupyter/python_3.9/lib/python3.9/site-packages/pycistarget/motif_enrichment_cistarget.py:67, in cisTargetDatabase.__init__(self, fname, region_sets, name, fraction_overlap)
     48 def __init__(self, 
     49             fname: str,
     50             region_sets: Union[Dict[str, pr.PyRanges], pr.PyRanges] = None,
     51             name: str = None,
     52             fraction_overlap: float = 0.4):
     53     """
     54     Initialize cisTargetDatabase
     55     
   (...)
     65         Minimal overlap between query and regions in the database for the mapping.     
     66     """
---> 67     self.regions_to_db, self.db_rankings, self.total_regions = self.load_db(fname,
     68                                                       region_sets,
     69                                                       name,
     70                                                       fraction_overlap)

File /apps/software/jupyter/python_3.9/lib/python3.9/site-packages/pycistarget/motif_enrichment_cistarget.py:110, in cisTargetDatabase.load_db(self, fname, region_sets, name, fraction_overlap)
    108 if name is None:
    109     name = os.path.basename(fname)
--> 110 db = FeatherRankingDatabase(fname, name=name)
    111 total_regions = db.total_genes
    112 db_regions = db.genes

File /apps/software/jupyter/python_3.9/lib/python3.9/site-packages/ctxcore/rnkdb.py:106, in FeatherRankingDatabase.__init__(self, fname, name)
     98 """
     99 Create a new feather database.
    100 
    101 :param fname: The filename of the database.
    102 :param name: The name of the database.
    103 """
    104 super().__init__(name=name)
--> 106 assert os.path.isfile(fname), """Database "{fname}" doesn't exist."""
    108 self._fname = fname
    109 self.ct_db = CisTargetDatabase.init_ct_db(
    110     ct_db_filename=self._fname, engine="pyarrow"
    111 )
    AssertionError: Database "{fname}" doesn't exist.

I downloaded 3 files that requires:

rankings_db = os.path.join(db_fpath, 'cluster_SCREEN.regions_vs_motifs.rankings.v2.feather')
scores_db =  os.path.join(db_fpath, 'cluster_SCREEN.regions_vs_motifs.scores.v2.feather')
motif_annotation = os.path.join(motif_annot_fpath, 'motifs-v10-nr.hgnc-m0.00001-o0.0.tbl')

Would you please have a look? Thank you so much!

scenic-plus • 723 views
ADD COMMENT
1
Entering edit mode
8 months ago
corbettberry ▴ 10

I suspect you saved your .feather and your .tbl as different names than what was included in the tutorial. Hope that helps!

ADD COMMENT

Login before adding your answer.

Traffic: 1657 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6