Skip to content

Commit 7a0bb12

Browse files
committed
Merge branch 'release_25.0' into dev
2 parents e5ab06f + 0aa5616 commit 7a0bb12

File tree

4 files changed

+63
-77
lines changed

4 files changed

+63
-77
lines changed

client/yarn.lock

Lines changed: 2 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -3550,14 +3550,6 @@ agent-base@^7.0.2:
35503550
dependencies:
35513551
debug "^4.3.4"
35523552

3553-
aggregate-error@^3.0.0:
3554-
version "3.1.0"
3555-
resolved "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz"
3556-
integrity sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==
3557-
dependencies:
3558-
clean-stack "^2.0.0"
3559-
indent-string "^4.0.0"
3560-
35613553
aggregate-error@^4.0.0:
35623554
version "4.0.1"
35633555
resolved "https://registry.yarnpkg.com/aggregate-error/-/aggregate-error-4.0.1.tgz#25091fe1573b9e0be892aeda15c7c66a545f758e"
@@ -4378,11 +4370,6 @@ cjs-module-lexer@^1.0.0:
43784370
resolved "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz"
43794371
integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==
43804372

4381-
clean-stack@^2.0.0:
4382-
version "2.2.0"
4383-
resolved "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz"
4384-
integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==
4385-
43864373
clean-stack@^4.0.0:
43874374
version "4.2.0"
43884375
resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-4.2.0.tgz#c464e4cde4ac789f4e0735c5d75beb49d7b30b31"
@@ -5312,20 +5299,6 @@ define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0:
53125299
has-property-descriptors "^1.0.0"
53135300
object-keys "^1.1.1"
53145301

5315-
del@^6.0.0:
5316-
version "6.1.1"
5317-
resolved "https://registry.npmjs.org/del/-/del-6.1.1.tgz"
5318-
integrity sha512-ua8BhapfP0JUJKC/zV9yHHDW/rDoDxP4Zhn3AkA6/xT6gY7jYXJiaeyBZznYVujhZZET+UgcbZiQ7sN3WqcImg==
5319-
dependencies:
5320-
globby "^11.0.1"
5321-
graceful-fs "^4.2.4"
5322-
is-glob "^4.0.1"
5323-
is-path-cwd "^2.2.0"
5324-
is-path-inside "^3.0.2"
5325-
p-map "^4.0.0"
5326-
rimraf "^3.0.2"
5327-
slash "^3.0.0"
5328-
53295302
delaunator@5:
53305303
version "5.0.0"
53315304
resolved "https://registry.yarnpkg.com/delaunator/-/delaunator-5.0.0.tgz#60f052b28bd91c9b4566850ebf7756efe821d81b"
@@ -6708,7 +6681,7 @@ globalthis@^1.0.3:
67086681
dependencies:
67096682
define-properties "^1.1.3"
67106683

6711-
globby@^11.0.1, globby@^11.1.0:
6684+
globby@^11.1.0:
67126685
version "11.1.0"
67136686
resolved "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz"
67146687
integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==
@@ -7370,12 +7343,7 @@ is-number@^7.0.0:
73707343
resolved "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz"
73717344
integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==
73727345

7373-
is-path-cwd@^2.2.0:
7374-
version "2.2.0"
7375-
resolved "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz"
7376-
integrity sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==
7377-
7378-
is-path-inside@^3.0.2, is-path-inside@^3.0.3:
7346+
is-path-inside@^3.0.3:
73797347
version "3.0.3"
73807348
resolved "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz"
73817349
integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==
@@ -9211,13 +9179,6 @@ p-locate@^5.0.0:
92119179
dependencies:
92129180
p-limit "^3.0.2"
92139181

9214-
p-map@^4.0.0:
9215-
version "4.0.0"
9216-
resolved "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz"
9217-
integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==
9218-
dependencies:
9219-
aggregate-error "^3.0.0"
9220-
92219182
p-map@^5.1.0:
92229183
version "5.5.0"
92239184
resolved "https://registry.yarnpkg.com/p-map/-/p-map-5.5.0.tgz#054ca8ca778dfa4cf3f8db6638ccb5b937266715"

lib/galaxy/datatypes/binary.py

