Esempio n. 1
0
def which(program):
    """returns path to an executable if it is found in the path"""
    fpath, fname = __split(program)
    if fpath:
        if __isfile(program) and __os.access(program, __os.X_OK):
            return program
    else:
        paths_to_search = __os.environ["PATH"].split(__os.pathsep)
        paths_to_search.extend((omelib_directory, ome_directory))
        for path in paths_to_search:
            exe_file = __join(path, program)
            if __isfile(exe_file) and __os.access(exe_file, __os.X_OK):
                return exe_file
    if __os.name == "nt" and not program.endswith(".exe"):
        return which(program + ".exe")
    return None
Esempio n. 2
0
def which(program):
    """returns path to an executable if it is found in the path"""
    fpath, fname = __split(program)
    if fpath:
        if __isfile(program) and __os.access(program, __os.X_OK):
            return program
    else:
        paths_to_search = __os.environ["PATH"].split(__os.pathsep)
        paths_to_search.extend((trnlib_directory, trn_directory))
        for path in paths_to_search:
            exe_file = __join(path, program)
            if __isfile(exe_file) and __os.access(exe_file, __os.X_OK):
                return exe_file
    if __os.name == "nt" and not program.endswith(".exe"):
        return which(program + ".exe")
    return None
Esempio n. 3
0
from __future__ import with_statement, absolute_import
import sys
from os import name as __name
available_tests = ['unit_tests', 'solvers', 'flux_analysis', 'io_tests']

del __name

from os.path import abspath as __abspath
from os.path import join as __join
from os.path import split as __split
from os.path import sep as __sep

cobra_directory = __abspath(__join(__split(__abspath(__file__))[0], ".."))
cobra_location = __abspath(__join(cobra_directory, ".."))
data_directory = __join(__split(__abspath(__file__))[0], "data")
if not data_directory.endswith(__sep):
    data_directory += __sep

salmonella_sbml = __join(data_directory, "salmonella.xml")
salmonella_fbc_sbml = __join(data_directory, "salmonella_fbc.xml")
salmonella_pickle = __join(data_directory, "salmonella.pickle")
salmonella_reaction_p_values_pickle = __join(data_directory, "salmonella_reaction_p_values.pickle")
ecoli_sbml = __join(data_directory, "iJO1366.xml")
ecoli_pickle = __join(data_directory, "iJO1366.pickle")
ecoli_mat = __join(data_directory, "iJO1366.mat")
ecoli_json = __join(data_directory, "iJO1366.json")
yersinia_sbml = __join(data_directory, 'Yersinia_pestis_CO92_iPC815.xml')
yersinia_pickle = __join(data_directory, 'Yersinia_pestis_CO92_iPC815.pickle')

