TSSpy is a Python command-line tool designed for the analysis of transcription start site (TSS) data. Inspired by the TSSr (R/Bioconductor) package (https://github.com/Linlab-slu/TSSr)
- Main-command + subcommand structure for modularity and scalability
- Multi-processing support for fast analysis
- Compatible with BAM and TSS table input formats
- Supports BigWig/BedGraph export for genome browser visualization
- Clustering, correlation analysis, and promoter identification
- Suitable for large-scale high-throughput sequencing data
- Clean codebase for easy secondary development
It is recommended to use Python 3.8 or above.
pip install tsspy
After installation, you can use the tsspy
command directly from the terminal.
conda create -n tsspy python=3.8
conda activate tsspy
conda install -c bioconda -c conda-forge tsspy
- Python >= 3.8
- typer (automatically installs click as a dependency)
- pysam
- pandas
- numpy
- biopython
- pyBigWig
After installation, you can use TSSpy in two ways:
-
Direct command (recommended):
tsspy [command] [options]
-
Module invocation (for development):
python -m TSSpy.main [command] [options]
All examples below use the direct command format.
Extract TSS from BAM files:
tsspy tssCalling -i sample1.bam -o sample1.TSS.tsv
Multiple BAM files in parallel:
tsspy tssCalling -i sample1.bam -i sample2.bam -o all.TSS.tsv -n "sample1 sample2"
Cluster TSSs to infer core promoters:
tsspy clustering -i all.TSS.tsv -o all.TSS.clustered.tsv -s sample1
Create visualization files for genome browsers:
# Generate bigWig files (requires chromosome sizes)
tsspy bigwig --input all.TSS.tsv --output-prefix all_samples --format bigwig --reference genome.fa --process
# Generate bedGraph files
tsspy bigwig --input all.TSS.tsv --output-prefix all_samples --format bedgraph
Calculate correlations between samples:
tsspy correlation --input all.TSS.tsv --output correlation_matrix.tsv
Generate visualization plots:
tsspy plot --help
tsspy geneAssign --help
tssCalling
: Identify TSSs from BAM files and output a TSS tableclustering
: Cluster TSSs to infer core promotersbigwig
: Generate BigWig/BedGraph files for genome browser visualizationcorrelation
: Calculate correlations between TSS samplesplot
: Generate plots and visualizations for TSS datageneAssign
: Assign TSS clusters to genes (under development)
- To add a new feature, simply create a new subcommand module in
TSSpy/
and register it inmain.py
- Shared utility functions can be placed in
TSSpy/utils.py
- Built with modern CLI frameworks
Contributions, issues, and feature requests are welcome!
MIT