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

[23.1] Handle missing indexer for a dataset #17736

Merged
Changes from 1 commit
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
15 changes: 12 additions & 3 deletions lib/galaxy/webapps/galaxy/services/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ def _data(
# Coverage mode uses index data.
if mode == "Coverage":
# Get summary using minimal cutoffs.
indexer = self.data_provider_registry.get_data_provider(trans, original_dataset=dataset, source="index")
indexer = self._get_indexer(trans, dataset)
return indexer.get_data(chrom, low, high, **kwargs)

# TODO:
Expand All @@ -878,7 +878,7 @@ def _data(
# If mode is Auto, need to determine what type of data to return.
if mode == "Auto":
# Get stats from indexer.
indexer = self.data_provider_registry.get_data_provider(trans, original_dataset=dataset, source="index")
indexer = self._get_indexer(trans, dataset)
stats = indexer.get_data(chrom, low, high, stats=True)

# If stats were requested, return them.
Expand Down Expand Up @@ -929,7 +929,7 @@ def _data(

# Get mean depth.
if not indexer:
indexer = self.data_provider_registry.get_data_provider(trans, original_dataset=dataset, source="index")
indexer = self._get_indexer(trans, dataset)
ahmedhamidawan marked this conversation as resolved.
Show resolved Hide resolved
stats = indexer.get_data(chrom, low, high, stats=True)
mean_depth = stats["data"]["mean"]

Expand Down Expand Up @@ -981,3 +981,12 @@ def _raw_data(
data = data_provider.get_data(**kwargs)

return data

def _get_indexer(self, trans, dataset):
try:
indexer = self.data_provider_registry.get_data_provider(trans, original_dataset=dataset, source="index")
if indexer is None:
raise Exception("No indexer available for this dataset")
davelopez marked this conversation as resolved.
Show resolved Hide resolved
return indexer
except Exception as e:
raise galaxy_exceptions.ObjectNotFound(f"Error getting indexer: {util.unicodify(e)}")
Loading