__test_pickles = {'Salmonella_enterica': salmonella_pickle,
                  'Escherichia_coli': ecoli_pickle,
Esempio n. 4
0
"""retrive local user settings"""

from configparser import SafeConfigParser
import os as __os
from os.path import split as __split, join as __join, abspath as __abspath, \
    isfile as __isfile
from sys import modules

self = modules[__name__]

# define various filepaths
trnlib_directory = __join(__split(__abspath(__file__))[0], "")
trn_directory = __join(__abspath(__join(trnlib_directory, "..")), "")


def which(program):
    """returns path to an executable if it is found in the path"""
    fpath, fname = __split(program)
    if fpath:
        if __isfile(program) and __os.access(program, __os.X_OK):
            return program
    else:
        paths_to_search = __os.environ["PATH"].split(__os.pathsep)
        paths_to_search.extend((trnlib_directory, trn_directory))
        for path in paths_to_search:
            exe_file = __join(path, program)
            if __isfile(exe_file) and __os.access(exe_file, __os.X_OK):
                return exe_file
    if __os.name == "nt" and not program.endswith(".exe"):
        return which(program + ".exe")
    return None
Esempio n. 5
0
"""retrive local user settings"""

from ConfigParser import SafeConfigParser
import os as __os
from os.path import split as __split, join as __join, abspath as __abspath, \
    isfile as __isfile
from sys import modules

self = modules[__name__]

# define various filepaths
omelib_directory = __join(__split(__abspath(__file__))[0], "")
ome_directory = __join(__abspath(__join(omelib_directory, "..")), "")

def which(program):
    """returns path to an executable if it is found in the path"""
    fpath, fname = __split(program)
    if fpath:
        if __isfile(program) and __os.access(program, __os.X_OK):
            return program
    else:
        paths_to_search = __os.environ["PATH"].split(__os.pathsep)
        paths_to_search.extend((omelib_directory, ome_directory))
        for path in paths_to_search:
            exe_file = __join(path, program)
            if __isfile(exe_file) and __os.access(exe_file, __os.X_OK):
                return exe_file
    if __os.name == "nt" and not program.endswith(".exe"):
        return which(program + ".exe")
    return None
Esempio n. 6
0
from __future__ import with_statement, absolute_import
import sys
from os import name as __name
available_tests = ['unit_tests']

del __name

from os.path import abspath as __abspath
from os.path import join as __join
from os.path import split as __split
from os.path import sep as __sep
from cobra.manipulation import initialize_growth_medium

gim3e_directory = __abspath(__join(__split(__abspath(__file__))[0], ".."))
gim3e_location = __abspath(__join(gim3e_directory, ".."))
data_directory = gim3e_directory + "/data/"
gim3e_directory += '/core/'

salmonella_pickle = __join(data_directory, "salmonella_gem.pickle")
ecoli_sbml = __join(data_directory, "E_coli_core_M9.xml")
del __abspath, __join, __split, __sep

def create_test_model(test_pickle=salmonella_pickle):
    """Returns a cobra model for testing.  The default model is the
    version of the Salmonella enterica Typhimurium LT2 model published in
    Thiele et al. 2011 BMC Sys Bio 5:8, which has some updated metabolite
    KEGG id data for Schmidt et al. 2013 Bioinformatics

    test_pickle: The complete file name of a pickled cobra.Model or SBML XML
    file to be read.  We currently provide Salmonella enterica Typhimurium
    and Escherichia coli core models whose paths are stored in cobra.test.salmonella_pickle
Esempio n. 7
0
from __future__ import with_statement, absolute_import
import sys
from os import name as __name
available_tests = ['unit_tests', 'solvers', 'flux_analysis', 'io_tests']

del __name

from os.path import abspath as __abspath
from os.path import join as __join
from os.path import split as __split
from os.path import sep as __sep

cobra_directory = __abspath(__join(__split(__abspath(__file__))[0], ".."))
cobra_location = __abspath(__join(cobra_directory, ".."))
data_directory = __join(__split(__abspath(__file__))[0], "data")
if not data_directory.endswith(__sep):
    data_directory += __sep

salmonella_sbml = __join(data_directory, "salmonella.xml")
salmonella_fbc_sbml = __join(data_directory, "salmonella_fbc.xml")
salmonella_pickle = __join(data_directory, "salmonella.pickle")
salmonella_reaction_p_values_pickle = __join(
    data_directory, "salmonella_reaction_p_values.pickle")
ecoli_sbml = __join(data_directory, "iJO1366.xml")
ecoli_pickle = __join(data_directory, "iJO1366.pickle")
ecoli_mat = __join(data_directory, "iJO1366.mat")
ecoli_json = __join(data_directory, "iJO1366.json")
yersinia_sbml = __join(data_directory, 'Yersinia_pestis_CO92_iPC815.xml')
yersinia_pickle = __join(data_directory, 'Yersinia_pestis_CO92_iPC815.pickle')

__test_pickles = {
Esempio n. 8
0
from __future__ import with_statement, absolute_import
import sys
from os import name as __name
available_tests = ['unit_tests']

del __name

from os.path import abspath as __abspath
from os.path import join as __join
from os.path import split as __split
from os.path import sep as __sep
from cobra.manipulation import initialize_growth_medium

gim3e_directory = __abspath(__join(__split(__abspath(__file__))[0], ".."))
gim3e_location = __abspath(__join(gim3e_directory, ".."))
data_directory = gim3e_directory + "/data/"
gim3e_directory += '/core/'

salmonella_pickle = __join(data_directory, "salmonella_gem.pickle")
ecoli_sbml = __join(data_directory, "E_coli_core_M9.xml")
del __abspath, __join, __split, __sep


def create_test_model(test_pickle=salmonella_pickle):
    """Returns a cobra model for testing.  The default model is the
    version of the Salmonella enterica Typhimurium LT2 model published in
    Thiele et al. 2011 BMC Sys Bio 5:8, which has some updated metabolite
    KEGG id data for Schmidt et al. 2013 Bioinformatics

    test_pickle: The complete file name of a pickled cobra.Model or SBML XML
    file to be read.  We currently provide Salmonella enterica Typhimurium