lorenzo-rovigatti / tacoxDNA

A collection of tools for DNA modelling
http://tacoxdna.sissa.it/
GNU General Public License v3.0
17 stars 20 forks source link

Tiamat converter did not work for the attached file #10

Closed ErikPoppleton closed 5 years ago

ErikPoppleton commented 5 years ago

This file was not able to be exported with the tacoxDNA Tiamat converter (file extension changed from .dnajson to .txt to allow it to be uploaded). It worked when I used the converter on the Sulcgroup github on it. Further investigation makes me suspect that you are a commit behind and don't have the code that handles unassigned bases in the Tiamat file. Would you like me to fix it and submit a pull request?

design4E.txt

Error log:

Assuming DNA## Assuming Tiamat version 2

Traceback (most recent call last): File "/home/tacoxdna/git/tacoxDNA/src/Tiamat_oxDNA.py", line 379, in strands = split_bases_to_strands(bases) File "/home/tacoxdna/git/tacoxDNA/src/Tiamat_oxDNA.py", line 126, in split_bases_to_strands strand = Strand(idx, base_lst, local_id) File "/home/tacoxdna/git/tacoxDNA/src/Tiamat_oxDNA.py", line 58, in init enumerate(base_info_lst, local_id_strart)] File "/home/tacoxdna/git/tacoxDNA/src/Tiamat_oxDNA.py", line 19, in init self.val = base_info['type'][0]

KeyError: 'type'Some errors have been detected, output not generated

lorenzo-rovigatti commented 5 years ago

Hey Erik,

thanks for pointing this out. The problem seems to be caused by the fact that some of the bases in the json fil lacks the "type" field. How do you handle this case in your script? Do you use a default value? See for example base n. 589.

cheers, Lorenzo

ErikPoppleton commented 5 years ago

In our version I handle this by having "N" as the default value. oxDNA still does not like this and so it requires further manual modification of the text file, but it does export. Perhaps we should put a number in there so oxDNA accepts it as an input, but the viewer shows them as distinctly different (they're given a random color in a different material).

lorenzo-rovigatti commented 5 years ago

I have added a new option to the script (-d/--default-base) so that the user can choose the default base type. It can be either A, C, G, T, R or an integer value. R means that the base type is chosen randomly (which is the default).