scDRS icon indicating copy to clipboard operation
scDRS copied to clipboard

TypeError: plot_group_stats() got an unexpected keyword argument 'plot_kws'

Open Huiflorazhan opened this issue 1 year ago • 9 comments

when I was trying to visualize the group level statistics, I encountered this error. Could you please help me with this? Thank you for your time!

TypeError: plot_group_stats() got an unexpected keyword argument 'plot_kws'

Here is the code.

dict_df_stats = {
    trait: pd.read_csv(f"/mnt/data1/home/zhanh1/scDRS_work/AD_SCH_Height/results/{trait}.scdrs_group.cell_type", sep="\t", index_col=0)
    for trait in ["AD", "Height"]
}
fig, ax = scdrs.util.plot_group_stats(
    dict_df_stats,
    plot_kws={
        "vmax": 0.2,
        "cb_fraction":0.12
    }
)

Huiflorazhan avatar Feb 16 '24 03:02 Huiflorazhan

Hi can you check what version are you using? scdrs.__version__

This issue should be resolved with pip install -U scdrs

KangchengHou avatar Feb 16 '24 04:02 KangchengHou

Hi can you check what version are you using? scdrs.__version__

This issue should be resolved with pip install -U scdrs

The version is 1.0.2. But I still got this error.

Huiflorazhan avatar Feb 16 '24 17:02 Huiflorazhan

Can you try again to install the latest master branch?

git clone https://github.com/martinjzhang/scDRS.git
cd scDRS
git checkout -b v102 v1.0.2
pip install -e .

You may also try to remove plot_kws:

fig, ax = scdrs.util.plot_group_stats(dict_df_stats)

KangchengHou avatar Feb 16 '24 17:02 KangchengHou

Can you try again to install the latest master branch?

git clone https://github.com/martinjzhang/scDRS.git
cd scDRS
git checkout -b v102 v1.0.2
pip install -e .

You may also try to remove plot_kws:

fig, ax = scdrs.util.plot_group_stats(dict_df_stats)

If I remove plot_kws, I got another error.

TypeError: cannot unpack non-iterable NoneType object

Sorry I tried both ways to install scdrs, but the error still exist.

Huiflorazhan avatar Feb 16 '24 18:02 Huiflorazhan

Can you type

??scdrs.util.plot_group_stats

So we can see the code that you are using

On Fri, Feb 16, 2024 at 10:13 AM Huiflorazhan @.***> wrote:

Can you try again to install the latest master branch?

git clone https://github.com/martinjzhang/scDRS.git cd scDRS git checkout -b v102 v1.0.2 pip install -e .

You may also try to remove plot_kws:

fig, ax = scdrs.util.plot_group_stats(dict_df_stats)

If I remove plot_kws, I got another error.

TypeError: cannot unpack non-iterable NoneType object

Sorry I tried both ways to install scdrs, but the error still exist.

— Reply to this email directly, view it on GitHub https://github.com/martinjzhang/scDRS/issues/81#issuecomment-1949027597, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEI5RPDB7WQM2RRVZZOLAVTYT6OURAVCNFSM6AAAAABDLLJ6VCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBZGAZDONJZG4 . You are receiving this because you commented.Message ID: @.***>

KangchengHou avatar Feb 16 '24 18:02 KangchengHou

Can you type ??scdrs.util.plot_group_stats So we can see the code that you are using On Fri, Feb 16, 2024 at 10:13 AM Huiflorazhan @.> wrote: Can you try again to install the latest master branch? git clone https://github.com/martinjzhang/scDRS.git cd scDRS git checkout -b v102 v1.0.2 pip install -e . You may also try to remove plot_kws: fig, ax = scdrs.util.plot_group_stats(dict_df_stats) If I remove plot_kws, I got another error. TypeError: cannot unpack non-iterable NoneType object Sorry I tried both ways to install scdrs, but the error still exist. — Reply to this email directly, view it on GitHub <#81 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEI5RPDB7WQM2RRVZZOLAVTYT6OURAVCNFSM6AAAAABDLLJ6VCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBZGAZDONJZG4 . You are receiving this because you commented.Message ID: @.> The output is

