Skip to main content

CroCoClean: decontamination of species abundance profiles from metagenomic samples affected by cross-sample contamination

Introduction

What is CroCoClean?

CroCoClean is a bioinformatics tool for decontaminating species abundance profiles from metagenomic samples affected by cross-sample contamination.

What CroCoClean is not

CroCoClean should not be confused with CroCoDeEL, which is designed to detect and estimate cross-sample contamination.

CroCoClean is designed to operate on species abundance profiles generated from shotgun metagenomic sequencing data. It is not designed for amplicon-based profiles, such as 16S rRNA gene sequencing abundance tables.

CroCoClean is not designed to remove sequencing reads originating from the contamination source; it operates directly on species abundance profiles.

CroCoClean is not designed to remove external or reagent-derived contamination, which can be addressed by tools such as decontam and SCRuB.

How CroCoClean works

For each contamination event, CroCoClean uses the species abundance profile of the contamination source and the estimated contamination rate to subtract the expected contribution of the contaminating sample from the target sample. Abundances falling below the minimum non-zero abundance observed in the original target profile are set to zero. Species identified by CroCoDeEL as being specifically introduced by the contamination event are also set to zero. The corrected profile is then renormalized so that its abundances sum to one.

Quick start

Input

CroCoClean requires two input files:

  1. a species abundance table containing the abundance profile of each species in each sample
  2. a CroCoDeEL output file containing the detected cross-sample contamination events and their estimated contamination rates.

Species abundance table

The species abundance table must be provided in TSV format. The first column should contain species names, and each subsequent column should correspond to a sample.

For example:

species_name sample1 sample2 sample3 ...
species 1 0.00 0.05 0.07 ...
species 2 0.10 0.01 0.00 ...
... ... ... ... ...

CroCoClean operates on relative abundances. The input table is automatically normalized so that the abundances in each sample sum to one. Consequently, the input values do not necessarily need to be normalized beforehand.

CroCoClean was developed and optimized using species abundance profiles generated by Meteor, and is therefore expected to perform best with Meteor-derived profiles. It can also be used with profiles generated by other shotgun metagenomic profilers, such as Sylph or MetaPhlAn4, although performance may vary depending on the profiling method and the characteristics of the resulting abundance profiles.

An example abundance table is available here.

CroCoDeEL output file

CroCoClean also requires the TSV output file generated by CroCoDeEL. This file must contain the contamination events detected by CroCoDeEL, including the source and target samples and their corresponding estimated contamination rates.

An example is available here.

The abundance table and the CroCoDeEL output file must refer to the same samples and species.

Manual curation of the CroCoDeEL results is strongly recommended before running CroCoClean. CroCoDeEL may produce false-positive contamination events, and CroCoClean will perform decontamination for every event provided in the input file.

The CroCoDeEL Interpreter can be used to facilitate the manual inspection and curation of CroCoDeEL contamination events.

Run CroCoClean

Run the following command to decontaminate the species abundance table:

crococlean \
    -s species_abundance.tsv \
    -c crocodeel_output.tsv \
    -o species_abundance_decontaminated.tsv

By default, CroCoClean uses a single process. The number of processes can be increased using the --nproc option:

crococlean \
    -s species_abundance.tsv \
    -c crocodeel_output.tsv \
    -o species_abundance_decontaminated.tsv \
    --nproc 8

The optional --filter-low-ab parameter filters out low-abundance species that may be inaccurately quantified. The value should be the same as the --filter-low-ab parameter used when running CroCoDeEL.\ A value of 20 is recommended for MetaPhlAn 4.

For example:

crococlean \
    -s species_abundance.tsv \
    -c crocodeel_output.tsv \
    -o species_abundance_decontaminated.tsv \
    --filter-low-ab 20

Output

The original abundance profiles are retained in the output together with the decontaminated profiles generated for each contamination event.

Decontaminated profiles are named using the following convention:

<target>_deconta_<source>

where <target> is the contaminated sample and <source> is the sample identified as the contamination source.

For example, if sample2 was contaminated by sample1, the corresponding decontaminated profile will be named:

sample2_deconta_sample1

When a sample has multiple contamination sources, a separate decontaminated profile is generated independently for each contamination event. For example:

sample2_deconta_sample1
sample2_deconta_sample3

Current limitations

CroCoClean is an early release and has not yet been extensively tested across a broad range of datasets and contamination scenarios. Its results should therefore be interpreted with caution and independently validated before being used for downstream analyses. Use at your own risk.

CroCoClean is currently subject to the following limitations:

  • Independent decontamination of multiple contamination events: When a target sample is affected by multiple contamination sources, each contamination event is decontaminated independently. CroCoClean therefore generates a separate corrected profile for each source rather than simultaneously removing all detected contamination sources from a single profile.

  • Reduced accuracy at high contamination levels: When the estimated contamination rate is high, decontamination may be less accurate. In particular, some species introduced by the contamination may not be identified as contamination-specific and therefore may not be set to zero.

  • Complex contamination scenarios: CroCoClean may produce inaccurate results in complex contamination scenarios. This includes cases where a contamination source is itself contaminated by another sample, as well as cases of reciprocal contamination where two samples contaminate each other.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crococlean-0.1.0.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crococlean-0.1.0-py3-none-any.whl (21.2 kB view details)

Uploaded Python 3

File details

Details for the file crococlean-0.1.0.tar.gz.

File metadata

  • Download URL: crococlean-0.1.0.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.2 Linux/6.1.0-51-amd64

File hashes

Hashes for crococlean-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d58b17caf6907fb14a9ac8842f4611076fe97542e30ce9f1671466bb5e342756
MD5 11b710e5e06b82c5b960b5616e7bbbfb
BLAKE2b-256 8c517d415a422daf509231344be748aa2ae7eadcef074cc12c5b54918e8a1fe3

See more details on using hashes here.

File details

Details for the file crococlean-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: crococlean-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.11.2 Linux/6.1.0-51-amd64

File hashes

Hashes for crococlean-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7cf8b25bcc283ae6b0b8a96e21a89f255f271b10f3079f7729fe54d2328f4da8
MD5 bb3b7820d9736d298e23ea56e9a6109b
BLAKE2b-256 39583fe49c678c3c79eee962c21a56daf4057364815b72f0387bf8e3c4d15cc9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page