genouest / biomaj

BioMAJ
http://genouest.github.io/biomaj/
GNU Affero General Public License v3.0
12 stars 10 forks source link

Allow remoterelease to be used in file name #22

Closed horkko closed 8 years ago

horkko commented 8 years ago

It may appear sometimes that the release number is a part of the file we want to download. The release number can be defined from a release number and so it would be nice to use it directly in the file name we want to download. e.g.:

release.file=Release
release.regexp=(\d+)

remote.files=file-with-releasenumber-18.fa

The idea would be to be able to do such config:

release.file=Release_number
release.regexp=(\d+)

remote.files=file-with-releasenumber-%(remoterelease)s.fa

This enhancement should also appy to all different supported protocols.

Thanks Emmanuel

horkko commented 8 years ago

Hi Olivier,

I've pulled your last commit from branch develop. Tests passed OK. However, some functionalities are broken for such config:

# Biomaj3                                                                                                                              
protocol=directhttp
server=plasmodb.org
remote.dir=common/downloads/Current_Release/PvivaxSal1/fasta/data/PlasmoDB-%(remoterelease)s_PvivaxSal1_Genome.fasta
target.name=PlasmoDB-%(remoterelease)s_PvivaxSal1_Genome.fasta
remote.files=
(biomaj3)biomaj@biomaj [09:11:23] ~ (develop) $ biomaj-cli.py --check --bank pvivax
2015-10-26 09:11:28,404 INFO  [root][MainThread] Log file: /pasteur/services/banques/biomaj/biomaj3/log/pvivax/1445847088.4/pvivax.log
2015-10-26 09:11:28,407 WARNI [root][MainThread] celery config is not set, that's fine if you do not use Celery for background tasks
Bad value substitution:
        section: [GENERAL]
        option : remote.dir
        key    : remoterelease
        rawval : common/downloads/Current_Release/PvivaxSal1/fasta/data/PlasmoDB-%(remoterelease)s_PvivaxSal1_Genome.fasta

Can you please fix it? Thanks

Emmanuel