TSG - Transcript Segment Graph
TSG is a Rust library and command-line tool for creating, manipulating, and analyzing transcript segment graphs. It provides a comprehensive framework for modeling segmented transcript data, analyzing non-linear splicing events, and working with genomic structural variants.

Features
- Parse and write TSG format files
- Build and manipulate transcript segment graphs
- Support for multiple graphs within a single file
- Analyze paths and connectivity between transcript segments
- Support for various element types: nodes, edges, groups, and chains
- Export graphs to DOT format for visualization
- Traverse the graph to identify valid transcript paths
- Read identity tracking to ensure biological validity
- Build graphs from chains and validate path traversals
- Support for genomic coordinates with strand information
- Support for read evidence with types
- Inter-graph links for fusion events and other cross-graph relationships
Installation
Library
Add this to your Cargo.toml:
[]
= "0.1.0"
Command-line Tool
Install the CLI tool:
Library Usage
Loading a TSG file
use TSGraph;
use Path;
Working with Multiple Graphs
use ;
use BString;
Building Graphs from Chains
use ;
use HashMap;
Finding Valid Paths Through Specific Graphs
use TSGraph;
CLI Usage
The TSG command-line tool provides a convenient interface for common operations:
# Display help
# Parse and validate a TSG file
# List all graphs in a TSG file
# Convert a specific graph to DOT format for visualization
# Extract statistics from a TSG file
# Find all paths through a specific graph
# Find all inter-graph links
TSG File Format
The complete TSG file format specification is available in the docs. The format supports multiple graphs, nodes, edges, groups, and chains, with attributes for each element.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.