swiftcnv.read_gtf

Contents

swiftcnv.read_gtf#

read_gtf(gtf_path, arms_path=None, sex_chr=False, exclude_immune=False)#

Parse a GTF file and extract gene positions.

Parameters:
  • gtf_path (str) – Path to gtf gene annotation file.

  • arms_path (str or pandas.DataFrame) – path to TSV file to read or dataframe. Default is swiftcnv’s built-in chr_arms.tsv file (human) Mandatory columns : [‘chr’, ‘arm’, ‘start’, ‘end’]

  • sex_chr (bool, default False) – Keep genes from chromosomes X and Y

  • exclude_immune (bool, default False) – Exclude genes that start with (HLA-|IGH|IGK|IGL)

Returns:

Dataframe with columns [‘gene’, ‘chr’, ‘arm’, ‘chr_arm’, ‘start’, ‘end’]

Return type:

pandas.DataFrame