Skip to content

Commit

Permalink
Merge branch 'release_23.2' into release_24.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Mar 18, 2024
2 parents 7b88bcd + 5d7a18e commit 44b77b1
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lib/galaxy/webapps/galaxy/services/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,12 +891,11 @@ def _data(

extra_info = None
mode = kwargs.get("mode", "Auto")
indexer = None

# 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 @@ -906,7 +905,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 @@ -956,8 +955,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)
stats = indexer.get_data(chrom, low, high, stats=True)
mean_depth = stats["data"]["mean"]

Expand Down Expand Up @@ -1008,3 +1006,11 @@ def _raw_data(
data = data_provider.get_data(**kwargs)

return data

def _get_indexer(self, trans, dataset):
indexer = self.data_provider_registry.get_data_provider(trans, original_dataset=dataset, source="index")
if indexer is None:
msg = f"No indexer available for dataset {self.encode_id(dataset.id)}"
log.exception(msg)
raise galaxy_exceptions.ObjectNotFound(msg)
return indexer

0 comments on commit 44b77b1

Please sign in to comment.