ngs_tools.gtf

Submodules

Package Contents

Functions

parse_gtf(→ Generator[GtfEntry.GtfEntry, None, None])

Parse GTF and yield only the specified features as GtfEntry instances.

genes_and_transcripts_from_gtf(→ Tuple[dict, dict])

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 returns True for entries to process and False 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 returns True for entries to process and False 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