Dear Kenneth,

Kenneth Hoste <kenneth.ho...@ugent.be> writes:

> 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?

Thanks for the suggestion - I'll try it out.

As far as I can tell, the JSON file just contains some configuration
information (there are a few more items which I omitted in the example
above) and must be in the same directory as the main program.

However, when I contacted the author of IOGA via Github about whether he
could use tags to define versions (rather than just using the commit
hash), he told me that the software is no longer being developed (and he
wasn't going to define any tags).  Thus, even if I get an EasyConfig
working, there won't be much point if no other version is ever released.

Cheers,

Loris

-- 
Dr. Loris Bennett (Mr.)
ZEDAT, Freie Universität Berlin         Email loris.benn...@fu-berlin.de

Reply via email to