Skip to content

gtffilter: add support for non-Ensembl GTF files#12393

Open
kanishkanandhkumar wants to merge 3 commits into
nf-core:masterfrom
kanishkanandhkumar:custom-gtffilter-non-ensembl
Open

gtffilter: add support for non-Ensembl GTF files#12393
kanishkanandhkumar wants to merge 3 commits into
nf-core:masterfrom
kanishkanandhkumar:custom-gtffilter-non-ensembl

Conversation

@kanishkanandhkumar

Copy link
Copy Markdown

This PR updates modules/nf-core/custom/gtffilter/templates/gtffilter.py to support non-Ensembl GTF annotations (e.g., NCBI/RefSeq, GENCODE, FlyBase, TAIR).

Summary of fixes:
Header/Comment preservation: Updated parsing to retain lines starting with # without triggering column-count validation errors.
Flexible transcript_id matching: Replaced strict Ensembl regex (transcript_id "...") with a flexible regex pattern to match unquoted, single-quoted, and =-separated attributes (e.g., transcript_id=TX123).
Top-level gene retention: Ensured top-level gene feature entries are preserved even when they lack a transcript_id attribute.
Gzip support fix: Fixed tab_delimited() validation so .gtf.gz compressed inputs are properly uncompressed during checking rather than throwing column count errors.
Type of Change
Bug fix (non-breaking change fixing an issue)
New feature
Documentation update
Verification
Ran nf-core modules lint custom/gtffilter locally (Passed 45/45 tests).
Verified python script syntax and execution.

@kanishkanandhkumar
kanishkanandhkumar requested review from ewels, mashehu and nictru and removed request for ewels and mashehu July 21, 2026 16:32
Comment thread modules/nf-core/custom/gtffilter/templates/gtffilter.py Outdated
Comment on lines -42 to -47
Args:
data (dict): The dictionary to format.
indent (int): The current indentation level.

Returns:
str: A string formatted as YAML.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please don't remove comments

@mashehu
mashehu disabled auto-merge July 22, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants