biotite icon indicating copy to clipboard operation
biotite copied to clipboard

Secondary structure during an MD simulation

Open almeida85 opened this issue 11 months ago • 6 comments

Hello, I am using the https://www.biotite-python.org/latest/examples/gallery/structure/modeling/trajectory_sse.html code to generate the secondary structure plot but I am getting the following error:

Traceback (most recent call last):
  File "/media/Data2/CIM/IL2/2023/IL2wt/analysis/./trajectory_sse.py", line 48, in <module>
    sse[idx] = app.get_sse()
    ~~~^^^^^
ValueError: could not broadcast input array from shape (0,) into shape (128,)

I get the error with both GROMACS and AMBER trajectories.

Any help will be appreciated.

almeida85 avatar Feb 13 '25 15:02 almeida85

Hi. From the error message it seems that DSSP did not identified any protein chains, but without the template file I cannot analyze the error further. Have you checked if the template file contains a complete protein with proper atom naming? Maybe the problem is something similar to this thread: https://github.com/biotite-dev/biotite/discussions/621

padix-key avatar Feb 14 '25 10:02 padix-key

I changed the coordinate files to a gro file, instead of a pdb file. Below is the C-terminal residue:

  132LEU    N   2159   4.776   5.238   6.184
  132LEU    HN  2160   4.771   5.159   6.122
  132LEU    CA  2161   4.913   5.287   6.173
  132LEU    HA  2162   4.945   5.340   6.262
  132LEU    CB  2163   5.017   5.172   6.156
  132LEU    HB1 2164   5.117   5.210   6.126
  132LEU    HB2 2165   4.972   5.114   6.073
  132LEU    CG  2166   5.037   5.089   6.284
  132LEU    HG  2167   4.935   5.056   6.315
  132LEU    CD1 2168   5.115   4.958   6.252
  132LEU   HD11 2169   5.055   4.899   6.180
  132LEU   HD12 2170   5.125   4.902   6.347
  132LEU   HD13 2171   5.218   4.977   6.215
  132LEU    CD2 2172   5.114   5.167   6.390
  132LEU   HD21 2173   5.213   5.191   6.347
  132LEU   HD22 2174   5.124   5.093   6.471
  132LEU   HD23 2175   5.050   5.254   6.420
  132LEU    C   2176   4.925   5.400   6.073
  132LEU    OT1 2177   5.044   5.433   6.056
  132LEU    OT2 2178   4.832   5.454   6.012
   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000   0.00000

This seems to work, but now I have the following error:

