/ConFindr

Intra-species bacterial contamination detection

Primary LanguagePythonMIT LicenseMIT

Build status PyPI version install with bioconda

ConFindr

This program is designed to find bacterial intra-species contamination in raw Illumina data. It does this by looking for multiple alleles of core, single copy genes.

For complete instructions on installation and usage, please visit the ConFindr github pages site.

Important Note

ConFindr has only been validated using rMLST databases. Please use them if possible. Installation instructions can be found here

Quickstart

To install ConFindr, use conda (see here for instructions on getting bioconda set up):

conda install -c bioconda confindr

Note that we are aware of some issues with installing ConFindr via conda with Python 3.8. Until this is resolved, if you run into any issues, please try using Python 3.7.

To get an example dataset, use this command, which will create a folder called example-data in your current working directory:

wget https://ndownloader.figshare.com/files/9972709 && tar xf 9972709 && rm 9972709

As of version 0.7.0 ConFindr can run automatically on Escherichia, Salmonella, and Listeria with no further work on your part - just run:

confindr.py -i example-data -o example-out

To use the recommended rMLST database (after installation)

confindr.py -i example-data -o example-out --rmlst

Once ConFindr finishes running, take a look at the confindr_report.csv file found in example-out - it shows that multiple alleles were found for many sites within the genes that ConFindr examines, meaning that this sample is quite contaminated!

If you want to run ConFindr on genera other than the 3 listed above, you'll need to get access to and download rMLST databases. You can find instructions on how to do that here.

Running ConFindr in a Python Script

If you want to run ConFindr from within a script instead of running from the command line, here's how:

from confindr_src import confindr

# Find read files.
paired_reads = confindr.find_paired_reads('path_to_fastq_folder', forward_id='_R1', reverse_id='_R2')
# Run confindr. This assumes that you have already downloaded the databases. If you haven't,
# you can run confindr.check_for_databases_and_download(database_location='path/where/you/want/to/download, tmpdir='a/tmp/dir')
for pair in paired_reads:
    confindr.find_contamination(pair=pair,
                                forward_id='_R1', # change if yours is different
                                threads=4, 
                                output_folder='path/to/output',
                                databases_folder='path/to/databases')
                                

Reporting Issues

If you have any problems installing or running ConFindr, or have feature request, please open an issue here on GitHub.

Citing ConFindr

ConFindr has been published in PeerJ - if you use it in your work, please cite the following:

Low AJ, Koziol AG, Manninger PA, Blais B, Carrillo CD. 2019. ConFindr: rapid detection of intraspecies and cross-species contamination in bacterial whole-genome sequence data. PeerJ 7:e6995 https://doi.org/10.7717/peerj.6995