-
Notifications
You must be signed in to change notification settings - Fork 1
Exclusive fix #38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclusive fix #38
Changes from all commits
447b88d
7a48253
c02ff18
1607e86
15d2948
f3c9418
7606b32
8acefbc
1e02057
c68e983
82506c3
ec61604
5ca3bc7
a7f45eb
c736abd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -62,7 +62,7 @@ def sort_list_intervals_dict( | |
| """ | ||
| return sorted( | ||
| list_dictionaries, | ||
| key=lambda x: (x['coordinate'].lower, x['coordinate']), | ||
| key=lambda x: (x['coordinate'].lower, x['coordinate'].upper), | ||
| reverse=reverse | ||
| ) | ||
|
|
||
|
|
@@ -90,6 +90,12 @@ def get_interval_length( | |
| return round(intersection_span / longest_length, 3) | ||
| return 0.0 | ||
|
|
||
| @staticmethod | ||
| def interval_length( | ||
| interval: P.Interval | ||
| ): | ||
| return interval.upper - interval.lower + 1 | ||
|
||
|
|
||
| @staticmethod | ||
| def reverse_sequence_bool( | ||
| gene_strand: str, | ||
|
|
@@ -629,7 +635,9 @@ def construct_peptide_sequences( | |
| mrna_peptide_sequence += cds_peptide_sequence | ||
| start_coord = end_coord | ||
| frame_cds = frame_next_cds | ||
| transcript_dict[P.open(start, end)] = [coord_idx, frame_cds, cds_dna_sequence, cds_peptide_sequence] | ||
| transcript_dict[P.open(start, end)] = [ | ||
| coord_idx, int(frame_cds), cds_dna_sequence, cds_peptide_sequence | ||
| ] | ||
| return mrna_peptide_sequence, transcript_dict | ||
|
|
||
| @staticmethod | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
| import os | ||
| import shutil | ||
| import sys | ||
| import subprocess | ||
| from pathlib import Path | ||
| from datetime import date | ||
|
|
||
|
|
@@ -158,18 +159,33 @@ def base_settings( | |
|
|
||
| def check_if_tool_installed( | ||
| self, | ||
| name: str | ||
| name: str, | ||
| version: str = None, | ||
| ) -> None: | ||
| if shutil.which(name) is None: | ||
| self.logger.error(f"Error: {name} is not installed or not in your PATH environment variable.") | ||
| self.logger.error( | ||
| f"Error: {name} is not installed or not in your PATH environment variable." | ||
| ) | ||
| sys.exit(1) | ||
| else: | ||
| if version: | ||
| program_version = subprocess.run( | ||
| [name, '--version'], | ||
| capture_output=True, | ||
| text=True | ||
| ) | ||
| if version not in program_version.stdout.strip(): | ||
|
||
| self.logger.error( | ||
| f"Error: {name} version {version} is not installed, please upgrade/install it." | ||
| ) | ||
| sys.exit(1) | ||
|
|
||
| def check_software_requirements(self): | ||
| if os.getenv("CI") == "true": | ||
| # Skip software checks in CI environment | ||
| return | ||
| self.check_if_tool_installed(name='sqlite3') | ||
| self.check_if_tool_installed(name='muscle') | ||
| self.check_if_tool_installed(name='muscle', version='5.3') | ||
| if self.SEARCH_ALL: | ||
| self.check_if_tool_installed(name='tblastx') | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition function in _find_related_items returns an empty dictionary instead of a Boolean value when items are equal. Replace {} with false to ensure a consistent Boolean return type.