Configuration

All of the BELbio tools share the same configuration files. There are separate sections for configuration that is specific to a particular application or tool (e.g. bel_api, bel_resources or bel python package).

Location

Get first belbio_conf.{yml|yaml} and belbio_secrets.{yml|yaml} files in:

  1. <current dir>/belbio_{conf|secrets}.{yaml|yml}
  2. ENV[‘BELBIO_CONF’]/belbio_{conf|secrets}.{yaml|yml}
  3. ~/.belbio/{conf|secrets} (dotfiles in home directory)

Download example files from:

Main Configuration File

# YAML Configuration file for BELbio tools

# Location of this file can be found in one of the following locations
#   first found is the one that is used
#   - ./belbio_conf.yml    (just a regular file in the local directory or
#                              any parent directory)
#   - ~/.belbio_conf       (a dotfile in the home directory)


# bel package settings
bel:
  lang:
    default_bel_version: 2.0.0

    # Location of BEL Language Specification yaml files for different versions
    specifications: <dir_name>

    # Collect necessary files from belbio/bel_specifications repo if True
    specification_github_repo: True

    # Term Canonicalization and decanonicalization
    # Note that we don't decanonicalize CHEBI (this is not necessarily a symmetric process)
    canonical:
      HGNC: ["EG", "SP"]
      MGI: ["EG", "SP"]
      RGD: ["EG", "SP"]
      ZFIN: ["EG", "SP"]
      SP: ["EG"]
      CHEMBL: ["CHEBI"]

    decanonical:
      # EG will convert into the first valid namespace based on species
      EG: ['HGNC', "MGI", 'RGD', "ZFIN", "SP"]

  nanopub:
    # JSON Schema for BEL Nanopubs (in YAML format :)
    schema_uri: https://raw.githubusercontent.com/belbio/schemas/master/schemas/nanopub_bel-1.0.0.yaml

    # Rules to apply for computing BEL Edges from BEL Nanopubs
    # pipeline_edge_rules: ["component_of", "degradation"]
  pipeline_edge_rules: []  # If empty, don't filter out any of the compute rules

# bel_api service settings
bel_api:

  # Should we require authentication in API?
  authenticated: false

  # Log configuration is in the conf-logging.yml file

  # For accessing localhost from docker on a mac, use special dns name 'docker.for.mac.localhost'
  servers:
    server_type: DEV

    # Require JWT token for authentication using shared_secret from belbio_secrets.conf?
    # HTTP Header: Authorization: JWT xxxxxx.yyyyyyy.zzzzzz
    authenticated: False

    # api_url: http://localhost:8181
    api_url: https://api.bel.bio/v1

    # elasticsearch: http://docker.for.mac.localhost:9200
    elasticsearch: http://localhost:9200

    # arangodb_host: docker.for.mac.localhost
    arangodb_host: localhost
    arangodb_protocol: http
    arangodb_port: 8529
    arangodb_username: ''
    # arangodb_password - comes from secrets file - will be merged in as config['secrets']['bel_api']['servers']['arangodb_password']


bel_resources:

  # restrict collecting to listed species, empty array means collect everything
  # species_list: ['TAX:9606', 'TAX:10090', 'TAX:10116']
  species_list: []

  # Will download new source datafiles if older than 7 days if we cannot determine the
  #    source file modification date (some FTP sites or Web files make it hard to figure
  #    out when they were last modified).
  update_cycle_days: 7

  # Everything is relative to bel_resources root folder unless it starts with '/'
  file_locations:

    # Root filepath defaults to the repository root with the tools and data sub-directories
    root: ''

    # Downloads - location for all source datafiles to be stored
    downloads: downloads
    # Data files - converted from source databases into standard formats
    data: data
    # Resources - static resources deployed with repository
    resources: resources
    # Files converted and ready to load into databases
    staging_files: staging
    # Term collection scripts
    terms_data: "data/terms"

    tools: tools

    # Namespaces metadata definition file
    namespaces_definition: resources/namespaces.yaml

  # OpenBel related resource configuration - these will eventually get converted
  #   to native BELBio scripts as they don't provide for equivalents and other
  #   enhancements to the namespaces available in BELBio
  openbel:
    # Used to select what to convert using
    #    github:belbio/bel_resources/tools/terms/openbel_annotations.py
    openbel_annotation_sources:
      Anatomy: http://resources.openbel.org/belframework/20150611/annotation/anatomy.belanno
      Cell: http://resources.openbel.org/belframework/20150611/annotation/cell.belanno
      CellLine: http://resources.openbel.org/belframework/20150611/annotation/cell-line.belanno
      Eco: http://belief-demo.scai.fraunhofer.de/openbel/repository/annotation/evidence.belanno

    # Used to select what to convert using
    #   github:belbio/bel_resources/tools/terms/openbel_namespaces.py
    openbel_namespace_sources:
      AFFX: http://resources.openbel.org/belframework/20150611/namespace/affy-probeset-ids.belns
      # LMSD: http://belief-demo.scai.fraunhofer.de/openbel/repository/namespaces/LMSD.belns
      PMIBP: http://belief-demo.scai.fraunhofer.de/BeliefDashboard/dicten/namespaces/pmibp.belns
      PMICHEM: http://belief-demo.scai.fraunhofer.de/BeliefDashboard/dicten/namespaces/pmichem.belns
      PMICOMP: http://belief-demo.scai.fraunhofer.de/BeliefDashboard/dicten/namespaces/pmicomp.belns
      PMIDIS: http://belief-demo.scai.fraunhofer.de/BeliefDashboard/dicten/namespaces/pmidis.belns
      PMIPFAM: http://belief-demo.scai.fraunhofer.de/BeliefDashboard/dicten/namespaces/pmipfam.belns
      SCHEM: http://resources.openbel.org/belframework/20150611/namespace/selventa-legacy-chemicals.belns
      SCOMP: http://resources.openbel.org/belframework/20150611/namespace/selventa-named-complexes.belns
      SDIS: http://resources.openbel.org/belframework/20150611/namespace/selventa-legacy-diseases.belns
      SFAM: http://resources.openbel.org/belframework/20150611/namespace/selventa-protein-families.belns
      ZFIN: http://belief-demo.scai.fraunhofer.de/openbel/repository/namespaces/zfin-zebrafish-genes.belns

# Controls logging for all tools
logging:
  version: 1
  disable_existing_loggers: False
  formatters:
    simple:
      format: '%(levelname)s::%(name)s::%(asctime)s   %(message)s'
  handlers:
    console:
      class: logging.StreamHandler
      level: INFO
      formatter: simple
      stream: ext://sys.stdout
    # logfile:
    #   class: logging.FileHandler
    #   formatter: simple
    #   filename: '../api.log'
  loggers:
    elasticsearch:
      level: WARNING
    urllib3:
      level: CRITICAL
  root:
    level: INFO
    handlers: [console]
    # handlers: [console, logfile]

Secrets Configuration File

# belbio secrets - added to config['secrets']

# Location of this file can be found in one of the following locations
#   first found is the one that is used
#   - ./belbio_secrets.yml    (just a regular file in the local directory
#                              or any parent directory)
#   - ~/.belbio_secrets       (a dotfile in the home directory)


bel_api:
    shared_secret: testme  # shared secret to validate JWT token
    servers:
        arangodb_password: ''