cblaster

repository·master·Indexed 40 days ago

https://github.com/gamcil/cblaster

A 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.

Tokens
10.3K
Snippets
49
Records
60
Agent score
94%

What's inside cblaster

  1. Overview of cblaster

    master
    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.
  2. Overview of cblaster functionality

    master

    cblaster is 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.
  3. Use cblaster modules for sequence analysis

    master

    cblaster provides 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.
  4. The cblaster search workflow

    master

    The cblaster search process follows a specific pipeline depending on whether you are running in remote or local mode:

    Remote Mode (Default)

    1. Search: Query sequences are searched against the NCBI BLAST API.
    2. Filter: BLAST hits are filtered based on user-defined quality thresholds.
    3. Group: Hits are queried against NCBI's Identical Protein Groups (IPG) to handle redundancy and group hits by organism, scaffold, and subject sequences.
    4. Cluster: cblaster scans scaffolds for clustered hits and generates summary tables and visualizations.

    Local Mode

    1. Search: Query sequences are searched against a local DIAMOND database.
    2. Filter: Hits are filtered by quality thresholds.
    3. Group: A local SQL database (created via the makedb module) is used to group hits by organism, scaffold, and subject sequences.
    4. Cluster: cblaster scans scaffolds for clustered hits and generates summary tables and visualizations.
    WARNING

    Before running any search, you must run the cblaster config module to provide either an e-mail address or an NCBI API key.

  5. Understand clustering vs. filtering thresholds

    master

    It 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_coverage determine 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_hits determine 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.)

  6. Configure dependencies for local searches

    master

    By default, cblaster performs remote searches via the NCBI BLAST API. If you wish to perform local searches, you must have diamond installed and available in your system $PATH.

    cblaster will throw an error if a local search is initiated but cannot find diamond or diamond-aligner (the alias used when installed via apt).

  7. Key features of cblaster

    master

    cblaster 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.
  8. Configure remote searches against NCBI

    master

    Remote searches are the default mode. Use the following options to customize them:

    • Specify Database: Use -d/--database to choose a protein database (e.g., nr, refseq_protein, swissprot, pdbaa). Note that cblaster only supports protein searches via BLASTp.
    • Resume Interrupted Search: If a search was interrupted, use the Request Identifier (RID) provided at the start of the session with the --rid argument to resume.
    • Entrez Pre-filtering: Use -eq/--entrez_query to 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]"
  9. Provide query sequences to cblaster search

    master

    You can provide query sequences to the cblaster search command in two ways:

    1. FASTA file: Use the -qf/--query_file argument to point to a file containing amino acid sequences.
    2. Sequence Identifiers: Use the -qi/--query_ids argument 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 ...
  10. Access help dialogues for cblaster commands

    master

    Every module in the cblaster command line interface provides a help dialogue detailing available arguments. To access the help documentation for a specific command, provide -h or --help as the sole argument following that command.

    $ cblaster -h
    $ cblaster search -h
    $ cblaster gne -h
    $ cblaster makedb -h
    $ cblaster extract -h
  11. Create local sequence databases with the makedb module

    master

    The makedb module generates the local databases required for cblaster searches 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 .gbk files directly.
    • GFF3 (.gff): Provide the .gff files. Note that for GFF3 files, cblaster requires matching .fasta files containing the nucleotide sequences for each region in the same working directory (e.g., if you provide one.gff, one.fasta must 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