cblaster
repository·master·Indexed 40 days ago
https://github.com/gamcil/cblasterA tool for finding clusters of co-located homologous sequences in BLAST searches. It supports remote searches via NCBI APIs and local searches using DIAMOND, providing genomic context, synteny scoring for GenBank files, and interactive HTML visualizations of clustered hits.
What's inside cblaster
- cblaster is a tool designed to identify co-located hits in BLAST searches against NCBI sequence databases. It is optimized for remote workflows, leveraging NCBI's public APIs to perform searches without requiring the user to set up or maintain local search databases. It is primarily used for the rapid identification and visualization of homologous gene clusters.
Overview of cblaster functionality
mastercblasteris a tool designed to identify clusters of co-located sequences using BLAST searches. It is primarily used to find instances of genes encoding related proteins that are clustered on a specific scaffold, which is particularly useful for discovering natural product biosynthetic gene clusters in bacteria and fungi.Core capabilities include:
- Searching databases for sequence collocation.
- Creating local databases from GenBank files.
- Analyzing the impact of intergenic distances on search results.
- Extracting protein sequences of identified homologues.
Use cblaster modules for sequence analysis
mastercblasterprovides several command-line modules to perform different stages of the clustering workflow:cblaster search: Queries a FASTA file of protein sequences against either the NCBI database or a local database to identify co-located sequences. It produces various graphical and textual outputs.cblaster makedb: Used to rapidly create local databases from GenBank files to facilitate future searches.cblaster gne: Analyzes how varying intergenic distances affects search output. This helps evaluate the robustness of results and understand the distribution of gene cluster sizes.cblaster extract: Produces FASTA files containing the protein sequences of identified homologues for use in downstream applications.
The cblaster search workflow
masterThe
cblastersearch process follows a specific pipeline depending on whether you are running in remote or local mode:Remote Mode (Default)
- Search: Query sequences are searched against the NCBI BLAST API.
- Filter: BLAST hits are filtered based on user-defined quality thresholds.
- Group: Hits are queried against NCBI's Identical Protein Groups (IPG) to handle redundancy and group hits by organism, scaffold, and subject sequences.
- Cluster:
cblasterscans scaffolds for clustered hits and generates summary tables and visualizations.
Local Mode
- Search: Query sequences are searched against a local DIAMOND database.
- Filter: Hits are filtered by quality thresholds.
- Group: A local SQL database (created via the
makedbmodule) is used to group hits by organism, scaffold, and subject sequences. - Cluster:
cblasterscans scaffolds for clustered hits and generates summary tables and visualizations.
WARNING Before running any search, you must run the
cblaster configmodule to provide either an e-mail address or an NCBI API key.Understand clustering vs. filtering thresholds
masterIt is important to distinguish between search/filtering thresholds and clustering thresholds:
Search/Filtering Thresholds
Arguments like
-me/--max_evalue,-mi/--min_identity, and-mc/--min_coveragedetermine which individual BLAST hits are kept. Any hit not meeting these criteria is discarded immediately.Clustering Thresholds
Arguments like
-g/--gap,-u/--unique, and-mh/--min_hitsdetermine if a group of hits qualifies as a 'cluster'.-g/--gap: The maximum distance (in base pairs) allowed between any two hits in a cluster. This should be tuned based on your organism (e.g., lower for bacteria/fungi, higher for plants).-u/--unique: The minimum number of different query sequences that must be represented in a cluster. If you have 5 queries and set-u 3, a cluster must contain hits from at least 3 distinct queries to be kept.-mh/--min_hits: The minimum total number of hits in a cluster, regardless of which query they came from.-r/--require: A list of specific query sequences that must be present in a cluster for that cluster to be retained.
Example: Requiring specific sequences in a cluster:
cblaster search -qf query.fasta -r Seq1 Seq3 Seq5(Only clusters containing Seq1, Seq3, AND Seq5 will be kept.)
Configure dependencies for local searches
masterBy default,
cblasterperforms remote searches via the NCBI BLAST API. If you wish to perform local searches, you must havediamondinstalled and available in your system$PATH.cblasterwill throw an error if a local search is initiated but cannot finddiamondordiamond-aligner(the alias used when installed viaapt).Key features of cblaster
mastercblaster provides the following capabilities:
- Remote Searches: Perform searches against public NCBI sequence databases without local database setup.
- Database Generation: A single command can generate local search databases from multiple genomes.
- GUI: Includes an easy-to-use graphical user interface.
- Visualization: Provides fully interactive visualizations of search results.
Check the cblaster version
masterTo check the currently installed version of
cblaster, use the--versionflag.$ cblaster --versionConfigure remote searches against NCBI
masterRemote searches are the default mode. Use the following options to customize them:
- Specify Database: Use
-d/--databaseto choose a protein database (e.g.,nr,refseq_protein,swissprot,pdbaa). Note thatcblasteronly supports protein searches viaBLASTp. - Resume Interrupted Search: If a search was interrupted, use the Request Identifier (RID) provided at the start of the session with the
--ridargument to resume. - Entrez Pre-filtering: Use
-eq/--entrez_queryto filter the NCBI database using Entrez search terms (e.g., taxonomic IDs). This can significantly reduce run times.
Example: Filtering for Fungi (Taxonomy ID 4751):
cblaster search -qf query.fasta -eq "txid4751[orgn]"# Resume a search using an RID cblaster search -qf query.fasta --rid RAV3P2F3014 # Filter search to specific taxa using Entrez cblaster search -qf query.fasta -eq "txid4751[orgn]"- Specify Database: Use
Provide query sequences to cblaster search
masterYou can provide query sequences to the
cblaster searchcommand in two ways:- FASTA file: Use the
-qf/--query_fileargument to point to a file containing amino acid sequences. - Sequence Identifiers: Use the
-qi/--query_idsargument to provide NCBI identifiers (e.g., accession, GI number). These can be provided in a newline-separated text file or directly on the command line.
Both methods launch a remote search against NCBI by default.
# Using a FASTA file cblaster search -qf myFile.fasta # Using a text file containing newline-separated IDs cblaster search -qi myFile.txt # Using IDs directly on the command line cblaster search -qi query1 query2 ...- FASTA file: Use the
Access help dialogues for cblaster commands
masterEvery module in the
cblastercommand line interface provides a help dialogue detailing available arguments. To access the help documentation for a specific command, provide-hor--helpas the sole argument following that command.$ cblaster -h $ cblaster search -h $ cblaster gne -h $ cblaster makedb -h $ cblaster extract -hCreate local sequence databases with the makedb module
masterThe
makedbmodule generates the local databases required forcblastersearches from genome files. It accepts two types of arguments: the input genome files and a base name for the output files.Input Formats
- GenBank (.gbk): Provide the
.gbkfiles directly. - GFF3 (.gff): Provide the
.gfffiles. Note that for GFF3 files,cblasterrequires matching.fastafiles containing the nucleotide sequences for each region in the same working directory (e.g., if you provideone.gff,one.fastamust exist).
Output Files
When you specify a name (e.g.,
myDb), the module generates the following files:myDb.sqlite3: Local database for looking up genomic context of hits.myDb.dmnd: DIAMOND sequence search database.myDb.fasta: All protein sequences parsed from genomes, used for HMMER searches.
$ cblaster makedb one.gbk two.gbk three.gbk four.gbk myDb- GenBank (.gbk): Provide the