Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rna_pdb_tools.py -- TypeError when running --edit option #147

Closed
mjustynaPhD opened this issue Jan 31, 2024 · 2 comments
Closed

rna_pdb_tools.py -- TypeError when running --edit option #147

mjustynaPhD opened this issue Jan 31, 2024 · 2 comments

Comments

@mjustynaPhD
Copy link

When running a command: rna_pdb_tools.py --edit "A:1651-1656>A:1-6,A:2004-2006>A:1-3" pdbs/7RQB_1_1A.pdb I encountered the following error:

Traceback (most recent call last):
  File "/home/marek/anaconda3/envs/rna-tools/bin/rna_pdb_tools.py", line 844, in <module>
    output = edit_pdb(f, args)
             ^^^^^^^^^^^^^^^^^
  File "/home/marek/anaconda3/envs/rna-tools/lib/python3.12/site-packages/rna_tools/rna_tools_lib.py", line 2012, in edit_pdb
    output += edits
TypeError: can only concatenate str (not "list") to str

I did some debugging and fixed the issue, but unfortunately, I have no permission to publish a hotfix branch or create a PR. The problem is with the line indicated in the error (rna_tools_lib.py:2012). I think that this might be an artifact from the past. The easiest fix I found was just to remove this line (output += edits), as it's not needed.
I think that you wanted to keep the command in the output file, but it is actually already added in line rna_tools_lib.py:1999.

@mmagnus
Copy link
Owner

mmagnus commented Mar 5, 2024

dear @mjustynaPhD can you send me this pdb file?

I see that edits could be combined.

Can you run this edits sequentially, I'm not sure if you can do two edits at once (I have to look into the code, this should be in the documentation, sorry for missing this information)
rna_pdb_tools.py --edit "A:1651-1656>A:1-6" pdbs/7RQB_1_1A.pdb > a.pdb
rna_pdb_tools.py --edit "A:2004-2006>A:1-3" a.pdb > b.pdb

@mmagnus mmagnus closed this as completed in eb56f2b Mar 5, 2024
@mmagnus
Copy link
Owner

mmagnus commented Mar 5, 2024

OK, there was a stupid typo in the code, I'm not sure why it was there. It should work now with GitHub or 3.20.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants