Skip to content

Tha maximal number of iterations maxit (set to 20 by the program) allowed for finding a smoothing spline with fp=s has been reached #633

Open

Description

@brianpenghe

I was trying to plot a heatmap using this command:
ax=sc2.pl.heatmap(adata, sorted_unique_marker_genes, groupby='ident', use_raw=False, vmin=-3, vmax=3, cmap='bwr',show=True, var_group_rotation=0, dendrogram=True, save='ClusterMap.png')

And it didn't finish running after an overnight, with the following warning message:
WARNING: Gene labels are not shown when more than 50 genes are visualized. To show gene labels set show_gene_labels=True
/usr/local/lib/python3.6/dist-packages/scipy/interpolate/fitpack2.py:227: UserWarning:
The maximal number of iterations maxit (set to 20 by the program)
allowed for finding a smoothing spline with fp=s has been reached: s
too small.
There is an approximation returned but the corresponding weighted sum
of squared residuals does not satisfy the condition abs(fp-s)/s < tol.
warnings.warn(message)

I don't understand why this is taking this long because seaborn was able to finish plotting within 30 minutes. Do you know why?

Activity

  1. fidelram commented on May 9, 2019

    @fidelram
    Collaborator
  2. brianpenghe commented on May 9, 2019

    @brianpenghe
    Author

    Thanks for your information. I am surprised that this step is taking too long as is was supposed to reduce the plotting time. I would not wait for more than 5 minutes to see a plot. How many genes were you planning to plot? The background is that when plotting a heatmap, the matplotlib visualization will randomly drop genes because the resolution of the screens is not high enough. Thus, when the number of genes is large, I was trying to find a compromise by fitting a line before the plotting and then only plotting the fit. Can you help me solve the issue by sharing the data with me? Or, can you find an example that can reproduce the problem?
    …
    On Tue, May 7, 2019 at 10:19 AM brianpenghe @.***> wrote: I was trying to plot a heatmap using this command: ax=sc2.pl.heatmap(adata, sorted_unique_marker_genes, groupby='ident', use_raw=False, vmin=-3, vmax=3, cmap='bwr',show=True, var_group_rotation=0, dendrogram=True, save='ClusterMap.png') And it didn't finish running after an overnight, with the following warning message: WARNING: Gene labels are not shown when more than 50 genes are visualized. To show gene labels set show_gene_labels=True /usr/local/lib/python3.6/dist-packages/scipy/interpolate/fitpack2.py:227: UserWarning: The maximal number of iterations maxit (set to 20 by the program) allowed for finding a smoothing spline with fp=s has been reached: s too small. There is an approximation returned but the corresponding weighted sum of squared residuals does not satisfy the condition abs(fp-s)/s < tol. warnings.warn(message) I don't understand why this is taking this long because seaborn was able to finish plotting within 30 minutes. Do you know why? — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#633>, or mute the thread https://github.com/notifications/unsubscribe-auth/ABF37VNDX37RZL256MWKDM3PUE3RFANCNFSM4HLGOYGA .
    -- Fidel Ramirez

    I was planning to plot a heatmap of 300 genes. However, I have 90k cells. I guess the time-consuming part is the PCA because that's what's required to do the clustering by groups. I thought a naive way to do the clustering is just to construct the "pseudobulks" for each group by calculating the average and then simply clustering the "pseudobulks", instead of trying to look at individual cells. Another advantage of checking the pseudobulk is that the size of each group won't affect the landscape of principle components in that way?

  3. eveolsza commented on Apr 1, 2020

    @eveolsza

    I have the same issue than @brianpenghe .
    I am trying to plot a heatmap using:
    sc.pl.heatmap(adata_10x_day13_MPCs_early, output_great_1090, groupby='condition', use_raw=False, vmin=-3, vmax=3, cmap='bwr',show=True, var_group_rotation=0, dendrogram=True)

    n_cells = 1071
    n_genes = 1121

    I got this message as well:

    WARNING: Gene labels are not shown when more than 50 genes are visualized. To show gene labels set show_gene_labels=True

    /home/grupos_srs_ap/Programs/anaconda3/lib/python3.7/site-packages/scipy/interpolate/fitpack2.py:227: UserWarning:
    The maximal number of iterations maxit (set to 20 by the program)
    allowed for finding a smoothing spline with fp=s has been reached: s
    too small.
    There is an approximation returned but the corresponding weighted sum
    of squared residuals does not satisfy the condition abs(fp-s)/s < tol.
    warnings.warn(message)

    The heatmap was plotted after few minutes, though:
    image

    I think the plot is not correct.

    I tried modifying the scanpy/plotting/_anndata.py, removing the smoothing function as described above, but got the same results.

    Can you help me?
    Thanks a lot in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions