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

Bad .json file format is detected (Cando upload) #182

Open
ecx2093 opened this issue Jun 29, 2018 · 3 comments
Open

Bad .json file format is detected (Cando upload) #182

ecx2093 opened this issue Jun 29, 2018 · 3 comments

Comments

@ecx2093
Copy link

ecx2093 commented Jun 29, 2018

I am using cadnano ver 2.5.1.11 and I am running into some issues when I upload my .json file to the Cando modelling server. I get the following error:

Bad .json file format is detected in ‘tutorial_resave.json’. Or no dsDNA or strand crossovers exist. Please check your file format.

So I went to the tutorials section on the Cando website and downloaded their .json file for a simple two helix bundle. Uploading this to the Cando server works fine and I get the results back. HOWEVER when i download the .json, open it with cadnano, resave it under a new file name, and then upload to the Cando server, I get the bad .json error back.

Could there be some problem with saving to .json that now renders the file incompatible with Cando? I swear I was able to upload .json files from Cadnano to Cando about a year ago, but that was probably a different version of cadnano.

@polyhdron
Copy link

polyhdron commented Jan 31, 2019

Hi, I ran into the same problem. Any solution or workaround yet?
I suppose the new .json file format is not supported by CanDo. Is there a way to convert it back to the old .json format? (In the documentation under 'Scripting' I saw the 'Export to Legacy Format' section with TK...)
Cadnano 2.0 crashes when I try to open the file, same for cadnanoSQ 0.2.4.
Thanks a lot!

@Akodiat
Copy link

Akodiat commented Feb 5, 2019

It's possible to write a script to load the file, then use writeToFile() with legacy=True to write it in legacy format.

This works for cadnano 2.5.1, at least for the simple design I just tested:

import sys
import cadnano
from cadnano.document import Document

app = cadnano.app()
doc = app.document = Document()

filename = sys.argv[1]
    
doc.readFile(filename)
doc.writeToFile(filename=('converted_'+filename), legacy=True)

@polyhdron
Copy link

Thanks, it worked!
In the meantime I also found the script here:
https://github.com/cadnano/cadnano2.5/tree/master/misc/examples/02_export_legacy

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

3 participants