tubiana / TTClust

clusterize molecular dynamic trajectories (amber, gromacs, charmm, namd, pdb...)
Other
106 stars 36 forks source link

ValueError: 'c' argument #33

Closed qasimpars closed 1 year ago

qasimpars commented 1 year ago

Hi,

Do you know how I can fix the below error?

ttclust -f trajectory.xtc -t reference.pdb -sa none -cc 0.6 -sr all

....
AVERAGE RSMD BETWEEN CLUSTERS : 4.90
Traceback (most recent call last):
  File "/home/user/anaconda3/bin/ttclust", line 10, in <module>
    sys.exit(main())
  File "/home/user/anaconda3/lib/python3.7/site-packages/ttclust/ttclust.py", line 1412, in main
    traj = Cluster_analysis_call(args)
  File "/home/user/anaconda3/lib/python3.7/site-packages/ttclust/ttclust.py", line 1365, in Cluster_analysis_call
    plot_2D_distance_projection(RMSD_matrix, clusters_list, colors_list, logname)
  File "/home/user/anaconda3/lib/python3.7/site-packages/ttclust/ttclust.py", line 1147, in plot_2D_distance_projection
    scatter = ax.scatter(x, y, s=radii, c=colors, alpha=0.5)
  File "/home/user/anaconda3/lib/python3.7/site-packages/matplotlib/__init__.py", line 1438, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "/home/user/anaconda3/lib/python3.7/site-packages/matplotlib/cbook/deprecation.py", line 411, in wrapper
    return func(*inner_args, **inner_kwargs)
  File "/home/user/anaconda3/lib/python3.7/site-packages/matplotlib/axes/_axes.py", line 4453, in scatter
    get_next_color_func=self._get_patches_for_fill.get_next_color)
  File "/home/user/anaconda3/lib/python3.7/site-packages/matplotlib/axes/_axes.py", line 4307, in _parse_scatter_color_args
    raise invalid_shape_exception(len(colors), xsize)
ValueError: 'c' argument has 6 elements, which is inconsistent with 'x' and 'y' with size 5.
tubiana commented 1 year ago

Hi !

Maybe it is because of the matplotlib version... I don't specify the version in the requirement so maybe your version is too recent.

Can you try to downgrade it with something like conda install matplotlib=3.1 (for example) ?

qasimpars commented 1 year ago

Hi,

I downgraded thematploblib-3.3.2 with 3.1.2 but it didn't solve the problem.

Alok62877 commented 1 year ago
(base) alok@ar:/media/alok/seagate/18$ ttclust -f 1_water.dcd -t data.pdb
********************************************************
******************  TTCLUST 4.10.1 *********************
********************************************************

======= TRAJECTORY READING =======
====== Clustering ========
         creating distance matrix
ERROR : ALIGNEMENT selection string not valid
        >backbone
        >Selection list EMPTY

how to fix this error In my simulation there are 50 palladium atoms and 7000 H2O molecules (Total number of atoms 21050) image

tubiana commented 1 year ago

@Alok62877 By reading the documentation. Per default the selection is "backbone" which is stricly specific to proteins. You have to adapt the selection on what you want to cluster. As far as I understand you have free paladium and free water. TTClust was made for proteins, I don't think that it will work on your system. The calculation is based on the RMSD distance matrix, 1 descriptor per frame. Pairwise with other frame. you have "free" atoms moving around in your simulation box, I don't think it will make sense. Also small tip for github : open a new issue instead of commenting a issue with a different problem ;)

@qasimpars I'm sorry, I was really (and still am) busy, I close this issue for now since it is not possible to reproduce the error. Feel free to open it again I will try to help you.