ngs_tools.gtf
Submodules
Package Contents
Functions
|
Parse GTF and yield only the specified features as |
|
Parse GTF for gene and transcript information. Also, compute the introns of |
- ngs_tools.gtf.parse_gtf(gtf_path: str, filter_func: Callable[[GtfEntry.GtfEntry], bool] = lambda entry: ..., show_progress: bool = False) Generator[GtfEntry.GtfEntry, None, None]
Parse GTF and yield only the specified features as
GtfEntry
instances.- Parameters:
gtf_path – path to GTF file
filter_func – Function that takes a
GtfEntry
instance and returnsTrue
for entries to process andFalse
for entries to ignore. Defaults to no filtering.show_progress – Whether to display a progress bar. Defaults to False.
- Yields:
GTF entries
- ngs_tools.gtf.genes_and_transcripts_from_gtf(gtf_path: str, use_version: bool = False, filter_func: Callable[[GtfEntry.GtfEntry], bool] = lambda entry: ..., show_progress: bool = False) Tuple[dict, dict]
Parse GTF for gene and transcript information. Also, compute the introns of each transcript.
- Parameters:
gtf_path – path to GTF file
use_version – whether or not to use gene and transcript versions
filter_func – Function that takes a
GtfEntry
instance and returnsTrue
for entries to process andFalse
for entries to ignore. Defaults to no filtering.show_progress – Whether to display a progress bar. Defaults to False.
- Returns:
Dictionary containing gene information Dictionary containing transcript information