filter_protein_coding

filter_protein_coding#

alphagenome.data.gene_annotation.filter_protein_coding(gtf, include_gene_entries=False)[source]#

Filter GTF entries to protein-coding transcripts or genes.

By default, keeps the entries of protein-coding transcripts (filtering on the transcript type). If include_gene_entries is True, keeps all entries of protein-coding genes, including gene entries (filtering on the gene type).

Parameters:
  • gtf (DataFrame) – pd.DataFrame of GENCODE GTF entries. This data frame must contain a column named ‘transcript_type’ or ‘transcript_biotype’, or a column named ‘gene_type’ if include_gene_entries is True.

  • include_gene_entries (bool (default: False)) – Whether to include gene entries in addition to transcript entries. If True, filters on ‘gene_type’ instead of the transcript type.

Return type:

DataFrame

Returns:

pd.DataFrame of GENCODE GTF entries subset to rows with protein-coding transcripts, or with protein-coding genes if include_gene_entries is True.