Dear Loris,

On 21/08/2019 10:54, Loris Bennett wrote:
Hi,

I'm trying to write an easyconfig for IOGA

   https://github.com/holmrenser/IOGA

The setup script creates a python dictionary and dumps this as a json
file.  In my EC I have this


   # Write configuration file
   import os
   import json
   config = {}
   config['adapters'] = os.path.abspath('%(bbmaproot)s/alladapters.fa.gz')

   with open('IOGA_config.json','w') as fh:
        json.dump(config,fh,indent=1)

   files_to_copy = ['IOGA.py', 'IOGA_config.json', 
'chloroplast.reference.fasta',
                    'plant_mitochondria.reference.fasta']

   sanity_check_paths = {
        'files': ["IOGA.py", "IOGA_config.json" ],
        'dirs': [''],
   }

but the file IOGA_config.json isn't created and I can't see from the log
file why not.

Any ideas?

Whatever you put in the easyconfig file will be executed when the easyconfig file is being parsed, not during the installation, which may explain why what you're trying to do doesn't work as expected.

It's not clear to me what you want to do exactly... Just print the json in human readable form, or do you want to do something with it?

Maybe try this:

postinstallcmds = ["""python -c "import json, os; config = {'adapters': os.path.abspath('%(bbmaproot)s/alladapters.fa.gz'}; fh = open('IOGA_config.json','w'); json.dump(config,fh,indent=1)" """]

That still isn't optimal though, most likely.

Can you clarify what you need to do with that JSON file?


regards,

Kenneth

Reply via email to