Skip to content

Commit 9bc9bb2

Browse files
fix html
2 parents 524d506 + eba5e1e commit 9bc9bb2

File tree

6 files changed

+202
-9
lines changed

6 files changed

+202
-9
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
## Upcoming
22

3+
## [1.0.7] - 2020-11-14
4+
5+
- Added ability to export data in grids as *csv
6+
- Small revisions to docs
7+
38
## [1.0.6] - 2020-10-06
49

510
- Fixed `read10xMatrix()` to work with new 10x files

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: pagoda2
22
Title: Single Cell Analysis and Differential Expression
3-
Version: 1.0.6
3+
Version: 1.0.7
44
Authors@R: c(person("Nikolas","Barkas", email="[email protected]", role="aut"), person("Viktor", "Petukhov", email="[email protected]", role="aut"), person("Peter", "Kharchenko", email = "[email protected]", role = "aut"), person("Simon", "Steiger", email = "[email protected]", role = "ctb"), person("Evan", "Biederstedt", email="[email protected]", role=c("cre", "aut")))
55
Description: Analyzing and interactively exploring large-scale single-cell RNA-seq datasets. 'pagoda2' primarily performs normalization and differential gene expression analysis, with an interactive application for exploring single-cell RNA-seq datasets. It performs basic tasks such as cell size normalization, gene variance normalization, and can be used to identify subpopulations and run differential expression within individual samples. 'pagoda2' was written to rapidly process modern large-scale scRNAseq datasets of approximately 1e6 cells. The companion web application allows users to explore which gene expression patterns form the different subpopulations within your data. The package also serves as the primary method for preprocessing data for conos, <https://github.com/kharchenkolab/conos>. This package interacts with data available through the 'p2data' package, which is available in a 'drat' repository. To access this data package, see the instructions at <https://github.com/kharchenkolab/pagoda2>. The size of the 'p2data' package is approximately 6 MB.
66
License: GPL-3

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,5 @@ If you find `pagoda2` useful for your publication, please cite:
101101
```
102102
Nikolas Barkas, Viktor Petukhov, Peter Kharchenko and Evan
103103
Biederstedt (2021). pagoda2: Single Cell Analysis and Differential
104-
Expression. R package version 1.0.6.
104+
Expression. R package version 1.0.7.
105105
```

doc/pagoda2.walkthrough.html

+1
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@
201201
</head>
202202

203203
<body>
204+
204205
<h1>Pagoda2 Walkthrough</h1>
205206

206207
<h2>Overview</h2>

inst/rookServerDocs/js/aspectsTableViewer.js

+135-6
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,74 @@ aspectsTableViewer.prototype.generateTables = function() {
9898
],
9999
listeners: {
100100
'selectionchange': genesetSelectionChangeListener
101-
}
101+
},
102+
tbar: Ext.create('Ext.PagingToolbar', {
103+
displayInfo: true,
104+
prependButtons: true,
105+
items: [{
106+
xtype: 'button',
107+
glyph: 0xf0c7 , //fa-floppy-o
108+
tooltip: 'Export Selected',
109+
handler: function(){
110+
var grid = Ext.getCmp('genesetsAspectTable');
111+
var csvContent = "data:text/csv;charset=utf-8\n";
112+
113+
var columns = grid.columnManager.columns;
114+
var columnsCount = columns.length;
115+
for (var i = 0; i < columnsCount; i++) {
116+
if (!columns[i].hidden) {
117+
csvContent += columns[i].text + ",";
118+
}
119+
}
120+
csvContent = csvContent.substring(0, csvContent.length-1);
121+
csvContent += "\r";
122+
123+
for (var j = 0; j<columnsCount; j++) {
124+
if(!columns[j].hidden){
125+
console.log(columns[j]);
126+
}
127+
}
128+
129+
var rows = grid.store.data.items;
130+
var rowsCount = rows.length;
131+
132+
for (var i = 0; i < rowsCount; i++) {
133+
var row = rows[i].data;
134+
for (var j = 1; j<columnsCount; j++) {
135+
if (!columns[j].hidden) {
136+
var value = row[columns[j].dataIndex];
137+
csvContent += "\"" + value + "\"" + ",";
138+
}
139+
}
140+
csvContent = csvContent.substring(0, csvContent.length-1);
141+
csvContent += "\r";
142+
}
143+
144+
145+
var encodedUri = encodeURI(csvContent);
146+
var is_safari = navigator.userAgent.toLowerCase().indexOf('safari/') > -1;
147+
148+
if(!is_safari){
149+
var link = document.createElement("a");
150+
link.setAttribute("href", encodedUri);
151+
link.setAttribute("download", "my_data.csv");
152+
document.body.appendChild(link); // Required for FF
153+
link.click(); // This will download the data file named "my_data.csv".
154+
}else{
155+
var link = document.createElement("a");
156+
link.setAttribute("href", encodedUri);
157+
link.setAttribute("target", "_blank");
158+
document.body.appendChild(link); // Required for FF
159+
link.click(); // This will download the data file named "my_data.csv".
160+
}
161+
}
162+
}]
163+
})
102164
});
103165

166+
167+
168+
104169
var selModel = Ext.create('Ext.selection.CheckboxModel', {});
105170

