Skip to content

Commit

Permalink
fix html
Browse files Browse the repository at this point in the history
  • Loading branch information
evanbiederstedt committed Nov 15, 2021
2 parents 524d506 + eba5e1e commit 9bc9bb2
Show file tree
Hide file tree
Showing 6 changed files with 202 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## Upcoming

## [1.0.7] - 2020-11-14

- Added ability to export data in grids as *csv
- Small revisions to docs

## [1.0.6] - 2020-10-06

- Fixed `read10xMatrix()` to work with new 10x files
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: pagoda2
Title: Single Cell Analysis and Differential Expression
Version: 1.0.6
Version: 1.0.7
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")))
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.
License: GPL-3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,5 @@ If you find `pagoda2` useful for your publication, please cite:
```
Nikolas Barkas, Viktor Petukhov, Peter Kharchenko and Evan
Biederstedt (2021). pagoda2: Single Cell Analysis and Differential
Expression. R package version 1.0.6.
Expression. R package version 1.0.7.
```
1 change: 1 addition & 0 deletions doc/pagoda2.walkthrough.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@
</head>

<body>

<h1>Pagoda2 Walkthrough</h1>

<h2>Overview</h2>
Expand Down
141 changes: 135 additions & 6 deletions inst/rookServerDocs/js/aspectsTableViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,74 @@ aspectsTableViewer.prototype.generateTables = function() {
],
listeners: {
'selectionchange': genesetSelectionChangeListener
}
},
tbar: Ext.create('Ext.PagingToolbar', {
displayInfo: true,
prependButtons: true,
items: [{
xtype: 'button',
glyph: 0xf0c7 , //fa-floppy-o
tooltip: 'Export Selected',
handler: function(){
var grid = Ext.getCmp('genesetsAspectTable');
var csvContent = "data:text/csv;charset=utf-8\n";

var columns = grid.columnManager.columns;
var columnsCount = columns.length;
for (var i = 0; i < columnsCount; i++) {
if (!columns[i].hidden) {
csvContent += columns[i].text + ",";
}
}
csvContent = csvContent.substring(0, csvContent.length-1);
csvContent += "\r";

for (var j = 0; j<columnsCount; j++) {
if(!columns[j].hidden){
console.log(columns[j]);
}
}

var rows = grid.store.data.items;
var rowsCount = rows.length;

for (var i = 0; i < rowsCount; i++) {
var row = rows[i].data;
for (var j = 1; j<columnsCount; j++) {
if (!columns[j].hidden) {
var value = row[columns[j].dataIndex];
csvContent += "\"" + value + "\"" + ",";
}
}
csvContent = csvContent.substring(0, csvContent.length-1);
csvContent += "\r";
}


var encodedUri = encodeURI(csvContent);
var is_safari = navigator.userAgent.toLowerCase().indexOf('safari/') > -1;

if(!is_safari){
var link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("download", "my_data.csv");
document.body.appendChild(link); // Required for FF
link.click(); // This will download the data file named "my_data.csv".
}else{
var link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("target", "_blank");
document.body.appendChild(link); // Required for FF
link.click(); // This will download the data file named "my_data.csv".
}
}
}]
})
});




var selModel = Ext.create('Ext.selection.CheckboxModel', {});

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

var heatmapV = new heatmapViewer();
heatmapV.setNamedSelectionToDisplayGenes('auto_geneTableSelection');
heatmapV.drawHeatmap();
var heatmapV = new heatmapViewer();
heatmapV.setNamedSelectionToDisplayGenes('auto_geneTableSelection');
heatmapV.drawHeatmap();
} // selection change
}, // listeners
tbar: Ext.create('Ext.PagingToolbar', {
displayInfo: true,
prependButtons: true,
displayInfo: true,
prependButtons: true,
items: [{
xtype: 'button',
glyph: 0xf0c7 , //fa-floppy-o
tooltip: 'Export Selected',
handler: function(){
var grid = Ext.getCmp('genesAspectsTable');
var csvContent = "data:text/csv;charset=utf-8\n";

var columns = grid.columnManager.columns;
var columnsCount = columns.length;
for (var i = 0; i < columnsCount; i++) {
if (!columns[i].hidden) {
csvContent += columns[i].text + ",";
}
}
csvContent = csvContent.substring(0, csvContent.length-1);
csvContent += "\r";

for (var j = 0; j<columnsCount; j++) {
if(!columns[j].hidden){
console.log(columns[j]);
}
}

var rows = grid.store.data.items;
var rowsCount = rows.length;

for (var i = 0; i < rowsCount; i++) {
var row = rows[i].data;
for (var j = 1; j<columnsCount; j++) {
if (!columns[j].hidden) {
var value = row[columns[j].dataIndex];
csvContent += "\"" + value + "\"" + ",";
}
}
csvContent = csvContent.substring(0, csvContent.length-1);
csvContent += "\r";
}


var encodedUri = encodeURI(csvContent);
var is_safari = navigator.userAgent.toLowerCase().indexOf('safari/') > -1;

if(!is_safari){
var link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("download", "my_data.csv");
document.body.appendChild(link); // Required for FF
link.click(); // This will download the data file named "my_data.csv".
}else{
var link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("target", "_blank");
document.body.appendChild(link); // Required for FF
link.click(); // This will download the data file named "my_data.csv".
}
}
}] //tbar
}) //tbar
});







areaHolder.add([{
type: 'panel',
title: '',
Expand Down
60 changes: 59 additions & 1 deletion inst/rookServerDocs/js/geneSetsTableViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,64 @@ if (gstv.autoShow) {
displayInfo: true,
prependButtons: true,
items: [
{
xtype: 'button',
glyph: 0xf0c7 , //fa-floppy-o
tooltip: 'Export Selected',
handler: function(){
var grid = Ext.getCmp('genesetGenesTable');
var csvContent = "data:text/csv;charset=utf-8\n";

var columns = grid.columnManager.columns;
var columnsCount = columns.length;
for (var i = 0; i < columnsCount; i++) {
if (!columns[i].hidden) {
csvContent += columns[i].text + ",";
}
}
csvContent = csvContent.substring(0, csvContent.length-1);
csvContent += "\r";

for (var j = 0; j<columnsCount; j++) {
if(!columns[j].hidden){
console.log(columns[j]);
}
}

var rows = grid.store.data.items;
var rowsCount = rows.length;

for (var i = 0; i < rowsCount; i++) {
var row = rows[i].data;
for (var j = 1; j<columnsCount; j++) {
if (!columns[j].hidden) {
var value = row[columns[j].dataIndex];
csvContent += "\"" + value + "\"" + ",";
}
}
csvContent = csvContent.substring(0, csvContent.length-1);
csvContent += "\r";
}


var encodedUri = encodeURI(csvContent);
var is_safari = navigator.userAgent.toLowerCase().indexOf('safari/') > -1;

if(!is_safari){
var link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("download", "my_data.csv");
document.body.appendChild(link); // Required for FF
link.click(); // This will download the data file named "my_data.csv".
}else{
var link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("target", "_blank");
document.body.appendChild(link); // Required for FF
link.click(); // This will download the data file named "my_data.csv".
}
}
},
{
emptyText: 'Search...',
xtype: 'textfield',
Expand All @@ -170,7 +228,7 @@ if (gstv.autoShow) {


} // listeners
} // search textbox
}, // search textbox
] // items
}) // tbar

Expand Down

0 comments on commit 9bc9bb2

Please sign in to comment.