oggmap.gtf2t2g module

Author: Kristian K Ullrich date: February 2025 email: ullrich@evolbio.mpg.de License: GPL-3

oggmap.gtf2t2g.add_argparse_args(parser: ArgumentParser)

This function attaches individual argument specifications to the parser.

Parameters:

parser (argparse.ArgumentParser) – An argparse.ArgumentParser.

oggmap.gtf2t2g.define_parser()

A helper function for using gtf2t2g.py via the terminal.

Returns:

An argparse.ArgumentParser.

Return type:

argparse.ArgumentParser

oggmap.gtf2t2g.main()

The main function that is being called when gtf2t2g is used via the terminal.

oggmap.gtf2t2g.parse_gtf(gtf, g=False, b=False, p=False, v=False, s=False, output=None, q=False)

This function parses a GTF file to extract transcript and gene IDs.

Parameters:
  • gtf (str) – Path to GTF file.

  • g (bool) – Specify if gene names should be appended if they exist.

  • b (bool) – Specify if gene biotype should be appended if they exist.

  • p (bool) – Specify if protein id should be appended if they exist.

  • v (bool) – Specify if gene/transcript/protein version should be appended.

  • s (bool) – Specify if summary should be printed.

  • output (file object) – File object.

  • q (bool) – Specify if output should be quiet.

Returns:

DataFrame with transcript and gene IDs.

Return type:

pandas.DataFrame

Example

>>> from oggmap import datasets, gtf2t2g
>>> # get gene to transcript table for Danio rerio
>>> # https://ftp.ensembl.org/pub/release-113/gtf/danio_rerio/Danio_rerio.GRCz11.113.gtf.gz
>>> gtf_file = datasets.zebrafish_ensembl113_gtf(datapath='.')
>>> query_species_t2g = gtf2t2g.parse_gtf(gtf=gtf_file,    >>>     g=True, b=True, p=True, v=True, s=True, q=True)
>>> query_species_t2g