TOBIAS (Transcription factor Occupancy prediction By Investigation of ATAC-seq Signal)

repository·main·Indexed 42 days ago

https://github.com/loosolab/tobias

A collection of bioinformatics tools for footprinting analysis on ATAC-seq data. TOBIAS enables users to correct Tn5 insertion bias via ATACorrect, calculate footprint scores with ScoreBigwig, estimate transcription factor binding sites using BINDetect, and visualize regulatory footprints through PlotAggregate and PlotHeatmap.

Tokens
4.5K
Snippets
13
Records
19
Agent score
54%

What's inside TOBIAS

  1. Apply TOBIAS to single-cell ATAC-seq (scATAC-seq)

    main

    TOBIAS can be applied to single-cell resolution data. The recommended workflow is:

    1. Generate individual pseudobulk BAM files from scATAC-seq cell type clusters (e.g., using the sc-framework).
    2. Ensure high quality of single cells and clustering (using tools like [PEAKQC] beforehand).

    A notebook specifically designed for scATAC-seq TOBIAS analyses is available in the SC-Framework repository.

  2. Install TOBIAS via pip or conda

    main

    TOBIAS can be installed as a Python package using pip or via the bioconda channel using conda.

    # Using pip
    $ pip install tobias
    
    # Using conda
    $ conda install tobias -c bioconda
  3. Use TOBIAS command-line tools

    main

    All TOBIAS tools are accessed through a single entry point using the syntax TOBIAS <TOOLNAME>.

    For example, to run ATACorrect, which corrects the cutsite-signal from ATAC-seq regarding the underlying sequence preference of Tn5 transposase, use the following command structure:

    $ TOBIAS ATACorrect --bam <reads.bam> --genome <genome.fa> --peaks <peaks.bed>

    ATACorrect produces several output files in the specified output directory, including uncorrected, bias, expected, and corrected bigwig (.bw) files, as well as a PDF report.

  4. Run TOBIAS analysis pipelines

    main

    While tools can be run individually, TOBIAS is designed to be used in automated pipelines for bias-correction, footprinting, differential binding, and visualization. Pre-set workflows are available for:

    • Snakemake: A pre-set workflow available in the TOBIAS_snakemake repository.
    • Nextflow: A pre-set workflow available in the TOBIAS-nextflow repository.
    • Nextflow (Cloud/Kubernetes): Specialized Nextflow pipelines for cloud computing environments, including versions for Kubernetes and web-based job schedulers (de.NBI cloud).
  5. Install the MOODS dependency for TOBIAS

    main

    TOBIAS requires the MOODS package to function. If it is missing, you can install it via conda or from source.

    Via Conda:

    $ conda install moods -c bioconda

    From Source:

    $ wget https://github.com/jhkorhonen/MOODS/releases/download/v1.9.3/MOODS-python-1.9.3.tar.gz
    $ tar xzvf MOODS-python-1.9.3.tar.gz
    $ cd MOODS-python-1.9.3
    $ python setup.py install
  6. Use the TOBIAS CLI

    main

    TOBIAS is a command-line tool used for transcription factor occupancy prediction from ATAC-seq signal. It operates using a sub-command structure where you specify a tool name followed by its specific arguments.

    General Usage:

    TOBIAS <TOOLNAME> [arguments]

    Get help for a specific tool:

    TOBIAS <TOOLNAME> --help

    Check TOBIAS version:

    TOBIAS --version
    TOBIAS <TOOLNAME> [arguments]
  7. Overview of TOBIAS tools

    main

    TOBIAS provides a suite of tools for footprinting analysis on ATAC-seq data. The available tools include:

    • ATACorrect: Bias correction of ATAC-seq reads in open chromatin.
    • ScoreBigwig: Calculate footprint scores from corrected cutsites.
    • BINDetect: Estimation of differentially bound motifs based on scores, sequence and motifs.
    • PlotAggregate: Plot aggregated ATAC-seq signals in combinations of .bed/.bw to visualize footprints.
    • PlotHeatmap: Plot heatmaps and aggregates of ATAC-seq signals in combinations of .bed/.bw to visualize footprints.
    • PlotTracks: Plot IGV-style genomic signals such as cutsites and footprints across a selection of regions.
    • FormatMotifs: Utility to convert and join/split across different motif-file formats.
    • ClusterMotifs: Cluster motifs and create consensus motifs based on similarity.
    • CreateNetwork: Create TF-TF binding network from annotated TFBS.
    • FilterFragments: Filter fragments from a .bam-file using a .bed-file of regions.
  8. Reference: TOBIAS tool categories and commands

    main

    TOBIAS tools are organized into several functional groups. Use the following list to identify the correct <TOOLNAME> for your task.

    Tools for footprinting analysis:
       ATACorrect: Correct reads with regards to Tn5 sequence bias
       ScoreBigwig: Calculate scores such as footprints from cutsites (replaces FootprintScores)
       BINDetect: Detect TF binding from footprints and motifs
    
    Tools for working with motifs/TFBS:
       TFBScan: Identify positions of TFBS given sequence and motifs
       FormatMotifs: Utility to deal with motif files
       ClusterMotifs: Cluster motifs by similarity
       ScoreBed: Score .bed-file with signal from .bigwig-file(s)
       SubMerge: Get all TFBS in a list of regions, merged into one file
    
    Visualization tools:
       PlotAggregate: Aggregate of .bigwig-signal across TF binding sites
       PlotHeatmap: Heatmap of .bigwig-signal across TF binding sites
       PlotChanges: Plot changes in TF binding across multiple conditions (from BINDetect output)
       PlotTracks: Plot genomic tracks using the svist4get package
    
    Miscellaneous tools:
       DownloadData: Download test data for the TOBIAS tools
       MergePDF: Merge pdf files to one
       MaxPos: Get .bed-positions of highest bigwig signal within .bed-regions
       SubsampleBam: Subsample a .bam-file using samtools
       CreateNetwork: Create TF-gene network from annotated TFBS
       Log2Table: Convert logs from PlotAggregate to tab-delimitered tables of footprint stats
       FilterFragments: Tool for filtering fragments from a .bam-file based on the overlap of reads with .bed-regions
  9. Use MaxPos to find maximum signal positions

    main

    MaxPos identifies the position of the maximum signal (from a bigwig) within a given set of .bed regions. This is useful for finding peaks of accessibility or footprint scores.

    Required arguments:

    • --bed <bed>: Regions to search within.
    • --bigwig <bw>: Scores used to identify the maximum value.

    Output:

    • A 4-column .bed file (defaults to stdout).
    • --invert: Find the minimum position instead of the maximum.

    Example usage:

    TOBIAS MaxPos --bed <regions.bed> --bigwig <signal.bw>
    TOBIAS MaxPos --bed <regions.bed> --bigwig <signal.bw>
  10. Use ClusterMotifs to cluster motifs and create consensus motifs

    main

    The ClusterMotifs command clusters motif files based on similarity and generates one consensus motif per cluster. This tool requires the gimmemotifs Python package to be installed.

    Required Arguments:

    • -m, --motifs: One or more motif files to compare and cluster.

    Optional Arguments:

    • -t, --threshold: Clustering threshold (Default: 0.3).
    • --dist_method: Method for calculating similarity. Choices: pcc, seqcor, wic, akl (Default: pcc).
    • --clust_method: Method for clustering (Scipy linkage methods). Choices: single, complete, average, weighted, centroid, median, ward (Default: average).
    • -a, --cons_format: Format of the consensus motif file. Choices: meme, pfm, jaspar (Default: jaspar).
    • -p, --prefix: Output prefix (Default: motif_comparison).
    • -o, --outdir: Output directory (Default: clustermotifs_output).

    Visualisation Arguments:

    • -e, --type: Plot file type. Choices: png, pdf, jpg (Default: pdf).
    • -d, --dpi: DPI for plots (Default: 100).
    • -c, --color_palette: Color palette (Matplotlib palettes; add _r to reverse). Default: YlOrRd_r.
    TOBIAS ClusterMotifs --motifs <motifs.jaspar>
  11. Use PlotHeatmap to generate signal heatmaps

    main

    PlotHeatmap creates a heatmap of signals from bigwig files, where each row represents one site, along with an aggregate signal across all sites.

    Required arguments:

    • --TFBS <bed>...: TFBS sites per column. Multiple arguments create multiple columns.
    • --signals <bigwig>...: Signals in bigwig format.

    Plotting options:

    • --flank <int>: Flanking basepairs to show (default: 75).
    • --cmap <name>: Colormap for the heatmap (default: seismic).
    • --share-colorbar: Share the colorbar across all bigwigs.
    • --sort-by <int>: Column index in the .bed file to sort the heatmap by.
    PlotHeatmap --TFBS <sites.bed> --signals <signal.bw>
  12. Use PlotAggregate to visualize aggregated signals

    main

    PlotAggregate visualizes aggregated signals across TFBS sites. It can take TFBS sites, bigwig signals, and optional regions/whitelists/blacklists.

    Key arguments:

    • --TFBS <bed>...: Required. TFBS sites.
    • --signals <bigwig>...: Required. Signals in bigwig format.
    • --flank <int>: Flanking basepairs (+/-) to show around the middle of the TFBS (default: 60).
    • --share-y <none|signals|sites|both>: Share y-axis range across plots.
    • --normalize: Normalize aggregate signal to be between 0-1.
    • --log-transform: Log transform signals before aggregation.
    • --remove-outliers <float>: Percentile of regions to include (e.g., 0.99 to remove top 1%).
    PlotAggregate --TFBS <bed1> --signals <bw1>