fcc icon indicating copy to clipboard operation
fcc copied to clipboard

Allow numbers as chainIDs/segIDs

Open mtrellet opened this issue 6 years ago • 5 comments

When a PDB has numbers instead of characters as chainIDs and/or segIDs, calc_fcc_matrix returns the following error:

1 + BEGIN: Mon Nov 13 01:18:23 2017
2 + Parsing 202 contact files
3 Traceback (most recent call last):
4   File "/home/enmr/services-enmr/HADDOCK2.2/server/run/userrun002472/run1/tools/calc_fcc_matrix.py", line 142, in ?
5     c = parse_contact_file(args, exclude_chains)
6   File "/home/enmr/services-enmr/HADDOCK2.2/server/run/userrun002472/run1/tools/calc_fcc_matrix.py", line 26, in parse_contact_file
7     contacts = [ set([ int(l) for l in open(f)]) for f in f_list if f.strip()]
8 ValueError: invalid literal for int(): 10087-1510438-14

This is due to a wrong output of the contacts by make_contacts:

10242-1510309-14
10242-1510310-14
10244-1510308-14

Switching back to alphabetical characters in the PDB solves the problem. However, numbers are allowed in the official PDB format.

mtrellet avatar Nov 14 '17 08:11 mtrellet

Solved by #5

JoaoRodrigues avatar Nov 14 '17 15:11 JoaoRodrigues

Still have this problem.

  • BEGIN: Wed Mar 27 09:54:38 2019
  • Ignoring chains. Expect a considerable slowdown!!
  • Parsing 336 contact files Traceback (most recent call last): File "/home/abonvin/haddock_git/haddock2.4/tools/calc_fcc_matrix.py", line 142, in c = parse_contact_file(args, exclude_chains) File "/home/abonvin/haddock_git/haddock2.4/tools/calc_fcc_matrix.py", line 24, in parse_contact_file contacts = [ [ int(l[0:5]+l[6:-1]) for l in open(f)] for f in f_list if f.strip()] ValueError: invalid literal for int() with base 10: '102771510323-14'

LilySnow avatar Mar 27 '19 09:03 LilySnow

Hi @LilySnow @amjjbonvin

Back to work, trying to figure this out. Could you provide me with an example PDB file to reproduce this issue? Please paste it as a gist (https://gist.github.com) instead of pasting it here.

JoaoRodrigues avatar Apr 10 '19 20:04 JoaoRodrigues

Here it is: https://gist.github.com/LilySnow/243aac13d565015ee82ad2fb335283cd

LilySnow avatar Apr 11 '19 08:04 LilySnow

This seems to work properly here on my laptop. Did you update the code to the latest version?

JoaoRodrigues avatar Apr 11 '19 16:04 JoaoRodrigues