{
  "@context": "https://w3id.org/ro/crate/1.1/context",
  "@graph": [
    {
      "@id": "ro-crate-metadata.json",
      "@type": "CreativeWork",
      "about": {
        "@id": "./"
      },
      "conformsTo": [
        {
          "@id": "https://w3id.org/ro/crate/1.1"
        },
        {
          "@id": "https://w3id.org/workflowhub/workflow-ro-crate/1.0"
        }
      ]
    },
    {
      "@id": "ro-crate-preview.html",
      "@type": "CreativeWork",
      "about": {
        "@id": "./"
      }
    },
    {
      "@id": "./",
      "@type": "Dataset",
      "mainEntity": {
        "@id": "workflow/Snakefile"
      },
      "datePublished": "2024-01-21 19:51:37 +0000",
      "author": [

      ],
      "license": "Apache-2.0",
      "identifier": "https://workflowhub.eu/workflows/706?version=1",
      "url": "https://workflowhub.eu/workflows/706/ro_crate?version=1",
      "name": "Research Object Crate for Bactria: BarCode TRee Inference and Analysis",
      "description": "![workflow](https://github.com/naturalis/barcode-constrained-phylogeny/actions/workflows/python-package-conda.yml/badge.svg)\n[![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10519081.svg)](https://doi.org/10.5281/zenodo.10519081)\n\n![Logo](https://github.com/naturalis/barcode-constrained-phylogeny/blob/main/doc/logo-small.png?raw=true)\n\n# Bactria: BarCode TRee Inference and Analysis\nThis repository contains code and data for building very large, topologically-constrained \nbarcode phylogenies through a divide-and-conquer strategy. Such trees are useful as \nreference materials for curating barcode data by detecting rogue terminals (indicating\nincorrect taxonomic annotation) and in the comparable calculation of alpha and beta \nbiodiversity metrics across metabarcoding assays. \n\nThe input data for the approach we develop here currently comes from BOLD data dumps. \nThe international database [BOLD Systems](https://www.boldsystems.org/index.php) \ncontains DNA barcodes for hundreds of thousands of species, with multiple barcodes per \nspecies. The data dumps we use here are TSV files whose columns conform to the nascent\nBCDM (barcode data model) vocabulary. As such, other data sources that conform to this\nvocabulary could in the future be used as well, such as [UNITE](https://unite.ut.ee/).\n\nTheoretically, such data could be filtered and aligned per DNA marker to make \nphylogenetic trees. However, there are two limiting factors: building very large \nphylogenies is computationally intensive, and barcodes are not considered ideal for \nbuilding big trees because they are short (providing insufficient signal to resolve large \ntrees) and because they tend to saturate across large patristic distances.\n\n![concept](https://github.com/naturalis/barcode-constrained-phylogeny/blob/main/doc/concept.png)\n\nBoth problems can be mitigated by using the \n[Open Tree of Life](https://tree.opentreeoflife.org/opentree/argus/opentree13.4@ott93302) \nas a further source of phylogenetic signal. The BOLD data can be split into chunks that \ncorrespond to Open Tree of Life clades. These chunks can be made into alignments and \nsubtrees. The OpenTOL can be used as a constraint in the algorithms to make these. The \nchunks are then combined in a large synthesis by grafting them on a backbone made from \nexemplar taxa from the subtrees. Here too, the OpenTOL is a source of phylogenetic \nconstraint.\n\nIn this repository this concept is developed for both animal species and plant species.\n\n## Installation\n\nThe pipeline and its dependencies are managed using conda. On a linux or osx system, you \ncan follow these steps to set up the `bactria` Conda environment using an `environment.yml` \nfile and a `requirements.txt` file:\n\n1. **Clone the Repository:**  \n   Clone the repository containing the environment files to your local machine:\n   ```bash\n   git clone https://github.com/naturalis/barcode-constrained-phylogeny.git\n   cd barcode-constrained-phylogeny\n   ```\n2. **Create the Conda Environment:**\n   Create the bactria Conda environment using the environment.yml file with the following \n   command:\n   ```bash\n   conda env create -f workflow/envs/environment.yml\n   ```\n   This command will create a new Conda environment named bactria with the packages \n   specified in the environment.yml file. This step is largely a placeholder because\n   most of the dependency management is handled at the level of individual pipeline\n   steps, which each have their own environment specification.\n3. **Activate the Environment:**\n   After creating the environment, activate it using the conda activate command:\n   ```bash\n   conda activate bactria\n   ```\n4. **Verify the Environment:**\n   Verify that the bactria environment was set up correctly and that all packages were \n   installed using the conda list command:\n   ```bash\n   conda list\n   ```\n   This command will list all packages installed in the active conda environment. You should \n   see all the packages specified in the environment.yml file and the requirements.txt file.\n\n## How to run\n\nThe pipeline is implemented using snakemake, which is available within the conda \nenvironment that results from the installation. Important before running the snakemake pipeline \nis to change in [config/config.yaml](config/config.yaml) the number of threads available on your \ncomputer. Which marker gene is used in the pipeline is also specified in the config.yaml (default \nCOI-5P). Prior to execution, the BOLD data package to use (we used the \n[release of 30 December 2022](https://www.boldsystems.org/index.php/datapackage?id=BOLD_Public.30-Dec-2022)) \nmust be downloaded manually and stored in the [resources/](resources/) directory. If a BOLD release \nfrom another date is used the file names in config.yaml need to be updated. \n\nHow to run the entire pipeline:\n\n```bash \nsnakemake -j {number of threads} --use-conda\n```\n\nSnakemake rules can be performed separately:\n```bash \nsnakemake -R {Rule} -j {number of threads} --use-conda\n```\n\nEnter the same number at {number of threads} as you filled in previously in src/config.yaml.\nIn {Rule} insert the rule to be performed.\n\nHere is an overview of all the rules in the Snakefile:\n\n![graphviz (1)](https://github.com/naturalis/barcode-constrained-phylogeny/blob/main/doc/dag.svg)\n(zoomed view is available [here](https://raw.githubusercontent.com/naturalis/barcode-constrained-phylogeny/main/doc/dag.svg))\n\n## Repository layout\n\nBelow is the top-level layout of the repository. This layout is in line with \n[community standards](https://snakemake.readthedocs.io/en/stable/snakefiles/deployment.html) and must be adhered to.\nAll of these subfolders contains further explanatory READMEs to explain their contents in more detail.\n\n- [config](config/) - configuration files\n- [doc](doc/) - documentation and background literature\n- [logs](logs/) - where log files are written during pipeline runtime\n- [resources](resources/) - external data resources (from BOLD and OpenTree) are downloaded here\n- [results](results/) - intermediate and final results are generated here\n- [workflow](workflow/) - script source code and driver snakefile \n\n## License\n\n© 2023 Naturalis Biodiversity Center\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except \nin compliance with the License. You may obtain a copy of the License at\n\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n   \nUnless required by applicable law or agreed to in writing, software distributed under the License \nis distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express \nor implied. See the License for the specific language governing permissions and limitations under \nthe License.",
      "isBasedOn": "https://github.com/naturalis/barcode-constrained-phylogeny.git",
      "sdDatePublished": "2026-04-21 22:31:31 +0100",
      "creativeWorkStatus": "Work-in-progress",
      "hasPart": [
        {
          "@id": "workflow/Snakefile"
        },
        {
          "@id": "doc/dag.svg"
        }
      ]
    },
    {
      "@id": "workflow/Snakefile",
      "@type": [
        "File",
        "SoftwareSourceCode",
        "ComputationalWorkflow"
      ],
      "contentSize": 13366,
      "programmingLanguage": {
        "@id": "#snakemake"
      },
      "image": {
        "@id": "doc/dag.svg"
      },
      "dct:conformsTo": {
        "@id": "https://bioschemas.org/profiles/ComputationalWorkflow/1.0-RELEASE/"
      },
      "description": "![workflow](https://github.com/naturalis/barcode-constrained-phylogeny/actions/workflows/python-package-conda.yml/badge.svg)\n[![License: Apache-2.0](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.10519081.svg)](https://doi.org/10.5281/zenodo.10519081)\n\n![Logo](https://github.com/naturalis/barcode-constrained-phylogeny/blob/main/doc/logo-small.png?raw=true)\n\n# Bactria: BarCode TRee Inference and Analysis\nThis repository contains code and data for building very large, topologically-constrained \nbarcode phylogenies through a divide-and-conquer strategy. Such trees are useful as \nreference materials for curating barcode data by detecting rogue terminals (indicating\nincorrect taxonomic annotation) and in the comparable calculation of alpha and beta \nbiodiversity metrics across metabarcoding assays. \n\nThe input data for the approach we develop here currently comes from BOLD data dumps. \nThe international database [BOLD Systems](https://www.boldsystems.org/index.php) \ncontains DNA barcodes for hundreds of thousands of species, with multiple barcodes per \nspecies. The data dumps we use here are TSV files whose columns conform to the nascent\nBCDM (barcode data model) vocabulary. As such, other data sources that conform to this\nvocabulary could in the future be used as well, such as [UNITE](https://unite.ut.ee/).\n\nTheoretically, such data could be filtered and aligned per DNA marker to make \nphylogenetic trees. However, there are two limiting factors: building very large \nphylogenies is computationally intensive, and barcodes are not considered ideal for \nbuilding big trees because they are short (providing insufficient signal to resolve large \ntrees) and because they tend to saturate across large patristic distances.\n\n![concept](https://github.com/naturalis/barcode-constrained-phylogeny/blob/main/doc/concept.png)\n\nBoth problems can be mitigated by using the \n[Open Tree of Life](https://tree.opentreeoflife.org/opentree/argus/opentree13.4@ott93302) \nas a further source of phylogenetic signal. The BOLD data can be split into chunks that \ncorrespond to Open Tree of Life clades. These chunks can be made into alignments and \nsubtrees. The OpenTOL can be used as a constraint in the algorithms to make these. The \nchunks are then combined in a large synthesis by grafting them on a backbone made from \nexemplar taxa from the subtrees. Here too, the OpenTOL is a source of phylogenetic \nconstraint.\n\nIn this repository this concept is developed for both animal species and plant species.\n\n## Installation\n\nThe pipeline and its dependencies are managed using conda. On a linux or osx system, you \ncan follow these steps to set up the `bactria` Conda environment using an `environment.yml` \nfile and a `requirements.txt` file:\n\n1. **Clone the Repository:**  \n   Clone the repository containing the environment files to your local machine:\n   ```bash\n   git clone https://github.com/naturalis/barcode-constrained-phylogeny.git\n   cd barcode-constrained-phylogeny\n   ```\n2. **Create the Conda Environment:**\n   Create the bactria Conda environment using the environment.yml file with the following \n   command:\n   ```bash\n   conda env create -f workflow/envs/environment.yml\n   ```\n   This command will create a new Conda environment named bactria with the packages \n   specified in the environment.yml file. This step is largely a placeholder because\n   most of the dependency management is handled at the level of individual pipeline\n   steps, which each have their own environment specification.\n3. **Activate the Environment:**\n   After creating the environment, activate it using the conda activate command:\n   ```bash\n   conda activate bactria\n   ```\n4. **Verify the Environment:**\n   Verify that the bactria environment was set up correctly and that all packages were \n   installed using the conda list command:\n   ```bash\n   conda list\n   ```\n   This command will list all packages installed in the active conda environment. You should \n   see all the packages specified in the environment.yml file and the requirements.txt file.\n\n## How to run\n\nThe pipeline is implemented using snakemake, which is available within the conda \nenvironment that results from the installation. Important before running the snakemake pipeline \nis to change in [config/config.yaml](config/config.yaml) the number of threads available on your \ncomputer. Which marker gene is used in the pipeline is also specified in the config.yaml (default \nCOI-5P). Prior to execution, the BOLD data package to use (we used the \n[release of 30 December 2022](https://www.boldsystems.org/index.php/datapackage?id=BOLD_Public.30-Dec-2022)) \nmust be downloaded manually and stored in the [resources/](resources/) directory. If a BOLD release \nfrom another date is used the file names in config.yaml need to be updated. \n\nHow to run the entire pipeline:\n\n```bash \nsnakemake -j {number of threads} --use-conda\n```\n\nSnakemake rules can be performed separately:\n```bash \nsnakemake -R {Rule} -j {number of threads} --use-conda\n```\n\nEnter the same number at {number of threads} as you filled in previously in src/config.yaml.\nIn {Rule} insert the rule to be performed.\n\nHere is an overview of all the rules in the Snakefile:\n\n![graphviz (1)](https://github.com/naturalis/barcode-constrained-phylogeny/blob/main/doc/dag.svg)\n(zoomed view is available [here](https://raw.githubusercontent.com/naturalis/barcode-constrained-phylogeny/main/doc/dag.svg))\n\n## Repository layout\n\nBelow is the top-level layout of the repository. This layout is in line with \n[community standards](https://snakemake.readthedocs.io/en/stable/snakefiles/deployment.html) and must be adhered to.\nAll of these subfolders contains further explanatory READMEs to explain their contents in more detail.\n\n- [config](config/) - configuration files\n- [doc](doc/) - documentation and background literature\n- [logs](logs/) - where log files are written during pipeline runtime\n- [resources](resources/) - external data resources (from BOLD and OpenTree) are downloaded here\n- [results](results/) - intermediate and final results are generated here\n- [workflow](workflow/) - script source code and driver snakefile \n\n## License\n\n© 2023 Naturalis Biodiversity Center\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except \nin compliance with the License. You may obtain a copy of the License at\n\n[http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n   \nUnless required by applicable law or agreed to in writing, software distributed under the License \nis distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express \nor implied. See the License for the specific language governing permissions and limitations under \nthe License.",
      "name": "Bactria: BarCode TRee Inference and Analysis",
      "url": "https://workflowhub.eu/workflows/706?version=1",
      "keywords": "Bioinformatics, Python, Snakemake, phylogenetics",
      "version": 1,
      "license": "https://spdx.org/licenses/Apache-2.0",
      "producer": {
        "@id": "https://workflowhub.eu/projects/202"
      },
      "dateCreated": "2024-01-24T10:38:28Z",
      "dateModified": "2024-02-05T10:09:43Z",
      "isPartOf": [

      ],
      "input": [

      ],
      "output": [

      ],
      "sdPublisher": {
        "@id": "https://about.workflowhub.eu/"
      }
    },
    {
      "@id": "doc/dag.svg",
      "@type": [
        "File",
        "ImageObject"
      ],
      "contentSize": 131932
    },
    {
      "@id": "https://workflowhub.eu/projects/202",
      "@type": [
        "Project",
        "Organization"
      ],
      "name": "Biodiversity Genomics Europe (general)"
    },
    {
      "@id": "#snakemake",
      "@type": "ComputerLanguage",
      "name": "Snakemake",
      "identifier": {
        "@id": "https://doi.org/10.1093/bioinformatics/bts480"
      },
      "url": {
        "@id": "https://snakemake.readthedocs.io"
      }
    },
    {
      "@id": "https://about.workflowhub.eu/",
      "@type": "Organization",
      "name": "WorkflowHub",
      "url": "https://about.workflowhub.eu/"
    }
  ]
}