Sign inSign up

nekokoe/plasmer

By nekokoe

•Updated over 3 years ago

An accurate and sensitive bacterial plasmid identification tool.

Image
1

1.3K

nekokoe/plasmer repository overview

⁠Plasmer

Anaconda-Plasmer Docker-Plasmer GitHub-Plasmer-last-commit

An accurate and sensitive bacterial plasmid identification tool based on deep machine-learning of shared k-mers and genomic features.

⁠System Requirements

  1. Currently tested on CentOS 7 and Ubuntu 20.04, should be working on other Linux releases
  2. A minimum of 32GB system memory is required for kmer-db to load the databases
  3. The AVX instruction is required (required by kmer-db)

⁠Before Running

Please download and decompress our pre-built database.

The pre-built database are available at Zenodo⁠ and Google Drive⁠.

The link contains two file, plasmerMainDB.tar.xz and customizedKraken2DB.tar.xz.

Check the sha1sum:

$ sha1sum plasmerMainDB.tar.xz 
0b08f5c30d60b137f54de6024ab7557031850db6  plasmerMainDB.tar.xz
$ sha1sum customizedKraken2DB.tar.xz 
b14efdd9232fd5f6d066716bd8e3e6ca80c9c0de  customizedKraken2DB.tar.xz

Extract the contents into the same directory, and provide the absolute path of the directory to the -d parameter on the command line.

⁠Installation

We recommend run Plasmer with Docker⁠, with Docker you do not need to figure out how to install Plasmer. However, run Plasmer in shell directly on Linux is also feasible.

⁠Install Plasmer using conda

You can simply install Plasmer using conda⁠:

conda install -c iskoldt -c bioconda -c conda-forge -c defaults plasmer
⁠Install Plasmer from scratch

If you do not use conda, here is the tutorial for you to install Plasmer from scratch:

Be sure you installed all the required dependencies first, the required dependencies:

seqkit 2.2.0
python 3.10.4 (gzip; os; sys; Bio)
perl v5.26.2
kmer-db 1.9.4
Prodigal V2.6.3
HMMER 3.3.2
BLAST 2.10.1+
INFERNAL 1.1.4
diamond v2.0.8.146
GNU Parallel 20220722
Kraken version 2.1.2
R version 4.2.0 (hash; randomForest 4.7-1.1)

Then download Plasmer from GitHub:

git clone https://github.com/nekokoe/Plasmer.git
cd Plasmer
export PATH=$PATH:$(pwd)

Add the current directory to your PATH environment variable permanently:

echo 'export PATH=$PATH:'$(pwd) >> ~/.bashrc && source ~/.bashrc

⁠Usage

Plasmer -g input_fasta -p out_prefix -d db -t threads -m minimum_length -l length -o outpath

The parameters:

-h	--help				Print the help info and exit.
-v	--version			Print the version info.
-g	--genome			The input fasta. [required]
-p	--prefix			The prefix for intermediate files and results. [Default: output]
-d	--db				The path of pre-built Plasmer databases. [required]
-t	--threads			Number of threads. [Default: 8]
-m	--minimum_length	The minimum length(bp) of sequences, the sequences shorter than the length will be dropped. [Default: 500]
		
-l	--length			The length(bp) threshold of sequences as chromosome to filtered. If set 0, no sequence are filtered, all sequences will be predicted. [Default: 500000]
-o	--outpath			The outpath. [required]

⁠Run Plasmer with Docker

With docker, you don't have to install any of the dependencies. See more about Docker⁠

Download the Docker image first:

docker pull nekokoe/plasmer:latest

Assuming the input FASTA file was deposited in {inputfilepath}/input.fasta

Run the following command to get result in {outputfilepath}

You can replace input.fasta with the actual name of your file.

docker run -d --rm --name plasmer \
	-v {inputfilepath}:/input \
	-v {outputfilepath}:/output \
	-v {databasepath}:/db \
	 nekokoe/plasmer:latest \
	/bin/sh /scripts/Plasmer \
	-g /input/input.fasta \
	-p {prefix} \
	-d /db \
	-t {threadnumber} \
	-m 500 \
	-l 500000 \
	-o /output

Replace with your own input: {inputfilepath} : Absolute path contains input.fasta in your file system

{outputfilepath} : Absolute path for output in your file system

{databasepath} : Absolute path for the downloaded pre-built Plasmer database

{prefix} : Prefix for intermediate and output files

{threadnumber} : Number of CPUs wish to use

⁠dockerrun_batch.sh

We also provide a bash shell script that runs the Docker for you, if you have many input files in a directory.

bash dockerrun_batch.sh /input/files/path /output/files/path /database/path CPU_threads minimum_length length

⁠Output

In the outpath/results, 5 files are generated, including:

prefix.plasmer.predProb.tsv

prefix.plasmer.predClass.tsv

prefix.plasmer.predPlasmids.taxon

prefix.plasmer.predPlasmids.fa

prefix.plasmer.shorterM.fasta

Have a look at result_example folder of the Github repository:

The example.plasmer.predProb.tsv: The probability of each contig classified to chromosome and plasmid.

Contigchromosomeplasmid
contig_10.8320.168
contig_20.9520.048
contig_30.0220.978
contig_40.9840.016
contig_501
contig_601
contig_70.9060.094
contig_801
contig_90.840.16
contig_1001

The example.plasmer.predClass.tsv: The class of each contig.

ContigType
contig_1chromosome
contig_2chromosome
contig_3plasmid
contig_4chromosome
contig_5plasmid
contig_6plasmid
contig_7chromosome
contig_8plasmid
contig_9chromosome
contig_10plasmid

The example.plasmer.predPlasmids.taxon: The taxonomy of each predicted plasmid contig.

ContigTaxonomy ID
contig_1Enterococcus faecium (taxid 1352)
contig_2Enterococcus faecium (taxid 1352)
contig_3Enterococcus faecium (taxid 1352)
contig_4Enterococcus faecium (taxid 1352)
contig_5Enterococcus faecium (taxid 1352)
contig_6Enterococcus faecium Aus0085 (taxid 1305849)
contig_7Enterococcus faecium (taxid 1352)
contig_8Enterococcus faecium (taxid 1352)
contig_9Enterococcus faecium (taxid 1352)
contig_10Enterococcus faecium (taxid 1352)

The example.plasmer.predPlasmids.fa: The sequences of predicted plasmid contigs.

The prefix.plasmer.shorterM.fasta contains the sequences filtered out by the -m parameter.

⁠Prediction results of other tools

Download the results of other tools from Zenodo⁠ or Google Drive⁠.

⁠Feedback

Your feedback, bug-report and suggestions are welcomed to nekokoe (at) qq.com and husn (at) im.ac.cn

⁠License

This project is licensed under the terms of the MIT license.

Tag summary

Content type

Image

Digest

sha256:c64ba6e14…

Size

1005.2 MB

Last updated

over 3 years ago

docker pull nekokoe/plasmer