Skip to content
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

minifix shiny #153

Merged
merged 2 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Initial release of nf-core/multiplesequencealign, created with the [nf-core](htt
- [[#134](https://github.com/nf-core/multiplesequencealign/pull/134)] - Code revision for release preparation.
- [[#138](https://github.com/nf-core/multiplesequencealign/pull/138)] - MultiQC as nf-core module and fix visualization.
- [[#152](https://github.com/nf-core/multiplesequencealign/pull/152)] - Ignore kalign error 132 and print a warning (incompatibility with some CPU types).
- [[#153](https://github.com/nf-core/multiplesequencealign/pull/153)] - Fix time parser in shiny app.

### `Dependencies`

Expand Down
11 changes: 6 additions & 5 deletions bin/shiny_app/shiny_app_merge_score_and_trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@

def convert_time(time_str):
# Regular expression to match the time components
pattern = re.compile(r'((?P<hours>\d+)h)?\s*((?P<minutes>\d+)m)?\s*((?P<seconds>\d+)s)?\s*((?P<milliseconds>\d+)ms)?')
pattern = re.compile(r'((?P<hours>\d+(\.\d+)?)h)?\s*((?P<minutes>\d+(\.\d+)?)m)?\s*((?P<seconds>\d+(\.\d+)?)s)?\s*((?P<milliseconds>\d+(\.\d+)?)ms)?')
match = pattern.fullmatch(time_str.strip())

if not match:
print(time_str)
raise ValueError("Time string is not in the correct format")

time_components = match.groupdict(default='0')

hours = int(time_components['hours'])
minutes = int(time_components['minutes'])
seconds = int(time_components['seconds'])
milliseconds = int(time_components['milliseconds'])
hours = float(time_components['hours'])
minutes = float(time_components['minutes'])
seconds = float(time_components['seconds'])
milliseconds = float(time_components['milliseconds'])

# Convert everything to minutes
total_minutes = (hours * 60) + minutes + (seconds / 60) + (milliseconds / 60000)
Expand Down
Loading