Lines changed: 30 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -549,22 +549,29 @@ class _BamOrSam:
549549
Helper class to set the metadata common to sam and bam files
550550
"""
551551

552+
max_references = 100000
553+
552554
def set_meta(self, dataset: DatasetProtocol, overwrite: bool = True, **kwd) -> None:
553555
try:
554-
bam_file = pysam.AlignmentFile(dataset.get_file_name(), mode="rb")
555-
# TODO: Reference names, lengths, read_groups and headers can become very large, truncate when necessary
556-
dataset.metadata.reference_names = list(bam_file.references)
557-
dataset.metadata.reference_lengths = list(bam_file.lengths)
558-
dataset.metadata.bam_header = dict(bam_file.header.items()) # type: ignore [attr-defined]
559-
dataset.metadata.read_groups = [
560-
read_group["ID"] for read_group in dataset.metadata.bam_header.get("RG", []) if "ID" in read_group
561-
]
562-
dataset.metadata.sort_order = dataset.metadata.bam_header.get("HD", {}).get("SO", None)
563-
dataset.metadata.bam_version = dataset.metadata.bam_header.get("HD", {}).get("VN", None)
556+
with pysam.AlignmentFile(dataset.get_file_name(), mode="rb", check_sq=False) as bam_file:
557+
# TODO: Reference names, lengths, read_groups and headers can become very large, truncate when necessary
558+
if bam_file.nreferences <= self.max_references:
559+
dataset.metadata.reference_names = list(bam_file.references)
560+
dataset.metadata.reference_lengths = list(bam_file.lengths)
561+
dataset.metadata.bam_header = dict(bam_file.header.items()) # type: ignore [attr-defined]
562+
dataset.metadata.read_groups = [
563+
read_group["ID"]
564+
for read_group in dataset.metadata.bam_header.get("RG", [])
565+
if "ID" in read_group
566+
]
567+
else:
568+
dataset.metadata.metadata_incomplete = True
569+
dataset.metadata.sort_order = bam_file.header.get("HD", {}).get("SO", None) # type: ignore [attr-defined]
570+
dataset.metadata.bam_version = bam_file.header.get("HD", {}).get("VN", None) # type: ignore [attr-defined]
564571
except Exception:
565572
# Per Dan, don't log here because doing so will cause datasets that
566573
# fail metadata to end in the error state
567-
pass
574+
dataset.metadata.metadata_incomplete = True
568575

569576

570577
class BamNative(CompressedArchive, _BamOrSam):
@@ -653,6 +660,16 @@ class BamNative(CompressedArchive, _BamOrSam):
653660
optional=True,
654661
no_value={},
655662
)
663+
MetadataElement(
664+
name="metadata_incomplete",
665+
default=False,
666+
desc="Indicates if metadata is incomplete",
667+
param=MetadataParameter,
668+
readonly=True,
669+
visible=False,
670+
optional=True,
671+
no_value=False,
672+
)
656673

657674
def set_meta(self, dataset: DatasetProtocol, overwrite: bool = True, **kwd) -> None:
658675
_BamOrSam().set_meta(dataset, overwrite=overwrite, **kwd)
@@ -1051,7 +1068,7 @@ def dataset_content_needs_grooming(self, file_name: str) -> bool:
10511068
"""
10521069
# The best way to ensure that BAM files are coordinate-sorted and indexable
10531070
# is to actually index them.
1054-
with pysam.AlignmentFile(filename=file_name) as f:
1071+
with pysam.AlignmentFile(filename=file_name, check_sq=False) as f:
10551072
# The only sure thing we know here is that the sort order can't be coordinate
10561073
return f.header.get("HD", {}).get("SO") == "coordinate" # type: ignore[attr-defined]
10571074