106171
var genesTableForAspects = Ext.create('Ext.grid.Panel',{
@@ -133,17 +198,81 @@ aspectsTableViewer.prototype.generateTables = function() {
133198
var geneSelCntr = new geneSelectionController();
134199
geneSelCntr.setSelection( selectedGeneNames,'geneTableSelection','geneTableSelection');
135200

136-
var heatmapV = new heatmapViewer();
137-
heatmapV.setNamedSelectionToDisplayGenes('auto_geneTableSelection');
138-
heatmapV.drawHeatmap();
201+
var heatmapV = new heatmapViewer();
202+
heatmapV.setNamedSelectionToDisplayGenes('auto_geneTableSelection');
203+
heatmapV.drawHeatmap();
139204
} // selection change
140205
}, // listeners
141206
tbar: Ext.create('Ext.PagingToolbar', {
142-
displayInfo: true,
143-
prependButtons: true,
207+
displayInfo: true,
208+
prependButtons: true,
209+
items: [{
210+
xtype: 'button',
211+
glyph: 0xf0c7 , //fa-floppy-o
212+
tooltip: 'Export Selected',
213+
handler: function(){
214+
var grid = Ext.getCmp('genesAspectsTable');
215+
var csvContent = "data:text/csv;charset=utf-8\n";
216+
217+
var columns = grid.columnManager.columns;
218+
var columnsCount = columns.length;
219+
for (var i = 0; i < columnsCount; i++) {
220+
if (!columns[i].hidden) {
221+
csvContent += columns[i].text + ",";
222+
}
223+
}
224+
csvContent = csvContent.substring(0, csvContent.length-1);
225+
csvContent += "\r";
226+
227+
for (var j = 0; j<columnsCount; j++) {
228+
if(!columns[j].hidden){
229+
console.log(columns[j]);
230+
}
231+
}
232+
233+
var rows = grid.store.data.items;
234+
var rowsCount = rows.length;
235+
236+
for (var i = 0; i < rowsCount; i++) {
237+
var row = rows[i].data;
238+
for (var j = 1; j<columnsCount; j++) {
239+
if (!columns[j].hidden) {
240+
var value = row[columns[j].dataIndex];
241+
csvContent += "\"" + value + "\"" + ",";
242+
}
243+
}
244+
csvContent = csvContent.substring(0, csvContent.length-1);
245+
csvContent += "\r";
246+
}
247+
248+
249+
var encodedUri = encodeURI(csvContent);
250+
var is_safari = navigator.userAgent.toLowerCase().indexOf('safari/') > -1;
251+
252+
if(!is_safari){
253+
var link = document.createElement("a");
254+
link.setAttribute("href", encodedUri);
255+
link.setAttribute("download", "my_data.csv");
256+
document.body.appendChild(link); // Required for FF
257+
link.click(); // This will download the data file named "my_data.csv".
258+
}else{
259+
var link = document.createElement("a");
260+
link.setAttribute("href", encodedUri);
261+
link.setAttribute("target", "_blank");
262+
document.body.appendChild(link); // Required for FF
263+
link.click(); // This will download the data file named "my_data.csv".
264+
}
265+
}
266+
}] //tbar
144267
}) //tbar
145268
});
146269

270+
271+
272+
273+
274+
275+
147276
areaHolder.add([{
148277
type: 'panel',
149278
title: '',

inst/rookServerDocs/js/geneSetsTableViewer.js

+59-1
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,64 @@ if (gstv.autoShow) {
146146
displayInfo: true,
147147
prependButtons: true,
148148
items: [
149+
{
150+
xtype: 'button',
151+
glyph: 0xf0c7 , //fa-floppy-o
152+
tooltip: 'Export Selected',
153+
handler: function(){
154+
var grid = Ext.getCmp('genesetGenesTable');
155+
var csvContent = "data:text/csv;charset=utf-8\n";
156+
157+
var columns = grid.columnManager.columns;
158+
var columnsCount = columns.length;
159+
for (var i = 0; i < columnsCount; i++) {
160+
if (!columns[i].hidden) {
161+
csvContent += columns[i].text + ",";
162+
}
163+
}
164+
csvContent = csvContent.substring(0, csvContent.length-1);
165+
csvContent += "\r";
166+
167+
for (var j = 0; j<columnsCount; j++) {
168+
if(!columns[j].hidden){
169+
console.log(columns[j]);
170+
}
171+
}
172+
173+
var rows = grid.store.data.items;
174+
var rowsCount = rows.length;
175+
176+
for (var i = 0; i < rowsCount; i++) {
177+
var row = rows[i].data;
178+
for (var j = 1; j<columnsCount; j++) {
179+
if (!columns[j].hidden) {
180+
var value = row[columns[j].dataIndex];
181+
csvContent += "\"" + value + "\"" + ",";
182+
}
183+
}
184+
csvContent = csvContent.substring(0, csvContent.length-1);
185+
csvContent += "\r";
186+
}
187+
188+
189+
var encodedUri = encodeURI(csvContent);
190+
var is_safari = navigator.userAgent.toLowerCase().indexOf('safari/') > -1;
191+
192+
if(!is_safari){
193+
var link = document.createElement("a");
194+
link.setAttribute("href", encodedUri);
195+
link.setAttribute("download", "my_data.csv");
196+
document.body.appendChild(link); // Required for FF
197+
link.click(); // This will download the data file named "my_data.csv".
198+
}else{
199+
var link = document.createElement("a");
200+
link.setAttribute("href", encodedUri);
201+
link.setAttribute("target", "_blank");
202+
document.body.appendChild(link); // Required for FF
203+
link.click(); // This will download the data file named "my_data.csv".
204+
}
205+
}
206+
},
149207
{
150208
emptyText: 'Search...',
151209
xtype: 'textfield',
@@ -170,7 +228,7 @@ if (gstv.autoShow) {
170228

171229

172230
} // listeners
173-
} // search textbox
231+
}, // search textbox
174232
] // items
175233
}) // tbar
176234

0 commit comments

Comments
 (0)