Traceback (most recent call last):
  File "/media/Data2/CIM/IL2/2023/IL2wt/analysis/trajectory_sse.py", line 44, in <module>
    app.join()
  File "/opt/anaconda3/lib/python3.12/site-packages/biotite/application/application.py", line 69, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/opt/anaconda3/lib/python3.12/site-packages/biotite/application/localapp.py", line 261, in join
    self.evaluate()
  File "/opt/anaconda3/lib/python3.12/site-packages/biotite/application/dssp/app.py", line 98, in evaluate
    super().evaluate()
  File "/opt/anaconda3/lib/python3.12/site-packages/biotite/application/localapp.py", line 281, in evaluate
    raise SubprocessError(
subprocess.SubprocessError: 'mkdssp' returned with exit code -6: mkdssp: ./src/CifParser.cpp:330: cif::SacParser::CIFToken cif::SacParser::getNextToken(): Assertion `mTokenValue.length() >= 3' failed.

This thread #607 describes the same error but doing the same, the error still persists. The DSSP version is 4.0.4 and trying to install a lower version has conflicts with Boost v1.57.

I changed to my Windows laptop and installed Biotite there. Running the example there gave this error:

C:\Users\myasalme\AppData\Local\anaconda3\envs\Biotite\lib\site-packages\scipy\__init__.py:146: UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.24.4
  warnings.warn(f"A NumPy version >={np_minversion} and <{np_maxversion}"
Traceback (most recent call last):
  File "trajectory_sse.py", line 44, in <module>
    app.start()
  File "C:\Users\myasalme\AppData\Local\anaconda3\envs\Biotite\lib\site-packages\biotite\application\application.py", line 58, in wrapper
    return func(*args, **kwargs)
  File "C:\Users\myasalme\AppData\Local\anaconda3\envs\Biotite\lib\site-packages\biotite\application\application.py", line 113, in start
    self.run()
  File "C:\Users\myasalme\AppData\Local\anaconda3\envs\Biotite\lib\site-packages\biotite\application\dssp\app.py", line 87, in run
    super().run()
  File "C:\Users\myasalme\AppData\Local\anaconda3\envs\Biotite\lib\site-packages\biotite\application\localapp.py", line 226, in run
    self._process = Popen(
  File "C:\Users\myasalme\AppData\Local\anaconda3\envs\Biotite\lib\subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Users\myasalme\AppData\Local\anaconda3\envs\Biotite\lib\subprocess.py", line 1327, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
FileNotFoundError: [WinError 2] The system cannot find the file specified

The example pdb and xtc files are in the same script location.

Any help will be appreciated.

almeida85 avatar Feb 14 '25 13:02 almeida85

The first error seems like there is either an issue with DSSP, or you are using an older Biotite version, which does not support newer DSSP versions. Which Biotite version are you using? Could you confirm the DSSP version by running mkdssp --version?

The second error on the Windows machine indicates that DSSP is not found. So I presume it is either not installed or not in PATH.

padix-key avatar Feb 14 '25 13:02 padix-key

The first error seems like there is either an issue with DSSP, or you are using an older Biotite version, which does not support newer DSSP versions. Which Biotite version are you using? Could you confirm the DSSP version by running mkdssp --version?

The Biotite version is biotite-1.1.0 and mkdssp --version = 4.0.4

The second error on the Windows machine indicates that DSSP is not found. So I presume it is either not installed or not in PATH.

I installed DSSP and got this error:

C:\Users\myasalme\AppData\Local\anaconda3\envs\Biotite\lib\site-packages\scipy\__init__.py:146: UserWarning: A NumPy version >=1.16.5 and <1.23.0 is required for this version of SciPy (detected version 1.24.4
  warnings.warn(f"A NumPy version >={np_minversion} and <{np_maxversion}"
Traceback (most recent call last):
  File "trajectory_sse.py", line 45, in <module>
    app.join()
  File "C:\Users\myasalme\AppData\Local\anaconda3\envs\Biotite\lib\site-packages\biotite\application\application.py", line 58, in wrapper
    return func(*args, **kwargs)
  File "C:\Users\myasalme\AppData\Local\anaconda3\envs\Biotite\lib\site-packages\biotite\application\localapp.py", line 257, in join
    self.evaluate()
  File "C:\Users\myasalme\AppData\Local\anaconda3\envs\Biotite\lib\site-packages\biotite\application\dssp\app.py", line 90, in evaluate
    super().evaluate()
  File "C:\Users\myasalme\AppData\Local\anaconda3\envs\Biotite\lib\site-packages\biotite\application\localapp.py", line 278, in evaluate
    raise SubprocessError(
subprocess.SubprocessError: 'mkdssp' returned with exit code 1: unknown option

(Biotite) PS D:\Work\Proyectos\IL2> mkdssp --version
mkdssp version 4.4.8

almeida85 avatar Feb 14 '25 14:02 almeida85

Interesting. I'll try to dig a bit deeper in the next few days. For reproduction: Where did you DSSP install from?

padix-key avatar Feb 15 '25 18:02 padix-key

If you alternatively are content with the classical helix-sheet-coil annotation, you could also use annotate_see, which does not require DSSP at all.

padix-key avatar Mar 09 '25 09:03 padix-key