Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
adkinsrs committed Jan 5, 2024
1 parent f5acad5 commit 5c68a6d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 7 additions & 2 deletions www/cgi/get_dataset_comparison.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,13 @@ def main():

# add the composite column for ranked grouping
if perform_ranking == True:
sc.pp.filter_cells(adata, min_genes=10)
sc.pp.filter_genes(adata, min_cells=1)
try:
# TODO: Had the tool crash here and apache restart resolved it. Need to investigate.
sc.pp.filter_cells(adata, min_genes=10)
sc.pp.filter_genes(adata, min_cells=1)
except Exception as e:
msg = "scanpy.pp.filter_cells or scanpy.pp.filter_genes failed.\n{}".format(str(e))
return_error_response(msg)

try:
sc.tl.rank_genes_groups(adata, "compare", groups=["x"], reference="y", n_genes=0, rankby_abs=False, copy=False, method=statistical_test, corr_method='benjamini-hochberg', log_transformed=False)
Expand Down
8 changes: 3 additions & 5 deletions www/js/compare_datasets.v2.js
Original file line number Diff line number Diff line change
Expand Up @@ -372,11 +372,8 @@ const fetchAggregations = async (datasetId, analysisId, filters) => {
const fetchDatasetComparison = async (datasetId, filters, compareKey, conditionX, conditionY, foldChangeCutoff, stDevNumCutoff, logBase, statisticalTestAction) => {
try {
return await apiCallsMixin.fetchDatasetComparison(datasetId, filters, compareKey, conditionX, conditionY, foldChangeCutoff, stDevNumCutoff, logBase, statisticalTestAction);
return data;
} catch (error) {
logErrorInConsole(error);
const msg = "Could not fetch dataset comparison. Please contact the gEAR team."
createToast(msg);
throw new Error(msg);
}
}
Expand Down Expand Up @@ -657,10 +654,11 @@ const plotDataToGraph = (data) => {
type: "scatter",
text: passing.labels,
marker: {
color: [].fill(passColor, 0, passing.x.length),
size: 4,
},
}

passingObj.marker.color = new Array(passingObj.x.length).fill(passColor, 0, passingObj.x.length);
const failingObj = {
id: failing.id,
pvals: failing.pvals,
Expand All @@ -672,10 +670,10 @@ const plotDataToGraph = (data) => {
type: "scatter",
text: failing.labels,
marker: {
color: [].fill(failColor, 0, failing.x.length),
size: 4,
},
}
failingObj.marker.color = new Array(failingObj.x.length).fill(failColor, 0, failingObj.x.length);
plotData.push(passingObj);
plotData.push(failingObj);
} else {
Expand Down

0 comments on commit 5c68a6d

Please sign in to comment.