aertslab / pycisTopic

pycisTopic is a Python module to simultaneously identify cell states and cis-regulatory topics from single cell epigenomics data.
Other
56 stars 10 forks source link

Bug report [compute_qc_stats update with v2 is no longer compatible with v1.01 workflow] #157

Closed ethanfenton closed 2 weeks ago

ethanfenton commented 3 weeks ago

Describe the bug compute_qc_stats gives an error from input formatting. I believe stemming from switch from pycisTopic v1.01 to v2. Help adapting my current code to be compatible with the new version would be much appreciated

To Reproduce

metadata_bc, profile_data_dict = compute_qc_stats(fragments_df_pl = fragments_dict,
                regions_df_pl = path_to_regions,
                tss_annotation = annot)
                metadata_bc, profile_data_dict = compute_qc_stats(fragments_dict = fragments_dict,
                tss_annotation = annot,
                 stats=['barcode_rank_plot', 'duplicate_rate', 'insert_size_distribution', 'profile_tss', 'frip'],
                 label_list = None,
                 path_to_regions = path_to_regions,
                n_cpu = 5,
                valid_bc = None,
                n_frag = 100,
                 n_bc = None,
                 tss_flank_window = 1000,
                 tss_window = 50,
                tss_minimum_signal_window = 100,
                 tss_rolling_window = 10,
                 remove_duplicates = True,
                 _temp_dir = tmpDir + 'ray_spill')

Error output TypeError: compute_qc_stats() got an unexpected keyword argument 'fragments_dict'

Expected behavior It appears that compute_qc_stats has been updated in v2 from v1.01 but the notebook I am following Cortex_pycisTopic.ipynb seems to guide me though preparing the inputs for the old version (fragments_dict instead of a pl.DataFrame

This is the new function to which my inputs do not match:

<function pycisTopic.qc.compute_qc_stats(fragments_df_pl: 'pl.DataFrame', regions_df_pl: 'pl.DataFrame', tss_annotation: 'pl.DataFrame', tss_flank_window: 'int' = 2000, tss_smoothing_rolling_window: 'int' = 10, tss_minimum_signal_window: 'int' = 100, tss_window: 'int' = 50, tss_min_norm: 'float' = 0.2, use_genomic_ranges: 'bool' = True, min_fragments_per_cb: 'int' = 10, collapse_duplicates: 'bool' = True, no_threads: 'int' = 8) -> 'tuple[pl.DataFrame, pl.DataFrame, pl.DataFrame, pl.DataFrame]'>

Version (please complete the following information):

Additional context This is the notebook I am using: https://github.com/aertslab/pycisTopic/blob/main/notebooks/Cortex_pycisTopic.ipynb

SeppeDeWinter commented 2 weeks ago

Hi @ethanfenton

That's right, this function has been updated. Please follow this tutorial: https://pycistopic.readthedocs.io/en/latest/tutorials.html.

Hopefully this helps?

All the best,

Seppe

ethanfenton commented 2 weeks ago

Thanks @SeppeDeWinter! This is running smoothly

SeppeDeWinter commented 2 weeks ago

Hi @ethanfenton

Great!!

Best,

Seppe