Signature:
scdrs.util.plot_group_stats(
    dict_df_stats=None,
    df_fdr_prop=None,
    df_assoc_fdr=None,
    df_hetero_fdr=None,
)
Docstring:
plot group-level statistics for scDRS results

Parameters
----------
dict_df_stats: Dict
    dictionary from trait -> pd.DataFrame
    group-level statistics from `scdrs perform-downstream: group-analysis`
    see https://martinjzhang.github.io/scDRS/notebooks/quickstart.html for an
    example. Alternatively, df_fdr_prop, df_assoc_fdr, df_hetero_fdr can be
    separately provided.
df_fdr_prop : pd.DataFrame
    dataframe of proportion of cells with FDR < 0.1
df_assoc : pd.DataFrame
    dataframe of group-level association statistics
df_hetero : pd.DataFrame
    dataframe of group-level heterogeneity statistics
File:      [~/miniconda3/envs/scDRS/lib/python3.12/site-packages/scdrs/util.py](https://vscode-remote+ssh-002dremote-002b10-002e238-002e4-002e144.vscode-resource.vscode-cdn.net/mnt/data1/home/zhanh1/scDRS_work/~/miniconda3/envs/scDRS/lib/python3.12/site-packages/scdrs/util.py)
Type:      function

Huiflorazhan avatar Feb 16 '24 19:02 Huiflorazhan

This does not correspond to the version in the master branch. You can try to uninstall and reinstall the software to resolve this. Please let me know this issue retains

On Fri, Feb 16, 2024 at 11:10 AM Huiflorazhan @.***> wrote:

Can you type ??scdrs.util.plot_group_stats So we can see the code that you are using … <#m_-931519290562667141_> On Fri, Feb 16, 2024 at 10:13 AM Huiflorazhan @.> wrote: Can you try again to install the latest master branch? git clone https://github.com/martinjzhang/scDRS.git https://github.com/martinjzhang/scDRS.git cd scDRS git checkout -b v102 v1.0.2 pip install -e . You may also try to remove plot_kws: fig, ax = scdrs.util.plot_group_stats(dict_df_stats) If I remove plot_kws, I got another error. TypeError: cannot unpack non-iterable NoneType object Sorry I tried both ways to install scdrs, but the error still exist. — Reply to this email directly, view it on GitHub <#81 (comment) https://github.com/martinjzhang/scDRS/issues/81#issuecomment-1949027597>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEI5RPDB7WQM2RRVZZOLAVTYT6OURAVCNFSM6AAAAABDLLJ6VCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBZGAZDONJZG4 https://github.com/notifications/unsubscribe-auth/AEI5RPDB7WQM2RRVZZOLAVTYT6OURAVCNFSM6AAAAABDLLJ6VCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBZGAZDONJZG4 . You are receiving this because you commented.Message ID: @.> The output is

Signature:scdrs.util.plot_group_stats( dict_df_stats=None, df_fdr_prop=None, df_assoc_fdr=None, df_hetero_fdr=None, )Docstring:plot group-level statistics for scDRS results Parameters----------dict_df_stats: Dict dictionary from trait -> pd.DataFrame group-level statistics from scdrs perform-downstream: group-analysis see https://martinjzhang.github.io/scDRS/notebooks/quickstart.html for an example. Alternatively, df_fdr_prop, df_assoc_fdr, df_hetero_fdr can be separately provided.df_fdr_prop : pd.DataFrame dataframe of proportion of cells with FDR < 0.1df_assoc : pd.DataFrame dataframe of group-level association statisticsdf_hetero : pd.DataFrame dataframe of group-level heterogeneity statisticsFile: ~/miniconda3/envs/scDRS/lib/python3.12/site-packages/scdrs/util.pyType: function

— Reply to this email directly, view it on GitHub https://github.com/martinjzhang/scDRS/issues/81#issuecomment-1949146887, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEI5RPHHH5ZL72CAEFLW6S3YT6VKDAVCNFSM6AAAAABDLLJ6VCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBZGE2DMOBYG4 . You are receiving this because you commented.Message ID: @.***>

KangchengHou avatar Feb 16 '24 19:02 KangchengHou

This does not correspond to the version in the master branch. You can try to uninstall and reinstall the software to resolve this. Please let me know this issue retains On Fri, Feb 16, 2024 at 11:10 AM Huiflorazhan @.> wrote: Can you type ??scdrs.util.plot_group_stats So we can see the code that you are using … <#m_-931519290562667141_> On Fri, Feb 16, 2024 at 10:13 AM Huiflorazhan @.> wrote: Can you try again to install the latest master branch? git clone https://github.com/martinjzhang/scDRS.git https://github.com/martinjzhang/scDRS.git cd scDRS git checkout -b v102 v1.0.2 pip install -e . You may also try to remove plot_kws: fig, ax = scdrs.util.plot_group_stats(dict_df_stats) If I remove plot_kws, I got another error. TypeError: cannot unpack non-iterable NoneType object Sorry I tried both ways to install scdrs, but the error still exist. — Reply to this email directly, view it on GitHub <#81 (comment) <#81 (comment)>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEI5RPDB7WQM2RRVZZOLAVTYT6OURAVCNFSM6AAAAABDLLJ6VCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBZGAZDONJZG4 https://github.com/notifications/unsubscribe-auth/AEI5RPDB7WQM2RRVZZOLAVTYT6OURAVCNFSM6AAAAABDLLJ6VCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBZGAZDONJZG4 . You are receiving this because you commented.Message ID: @.> The output is Signature:scdrs.util.plot_group_stats( dict_df_stats=None, df_fdr_prop=None, df_assoc_fdr=None, df_hetero_fdr=None, )Docstring:plot group-level statistics for scDRS results Parameters----------dict_df_stats: Dict dictionary from trait -> pd.DataFrame group-level statistics from scdrs perform-downstream: group-analysis see https://martinjzhang.github.io/scDRS/notebooks/quickstart.html for an example. Alternatively, df_fdr_prop, df_assoc_fdr, df_hetero_fdr can be separately provided.df_fdr_prop : pd.DataFrame dataframe of proportion of cells with FDR < 0.1df_assoc : pd.DataFrame dataframe of group-level association statisticsdf_hetero : pd.DataFrame dataframe of group-level heterogeneity statisticsFile: ~/miniconda3/envs/scDRS/lib/python3.12/site-packages/scdrs/util.pyType: function — Reply to this email directly, view it on GitHub <#81 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEI5RPHHH5ZL72CAEFLW6S3YT6VKDAVCNFSM6AAAAABDLLJ6VCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBZGE2DMOBYG4 . You are receiving this because you commented.Message ID: @.**>

Hello, I have also encountered this issue, but I am confident that I followed the standard installation process

Y-Isaac avatar Apr 24 '24 06:04 Y-Isaac

@KangchengHou

When I used version 1.0.3, this issue was resolved. Thank you!

Y-Isaac avatar Apr 24 '24 09:04 Y-Isaac

This does not correspond to the version in the master branch. You can try to uninstall and reinstall the software to resolve this. Please let me know this issue retains On Fri, Feb 16, 2024 at 11:10 AM Huiflorazhan @.> wrote: Can you type ??scdrs.util.plot_group_stats So we can see the code that you are using … <#m-931519290562667141> On Fri, Feb 16, 2024 at 10:13 AM Huiflorazhan @.> wrote: Can you try again to install the latest master branch? git clone https://github.com/martinjzhang/scDRS.git https://github.com/martinjzhang/scDRS.git cd scDRS git checkout -b v102 v1.0.2 pip install -e . You may also try to remove plot_kws: fig, ax = scdrs.util.plot_group_stats(dict_df_stats) If I remove plot_kws, I got another error. TypeError: cannot unpack non-iterable NoneType object Sorry I tried both ways to install scdrs, but the error still exist. — Reply to this email directly, view it on GitHub <#81 (comment) <#81 (comment)>>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEI5RPDB7WQM2RRVZZOLAVTYT6OURAVCNFSM6AAAAABDLLJ6VCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBZGAZDONJZG4 https://github.com/notifications/unsubscribe-auth/AEI5RPDB7WQM2RRVZZOLAVTYT6OURAVCNFSM6AAAAABDLLJ6VCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBZGAZDONJZG4 . You are receiving this because you commented.Message ID: @.> The output is Signature:scdrs.util.plot_group_stats( dict_df_stats=None, df_fdr_prop=None, df_assoc_fdr=None, df_hetero_fdr=None, )Docstring:plot group-level statistics for scDRS results Parameters----------dict_df_stats: Dict dictionary from trait -> pd.DataFrame group-level statistics from scdrs perform-downstream: group-analysis see https://martinjzhang.github.io/scDRS/notebooks/quickstart.html for an example. Alternatively, df_fdr_prop, df_assoc_fdr, df_hetero_fdr can be separately provided.df_fdr_prop : pd.DataFrame dataframe of proportion of cells with FDR < 0.1df_assoc : pd.DataFrame dataframe of group-level association statisticsdf_hetero : pd.DataFrame dataframe of group-level heterogeneity statisticsFile: ~/miniconda3/envs/scDRS/lib/python3.12/site-packages/scdrs/util.pyType: function — Reply to this email directly, view it on GitHub <#81 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEI5RPHHH5ZL72CAEFLW6S3YT6VKDAVCNFSM6AAAAABDLLJ6VCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNBZGE2DMOBYG4 . You are receiving this because you commented.Message ID: @.**>

Hello, I have also encountered this issue, but I am confident that I followed the standard installation process

Hello, how can you fix the bugs. I encountered the same problem, but it was not solved after I reinstalled it. According to the reply above, I think it can be solved by reinstalling 1.0.3, but I did not find the installation package of 1.0.3. Your dedicate would be appreciated

sysucclwc avatar Jun 08 '24 15:06 sysucclwc

@Y-Isaac

sysucclwc avatar Jun 08 '24 15:06 sysucclwc

@KangchengHou

martinjzhang avatar Jun 09 '24 02:06 martinjzhang

@sysucclwc Hi, you can simply type the code: pip install git+https://github.com/martinjzhang/scDRS.git to get the v1.0.3, hope this can help you.

Y-Isaac avatar Jun 09 '24 05:06 Y-Isaac

@sysucclwc Hi, you can simply type the code: pip install git+https://github.com/martinjzhang/scDRS.git to get the v1.0.3, hope this can help you.

Thanks for your reply. According to your kind suggestion, I re-installed the scDRS in version 1.0.3, the reminds about plot_kws disappear but another issue about matplotlib.cm appeared called "AttributeError: module 'matplotlib.cm' has no attribute 'get_cmap'“,I wonder if the version of matplotlib(v3.9.0) conflicts with the version of scDRS(v 1.0.3)? @Y-Isaac @KangchengHou

sysucclwc avatar Jun 10 '24 03:06 sysucclwc

@sysucclwc yes this is most likely a matplotlib version issue, pip install matplotlib==3.7.3 may work

KangchengHou avatar Jun 10 '24 03:06 KangchengHou

@sysucclwc yes this is most likely a matplotlib version issue, pip install matplotlib==3.7.3 may work Sincerely appreciate your help. It works. Best regards

sysucclwc avatar Jun 10 '24 03:06 sysucclwc