Skip to content

adding tx/gx file input type warnings for stringtie#94

Merged
chrisamiller merged 3 commits into
griffithlab:masterfrom
chrisamiller:expression2
Jul 10, 2026
Merged

adding tx/gx file input type warnings for stringtie#94
chrisamiller merged 3 commits into
griffithlab:masterfrom
chrisamiller:expression2

Conversation

@chrisamiller

Copy link
Copy Markdown
Collaborator

Closes #78

Comment thread vatools/vcf_expression_annotator.py Outdated
Comment on lines +19 to +27
line = line.rstrip('\n')
if line == '' or line.startswith('#'):
continue
fields = line.split('\t')
if fields[0] == 'Gene ID':
return 'tsv'
if len(fields) == 9 and 'gene_id "' in fields[8]:
return 'gtf'
return None

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this could be greatly simplified by using csv.DictReader. You pass it a file handle and a delimiter and the resulting reader object has a fieldnames list attribute where you can check whether 'Gene ID' in reader.fieldnames or 'gene_id' in reader.fieldnames'.

Comment thread vatools/vcf_expression_annotator.py Outdated
def check_stringtie_file_format(args):
detected_format = sniff_stringtie_format(args.expression_file)
if args.mode == 'gene' and detected_format == 'gtf':
logging.warning(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should this be an error instead of a warning? Same question for line 38?

@susannasiebert susannasiebert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

+1

@chrisamiller chrisamiller merged commit 77cc363 into griffithlab:master Jul 10, 2026
5 checks passed
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.

Error out when trying to use a stringtie gene tsv in transcript more or a transcript gtf in gene mode

2 participants