Skip to content

Commit

Permalink
Merge pull request #199 from lilab-bcb/de-display
Browse files Browse the repository at this point in the history
de display update
  • Loading branch information
joshua-gould authored Aug 25, 2023
2 parents cde4b1a + 2231f43 commit b55a5cf
Show file tree
Hide file tree
Showing 6 changed files with 689 additions and 642 deletions.
4 changes: 2 additions & 2 deletions cirrocumulus/job_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ def get_obs(dataset_api, dataset, dataset_info, params):
filter_names[i] = "group_" + str(i + 1)
obs = pd.DataFrame(index=pd.RangeIndex(dataset_info["shape"][0]).astype(str))
obs_field = "selection"
obs[obs_field] = "3"
# obs[obs_field] = "3"
masks, _ = get_mask(dataset_api, dataset, dataset_info, filters)
for i in range(len(masks)):
for i in range(2):
obs.loc[masks[i], obs_field] = filter_names[i]
obs[obs_field] = obs[obs_field].astype("category")
return obs, obs_field
Expand Down
3 changes: 3 additions & 0 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
Release Notes
-------------

- 1.1.56 `August 25, 2023`
* Updated display for differential expression between two groups

- 1.1.55 `August 16, 2023`
* Support saving specific fields in `prepare_data` command

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cirrocumulus",
"version": "1.1.55",
"version": "1.1.56",
"private": true,
"homepage": ".",
"proxy": "http://127.0.0.1:5000",
Expand Down Expand Up @@ -87,7 +87,7 @@
"jest-puppeteer": "^9.0.0",
"prettier": "^3.0.0",
"preval.macro": "^5.0.0",
"puppeteer": "^20.9.0"
"puppeteer": "^21.1.0"
},
"prettier": {
"bracketSpacing": false,
Expand Down
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
anndata==0.9.2
CacheControl==0.13.1
flask==2.3.2
flask==2.3.3
flask-compress==1.13
fsspec==2023.6.0
gunicorn==21.2.0
Expand All @@ -9,7 +9,7 @@ loompy==3.0.7
numpy==1.25.2
pandas==2.0.3
pyarrow==12.0.1
pymongo==4.4.1
pymongo==4.5.0
requests==2.31.0
scipy==1.11.1
zarr==2.16.0
scipy==1.11.2
zarr==2.16.1
20 changes: 11 additions & 9 deletions src/DotPlotJobResultsPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ export function exportJobResult(jobResult) {
window.saveAs(blob, jobResult.name + '.tsv');
}

function getScoreField(fields) {
for (let i = 0; i < fields.length; i++) {
if (fields[i].toLowerCase().indexOf('score') !== -1) {
return fields[i];
}
}
return fields[0]; // default
}

export function updateJob(jobResult) {
if (jobResult.type === 'de') {
if (jobResult.options === undefined) {
Expand Down Expand Up @@ -118,19 +127,13 @@ export function updateJob(jobResult) {
jobResult.byAscending = false;
}
if (jobResult.by === undefined) {
jobResult.by = jobResult.fields[0];
for (let i = 0; i < jobResult.fields.length; i++) {
if (jobResult.fields[i].toLowerCase().indexOf('score') !== -1) {
jobResult.by = jobResult.fields[i];
break;
}
}
jobResult.by = getScoreField(jobResult.fields);
}
if (jobResult.sortByGroup === undefined) {
jobResult.sortByGroup = jobResult.groups[0];
}
if (jobResult.color === undefined) {
jobResult.color = jobResult.fields[0];
jobResult.color = getScoreField(jobResult.fields);
}
if (jobResult.size === undefined) {
jobResult.size = jobResult.fields[0];
Expand Down Expand Up @@ -159,7 +162,6 @@ export function updateJob(jobResult) {
return [min, max];
}

// color='logfoldchanges', size='pvals_adj',
if (jobResult.colorScale === undefined) {
let domain;
if (jobResult.interpolator.scale !== INTERPOLATOR_SCALING_NONE) {
Expand Down
Loading

0 comments on commit b55a5cf

Please sign in to comment.