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

Aspera option improvement #20

Closed
tseemann opened this issue Jul 13, 2017 · 3 comments
Closed

Aspera option improvement #20

tseemann opened this issue Jul 13, 2017 · 3 comments

Comments

@tseemann
Copy link

tseemann commented Jul 13, 2017

Thanks for adding the --aspera option, but is very inconvient for all the users on a cluster to have to specify it, as you say "You will need to provide a path to this file every time you chose to run aspera."

Can you make the default be a file specified in an ENV variable?

For example

export ENA_ASPERA_COMMANDLINE="-m 300m -i key.ssh -DT" 
#and/or
export ENA_ASPERIA_INIFILE="/bio/sw/enaBrowserTools/etc/aspera.ini"

If either of these are set, you use them. But let -a override it.

@chrisgulvik
Copy link

os.environ.get() works the same in both py2 and py3 and the getattr() approach should as well.

If the aspera_settings.ini file is always going to be ../ from enaDataGet.py and utils.py and you wanted to save that full path as a place to check when a specific file isn't provided and env var unset, you could put a line inside utils.py enaBrowserTools_path = os.path.dirname(os.path.dirname(__file__)) then call on the utils module to get it.

Extend this if-statement:

if aspera_settings is not None:
aspera = True
utils.set_aspera_variables(aspera_settings)

elif os.environ.get('ENA_ASPERA_INIFILE'):
    aspera = True
    utils.set_aspera_variables(os.environ.get('ENA_ASPERA_INIFILE'))
elif:
    eBT_path = getattr(utils, 'enaBrowserTools_path', '')
    if os.path.exists(os.path.join(eBT_path, 'aspera_settings.ini')):
        aspera = True
        utils.set_aspera_variables(os.path.join(eBT_path, 'aspera_settings.ini'))

@nicsilvester
Copy link
Contributor

I'l have a look at this. I usually try to avoid environment variables as they can be dangerous. Though given these scripts are run locally I can probably loosen that rule

@nicsilvester
Copy link
Contributor

Added in v1.4 release.

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