mne-python config file path could not be determined...

Hello,

I'm using mne as part of a browser-based web application - it is using the
Django framework. Development is done using a built-in web server.
Yesterday I moved the application to Apache but I am getting an error (see
below).

I can see why the error is occurring - mne utils.py is attempting to open a
config file that is located at $HOME/.mne/mne-python.json but $HOME doesn't
seem to be set in the Apache environment, hence the error.

Has anyone had a similar experience using Apache?

Thanks,

Peter

mne-python config file path could not be determined, please report this
error to mne-python developers

Request Method:GET
Request URL:http://ocpu/bio/cardiocpi/
Django Version:1.6.2
Exception Type:ValueError
Exception Value:

mne-python config file path could not be determined, please report this
error to mne-python developers

Exception
Location:/usr/local/lib/python2.7/dist-packages/mne-0.7.1-py2.7.egg/mne/utils.py
in get_config_path, line 721
Python Executable:/usr/bin/python
Python Version:2.7.4
Python Path:

['/home/pcmarks/Desktop/CardioCPIv2',
'/usr/local/lib/python2.7/dist-packages/mne-0.7.1-py2.7.egg',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-x86_64-linux-gnu',
'/usr/lib/python2.7/lib-tk',
'/usr/lib/python2.7/lib-old',
'/usr/lib/python2.7/lib-dynload',
'/usr/local/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages',
'/usr/lib/python2.7/dist-packages/PILcompat',
'/usr/lib/python2.7/dist-packages/gtk-2.0',
'/usr/lib/python2.7/dist-packages/ubuntu-sso-client',
'/usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode']

Server time:Wed, 21 May 2014 11:37:26 -0500
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20140521/c8b29ff6/attachment.html

hi Peter,

I'm using mne as part of a browser-based web application - it is using the
Django framework.

sounds exciting !

Development is done using a built-in web server. Yesterday
I moved the application to Apache but I am getting an error (see below).

I can see why the error is occurring - mne utils.py is attempting to open a
config file that is located at $HOME/.mne/mne-python.json but $HOME doesn't
seem to be set in the Apache environment, hence the error.

Has anyone had a similar experience using Apache?

I doubt it.

What we could do is to support an environment variable eg. MNE_CONFIG_DIR
that defaults to $HOME but can be overwritten by the user. Would that help?

out of curiosity do you plan to open this code? what is the context of
this work?

Best,
Alex

Hi peter,

I don't know if it's useful but you can set environment variables from
python using the os module

import os
os.environ["HOME"] = "/desired/path"

best,
mads

Alex,

Thank you for the reply.

The application will be open source. We are preparing a paper. I pasted the
abstract at the end of this message. Mne is attributed in the references.

I think I will try the approach that Mads just suggested (Thank you,
Mads!). I'll post the results.

Best,

Peter

Proposed Abstract:

A wealth of functional genomics data for cardiovascular phenotypes exists
in many public sources such as GEO (Gene Expression Omnibus,
http://www.ncbi.nlm.nih.gov/geo/). In the systems biology era,
understanding of pathways and networks underlying phenotype requires
analysis of genomics data across multiple platforms (microRNA expression,
gene expression, etc.) and across multiple experimental conditions,
organisms, and systems. While many such data sets exist, and while software
tools for the analysis of each of these individual data sets are prolific,
software tools for the integrative analysis of genomic data across
platforms of genomic expression and across experimental conditions are
uncommon. We present CardioCPI, a freely availably web-based application
populated with gene and microRNA expression data from GEO. CardioCPI
provides seamless analysis and graphing of genomic and phenotypic data
across platforms and experiments. CardioCPI is built in Python using the
Model-View-Controller software pattern within the Django web application
framework, with a LevelDB schema-less data store for storing and accessing
genomic and phenotypic data. We illustrate the utility of CardioCPI with an
example of integrated analysis of gene and microRNA expression data from a
sample of infants with Tetralogy of Fallot (TOF), a congenital fetal heart
disease, and a set of control infants to show gene regulatory pathways and
modules that are highlighted through the joint and integrated analysis of
these two separate data sets. In summary, CardioCPI is a flexible
user-friendly tool for cross-platform and cross-study analysis of gene
regulatory pathways underlying cardiovascular disease.

Thanks for sharing.

Please let us know once this gets public.

Best,
Alex

Thanks Mads. That worked although I think I"m going to have to dig a little
deeper to find the cause.

Best,

Peter

This has to do with file path determination:

https://github.com/mne-tools/mne-python/blob/master/mne/utils.py#L780

If you're up for fixing it, open an issue on Github and we'll figure out
the best way to deal with it.

Cheers,
Eric