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
167 stars 27 forks source link

TF_cistrome_correlation (silently) returns empty DataFrame #150

Open fumi-github opened 1 year ago

fumi-github commented 1 year ago

After executing TF_cistrome_correlation in the 10x multiome pbmc tutorial, scplus_obj.uns['TF_cistrome_correlation']['filtered_gene_based'] was an empty DataFrame.

In the definition of TF_cistrome_correlation in cistromes.py appears

corr_df = corr_df.append(pd.DataFrame(
   data=x, index=[0]), ignore_index=True)

When debugging, I noticed AttributeError: 'DataFrame' object has no attribute 'append' It seems that, as of pandas version 2.0.0, the append() method has been removed.

I could solve the problem by rewriting to

corr_df = pd.concat([corr_df, pd.DataFrame(data=x, index=[0])])

Sorry for not submitting a pull request, as I am still a beginner in Python. Last but not least, thank you for the awesome program.

Fumi

SeppeDeWinter commented 1 year ago

@fumi-github

Thank you for the bug report and the kind words.

I just committed a change (https://github.com/aertslab/scenicplus/commit/26677cb9dd914d549311877823866ef9b01b192c) to fix the pandas version to 1.5 as we were encountering other issues.

Indeed, pd.concat instead of append will be the correct solution here.

Best,

Seppe