@@ -1071,7 +1088,7 @@ def dataset_content_needs_grooming(self, file_name: str) -> bool:
10711088
"""
10721089
# The best way to ensure that BAM files are coordinate-sorted and indexable
10731090
# is to actually index them.
1074-
with pysam.AlignmentFile(filename=file_name) as f:
1091+
with pysam.AlignmentFile(filename=file_name, check_sq=False) as f:
10751092
return f.header.get("HD", {}).get("SO") != "queryname" # type: ignore[attr-defined]
10761093

10771094

lib/galaxy/workflow/modules.py

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,21 +1647,13 @@ def get_all_outputs(self, data_only=False):
16471647
]
16481648

16491649
def execute(
1650-
self, trans, progress: "WorkflowProgress", invocation_step, use_cached_job: bool = False
1650+
self,
1651+
trans,
1652+
progress: "WorkflowProgress",
1653+
invocation_step: "WorkflowInvocationStep",
1654+
use_cached_job: bool = False,
16511655
) -> Optional[bool]:
1652-
step = invocation_step.workflow_step
1653-
if step.id in progress.inputs_by_step_id:
1654-
input_value = progress.inputs_by_step_id[step.id]
1655-
else:
1656-
input_value = step.state.inputs["input"]
1657-
if input_value is NO_REPLACEMENT:
1658-
default_value = step.get_input_default_value(NO_REPLACEMENT)
1659-
# TODO: look at parameter type and infer if value should be a dictionary
1660-
# instead. Guessing only field parameter types in CWL branch would have
1661-
# default as dictionary like this.
1662-
if not isinstance(default_value, dict):
1663-
default_value = {"value": default_value}
1664-
input_value = default_value.get("value", NO_REPLACEMENT)
1656+
input_value = self.get_input_value(progress, invocation_step)
16651657
input_param = self.get_runtime_inputs(self)["input"]
16661658
# TODO: raise DelayedWorkflowEvaluation if replacement not ready ? Need test
16671659
try:
@@ -1681,13 +1673,37 @@ def execute(
16811673
except ValueError as e:
16821674
raise FailWorkflowEvaluation(
16831675
why=InvocationFailureWorkflowParameterInvalid(
1684-
reason=FailureReason.workflow_parameter_invalid, workflow_step_id=step.id, details=str(e)
1676+
reason=FailureReason.workflow_parameter_invalid,
1677+
workflow_step_id=invocation_step.workflow_step_id,
1678+
details=str(e),
16851679
)
16861680
)
16871681
step_outputs = dict(output=input_value)
16881682
progress.set_outputs_for_input(invocation_step, step_outputs)
16891683
return None
16901684

1685+
def get_input_value(self, progress: "WorkflowProgress", invocation_step: "WorkflowInvocationStep"):
1686+
step = invocation_step.workflow_step
1687+
if step.id in progress.inputs_by_step_id:
1688+
input_value = progress.inputs_by_step_id[step.id]
1689+
else:
1690+
assert step.state
1691+
input_value = step.state.inputs["input"]
1692+
if input_value is NO_REPLACEMENT:
1693+
default_value = step.get_input_default_value(NO_REPLACEMENT)
1694+
# TODO: look at parameter type and infer if value should be a dictionary
1695+
# instead. Guessing only field parameter types in CWL branch would have
1696+
# default as dictionary like this.
1697+
if not isinstance(default_value, dict):
1698+
default_value = {"value": default_value}
1699+
input_value = default_value.get("value", NO_REPLACEMENT)
1700+
return input_value
1701+
1702+
def recover_mapping(self, invocation_step: "WorkflowInvocationStep", progress: "WorkflowProgress"):
1703+
input_value = self.get_input_value(progress, invocation_step)
1704+
step_outputs = dict(output=input_value)
1705+
progress.set_outputs_for_input(invocation_step, step_outputs, already_persisted=True)
1706+
16911707
def step_state_to_tool_state(self, state):
16921708
state = safe_loads(state)
16931709
default_set, default_value = False, None

lib/galaxy/workflow/run.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -608,17 +608,9 @@ def set_step_outputs(
608608
outputs[invocation_step.output_value.workflow_output.output_name] = invocation_step.output_value.value
609609
self.outputs[step.id] = outputs
610610
if not already_persisted:
611-
workflow_outputs_by_name = {wo.output_name: wo for wo in step.workflow_outputs}
612611
for output_name, output_object in outputs.items():
613612
if hasattr(output_object, "history_content_type"):
614613
invocation_step.add_output(output_name, output_object)
615-
else:
616-
# Add this non-data, non workflow-output output to the workflow outputs.
617-
# This is required for recovering the output in the next scheduling iteration,
618-
# and should be replaced with a WorkflowInvocationStepOutputValue ASAP.
619-
if not workflow_outputs_by_name.get(output_name) and output_object is not NO_REPLACEMENT:
620-
workflow_output = model.WorkflowOutput(step, output_name=output_name)
621-
step.workflow_outputs.append(workflow_output)
622614
for workflow_output in step.workflow_outputs:
623615
assert workflow_output.output_name
624616
output_name = workflow_output.output_name

0 commit comments

Comments
 (0)