Skip to content

Conversation

@yiwen0823-dovey
Copy link

Top_score_filter.py Line 408:

ValueError: invalid literal for int() with base 10: ".

Solution: change the string to float fist then int.

@susannasiebert
Copy link
Contributor

@yiwen0823-dovey thank you for this pull request. I'm trying to understand the context of the error your encountered. Can you please provide more information about what command you tried to run when you encountered this error? Also, the error message seems to be cut off. Can you please provide the full error message?

@yiwen0823-dovey
Copy link
Author

Thanks for getting back. The issue occurs when I was trying to run the Top Score Filter function within the pVACsplice, the complete error message are:

Running Top Score Filter Traceback (most recent call last): File "/usr/local/bin/pvacsplice", line 8, in <module> sys.exit(main()) ^^^^^^ File "/usr/local/lib/python3.11/site-packages/pvactools/tools/pvacsplice/main.py", line 124, in main args[0].func.main(args[1]) File "/usr/local/lib/python3.11/site-packages/pvactools/tools/pvacsplice/run.py", line 222, in main combine_reports_per_class(junctions_dir, class_i_arguments, 'I') File "/usr/local/lib/python3.11/site-packages/pvactools/tools/pvacsplice/run.py", line 89, in combine_reports_per_class PostProcessor(**post_processing_params).execute() File "/usr/local/lib/python3.11/site-packages/pvactools/lib/post_processor.py", line 62, in execute self.execute_top_score_filter() File "/usr/local/lib/python3.11/site-packages/pvactools/lib/post_processor.py", line 252, in execute_top_score_filter ).execute() ^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pvactools/lib/top_score_filter.py", line 394, in execute best_line = self.find_best_line(lines) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pvactools/lib/top_score_filter.py", line 408, in find_best_line tsl_lines = [x for x in biotype_lines if x['Transcript Support Level'] != 'NA' and x['Transcript Support Level'] != 'Not Supported' and int(x['Transcript Support Level']) < self.maximum_transcript_support_level] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pvactools/lib/top_score_filter.py", line 408, in <listcomp> tsl_lines = [x for x in biotype_lines if x['Transcript Support Level'] != 'NA' and x['Transcript Support Level'] != 'Not Supported' and int(x['Transcript Support Level']) < self.maximum_transcript_support_level] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: '1.0'

It seems the error is caused by some Transcript Support Level values being formatted as decimal numbers (e.g., '1.0') instead of integers (e.g., '1'). To prevent this issue, it might help to convert the value to a float before to an integer.

@susannasiebert
Copy link
Contributor

I would like to investigate why this field is formatted as a float in your input file to begin with. I checked our test data and I don't see any decimals in this field. Has your input file been edited in some way from what pVACsplice produced? For example, loaded into Excel or pandas and then saved. Both of those could potentially edit the format of this field. A similar issue was reported here, for example, and was resolved by correctly reading in this field as a string.

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