Skip to content

Commit

Permalink
fixes maximilianh#56, also adding various redmine fixed found by @mat…
Browse files Browse the repository at this point in the history
  • Loading branch information
maximilianh committed Dec 6, 2018
1 parent cf89c61 commit f069571
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="cellbrowser",
version="0.4.23",
version="0.4.24",
license="GPL 3",
python_requires='>=2.5',
author="Maximilian Haeussler",
Expand Down
2 changes: 1 addition & 1 deletion src/cbPyLib/cellbrowser/cbWeb/css/cellBrowser.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ canvas { user-select: none }
.ui-tabs .ui-tabs-panel { padding-top:5px; border:1px solid lightgray !important; padding:0} /* for marker panels */
.ui-tabs-anchor { padding: 3px !important}
.ui-tabs .ui-tabs-nav .ui-tabs-anchor { padding: 3px }
.tab-pane { padding-top: 8px; border: 1px solid lightgrey; padding: 4px }
.tab-pane { padding: .4em 1em; border: 1px solid lightgrey }
.ui-corner-all { border-radius: 0px } /* dialogs */
#tpOpenDatasetButton { border-radius: 4px }
.ui-menu-item { font-size:13px }
Expand Down
15 changes: 8 additions & 7 deletions src/cbPyLib/cellbrowser/cbWeb/js/cellBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ var tsnePlot = function() {
var winWidth = window.innerWidth - 0.05*window.innerWidth;
var winHeight = window.innerHeight - 0.05*window.innerHeight;
var buttonWidth = 400;
var tabsWidth = winWidth - buttonWidth - 50;
var tabsWidth = winWidth - buttonWidth - 70;


var htmls = [];
Expand Down Expand Up @@ -363,15 +363,15 @@ var tsnePlot = function() {

htmls.push("<div class='tab-content'>");

htmls.push("<div id='pane1' class='tab-pane'>");
htmls.push("<div id='pane1' class='tpDatasetPane tab-pane'>");
htmls.push("<p>Loading abstract...</p>");
htmls.push("</div>");

htmls.push("<div id='pane2' class='tab-pane'>");
htmls.push("<div id='pane2' class='tpDatasetPane tab-pane'>");
htmls.push("<p>Loading methods...</p>");
htmls.push("</div>");

htmls.push("<div id='pane3' class='tab-pane'>");
htmls.push("<div id='pane3' class='tpDatasetPane tab-pane'>");
htmls.push("<p>Loading data download...</p>");
htmls.push("</div>");

Expand Down Expand Up @@ -3607,14 +3607,15 @@ var tsnePlot = function() {

console.log("building marker genes window for "+clusterName);
var htmls = [];
htmls.push("<div id='tpPaneHeader' style='padding:8px'>");
htmls.push("<div id='tpPaneHeader' style='padding:0.4em 1em'>");

var buttons = {};

if (tabInfo===undefined || tabInfo.length===0) {
tabInfo = [];
htmls.push("No marker genes are available in this dataset. "
"To add marker genes, contact the original author of the dataset and ask them to add "
buttons["Close"] = function() { $( this ).dialog( "close" )};
htmls.push("No marker genes are available in this dataset. " +
"To add marker genes, contact the original authors of the dataset and ask them to add " +
" them to the cell browser.");
} else {
htmls.push("Click gene symbols below to color plot by gene<br>");
Expand Down
10 changes: 6 additions & 4 deletions src/cbPyLib/cellbrowser/cellbrowser.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@
# generic igraph neighbor-based layouts
"fa": "ForceAtlas2",
"fr": "Fruchterman Reingold",
#"grid_fr": "Grid Fruchterman Reingold", # deactivated for now due to https://github.com/igraph/python-igraph/issues/152
"grid_fr": "Grid Fruchterman Reingold", # deactivated for now due to https://github.com/igraph/python-igraph/issues/152
"kk": "Kamadi Kawai",
#"lgl": "Large Graph Layout", # looks useless
"lgl": "Large Graph Layout", # looks useless
"drl": "DrL Distributed Recursive Layout",
#"rt": "Reingold Tilford tree", # doesn't look useful
"rt": "Reingold Tilford tree", # doesn't look useful

# special scanpy layouts
"tsne" : "t-SNE",
Expand All @@ -86,6 +86,8 @@
"phate" : "PHATE"
}

recommendedLayouts = ["fa", "fr", "kk", "drl", "tsne", "umap", "pagaFa", "phate"]

metaLabels = {
"louvain" : "Louvain Cluster",
"percent_mito" : "Percent Mitochond.",
Expand Down Expand Up @@ -3136,7 +3138,7 @@ def checkLayouts(conf):

doLayouts = conf["doLayouts"]
if doLayouts=="all":
doLayouts = list( coordLabels.keys() )
doLayouts = recommendedLayouts

for l in doLayouts:
if l not in coordLabels:
Expand Down
4 changes: 3 additions & 1 deletion src/cbPyLib/cellbrowser/sampleConfig/scanpy.conf
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ louvainRes = 1.0
# than ‘fr’), ‘kk’ (Kamadi Kawai’, slower than ‘fr’), ‘lgl’ (Large Graph, very
# fast), ‘drl’ (Distributed Recursive Layout, pretty fast) and ‘rt’ (Reingold
# Tilford tree layout).
# You can also set doLayouts="all" to generate all possible layouts mentioned above.
# You can also set doLayouts="all" to generate our favorite layouts, which is
# everything above except lgl/rt as they do not seem useful or grid_fr which
# is sometimes tricky to install.
doLayouts = ["fa", "umap"]

# find top marker genes per cluster?
Expand Down
4 changes: 4 additions & 0 deletions src/cbPyLib/cellbrowser/seurat.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ def writeSeurat2Script(conf, inData, tsnePath, clusterPath, markerPath, rdsPath,
# PCA
cmds.append('print("Running PCA")')
pcCountConfig = conf.get("pcCount", 30)
# see: https://github.com/satijalab/seurat/issues/982
# pca = SeuratObj@dr$pca
# eigValues = (pca@sdev) ^2 ##
# varExplained = eigValues / sum(eigValues)
#if pcCountConfig == "auto":
#cmds.append('sobj <- JackStraw(object = sobj, num.replicate = 100, display.progress = FALSE)')
#cmds.append('JackStrawPlot(object = sobj, PCs = 1:12)')
Expand Down

0 comments on commit f069571

Please sign in to comment.