Build a TxToGene mapping by parsing FASTA transcript headers.
Detects the FASTA format (Ensembl, GENCODE, FlyBase, WormBase) from
the header structure of the first FASTA record.
- Parameters:
file (str or Path) – Path to a FASTA file (plain or gzip-compressed). Only header lines
are read — sequences are skipped.
ignore_version (bool) – If True, strip version suffixes from transcript and gene IDs.
- Returns:
DataFrame with columns tx_id and gene_id.
- Return type:
TxToGene