def _get_manifest_dir(data=None):
    """
    get manifest directory from the data dictionary, falling back on alternatives
    it prefers, in order:
    1. locating it from the bcbio_system.yaml file
    2. locating it from the galaxy directory
    3. location it from the python executable.

    it can accept either the data or config dictionary
    """
    manifest_dir = None
    if data:
        bcbio_system = tz.get_in(["config", "bcbio_system"], data, None)
        bcbio_system = bcbio_system if bcbio_system else data.get(
            "bcbio_system", None)
        if bcbio_system:
            sibling_dir = os.path.normpath(os.path.dirname(bcbio_system))
        else:
            sibling_dir = dd.get_galaxy_dir(data)
        if sibling_dir:
            manifest_dir = os.path.normpath(
                os.path.join(sibling_dir, os.pardir, "manifest"))
    if not manifest_dir or not os.path.exists(manifest_dir):
        manifest_dir = os.path.join(config_utils.get_base_installdir(),
                                    "manifest")
    return manifest_dir
Exemple #2
0
def _get_manifest_dir(data=None, name=None):
    """
    get manifest directory from the data dictionary, falling back on alternatives
    it prefers, in order:
    1. locating it from the bcbio_system.yaml file
    2. locating it from the galaxy directory
    3. location it from the python executable.

    it can accept either the data or config dictionary
    """
    manifest_dir = None
    if data:
        bcbio_system = tz.get_in(["config", "bcbio_system"], data, None)
        bcbio_system = bcbio_system if bcbio_system else data.get("bcbio_system", None)
        if bcbio_system:
            sibling_dir = os.path.normpath(os.path.dirname(bcbio_system))
        else:
            sibling_dir = dd.get_galaxy_dir(data)
        if sibling_dir:
            manifest_dir = os.path.normpath(os.path.join(sibling_dir, os.pardir,
                                                         "manifest"))
    if not manifest_dir or not os.path.exists(manifest_dir):
        manifest_dir = os.path.join(config_utils.get_base_installdir(), "manifest")
        if not os.path.exists(manifest_dir) and name:
            manifest_dir = os.path.join(config_utils.get_base_installdir(name), "manifest")
    return manifest_dir
def get_gemini_dir(data=None):
    try:
        data_dir = _get_data_dir()
        return os.path.join(data_dir, "gemini_data")
    except ValueError:
        if data:
            galaxy_dir = dd.get_galaxy_dir(data)
            data_dir = os.path.realpath(os.path.dirname(os.path.dirname(galaxy_dir)))
            return os.path.join(data_dir, "gemini_data")
        else:
            return None
Exemple #4
0
def get_gemini_dir(data=None):
    try:
        data_dir = _get_data_dir()
        return os.path.join(data_dir, "gemini_data")
    except ValueError:
        if data:
            galaxy_dir = dd.get_galaxy_dir(data)
            data_dir = os.path.realpath(os.path.dirname(os.path.dirname(galaxy_dir)))
            return os.path.join(data_dir, "gemini_data")
        else:
            return None