Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a8b2441
Fix variable name
bgruening Jul 10, 2015
c2d145d
Add an alert when BIOM file is missing metadata.
blankenberg Mar 31, 2016
f829061
Allow loading biom by url query parameter named biomURL.
blankenberg Mar 31, 2016
b0ab071
Fix for preparsed JSON when loading from URLs.
blankenberg Mar 31, 2016
1d6747e
provide loading url message
blankenberg Mar 31, 2016
3bc240e
Add alert when taxonomy metadata is missing in taxonomyViz
blankenberg Mar 31, 2016
4d847c2
Fixes for BIOM files that don't have column metadata.
blankenberg Apr 1, 2016
5a0bc7b
Add biojs-io-biom module as library
iimog Oct 21, 2016
1c1153e
Include biojs-io-biom in index
iimog Oct 21, 2016
0e354dc
Update license to BSD 2-clause
iimog Oct 21, 2016
66f9583
Add biom-conversion-server via composer
iimog Oct 21, 2016
6a1a0f2
Copy convert.php to server directory
iimog Oct 21, 2016
1798761
Add missing font. Fix 404
iimog Oct 21, 2016
eb53800
Allow all browsers that have required capabilities
iimog Oct 21, 2016
911621d
Convert BIOM 2.x to BIOM 1.0 if required
iimog Oct 21, 2016
f4ce70b
Convert matrix type to sparse on the fly
iimog Oct 21, 2016
018f5b1
Add export as svg
iimog Oct 21, 2016
6ef9c54
Add biom-conversion-server to list of used tools
iimog Oct 21, 2016
f09bca1
Add missing column in dbschema
iimog Oct 21, 2016
e5ecca5
Fix dbconfig-sample.php
iimog Oct 21, 2016
58a61e2
Fix hide wrong OTU bug. Fix #69
iimog Jan 5, 2017
7ebcccd
Fix incomplete sample list bug. Fix #70
iimog Jan 11, 2017
809128e
Fix yScale in donut partition chart. Fix #72
iimog Mar 16, 2017
fa7b558
Refresh filtering livePreview by click on any checkbox. Fix #73
iimog Apr 11, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
697 changes: 23 additions & 674 deletions LICENSE

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ JSZip: http://stuk.github.io/jszip/<br>
Lo-Dash: http://lodash.com/<br>
lz-string: https://github.com/pieroxy/lz-string<br>
md5-js: https://github.com/wbond/md5-js<br>
biom-conversion-server: https://github.com/molbiodiv/biom-conversion-server<br>
biojs-io-biom: https://github.com/molbiodiv/biojs-io-biom<br>

## License
The BSD 2-Clause License
Binary file added css/font/Karla
Binary file not shown.
1 change: 1 addition & 0 deletions data/dbschema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ CREATE TABLE IF NOT EXISTS `SharedData` (
`visualization_options` text NOT NULL,
`date_uploaded` datetime NOT NULL,
`countView` int(10) NOT NULL,
`filter_options_json` text NOT NULL,
PRIMARY KEY (`SharedData_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

Expand Down
5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<meta property="og:image" content="img/phinch-logo.jpg">
<meta property="og:site_name" content="PHINCH">

<script src="lib/jquery-1.10.1.min.js"></script>
<!-- Google Analytics -->
<script type="text/javascript">
var _gaq = _gaq || [];
Expand Down Expand Up @@ -130,12 +131,12 @@ <h1>About Phinch</h1>
Copyright © 2014 Phinch. Phinch is supported by the <a href="http://www.sloan.org/" target="_blank">Alfred P. Sloan Foundation</a>. This content is released under <a href="http://opensource.org/licenses/BSD-2-Clause" target="_blank">The BSD 2-Clause License</a>. <span><a href="https://groups.google.com/forum/#!forum/phinch" target="_blank"><i class="icon-fa-users icon-large"></i>&nbsp;&nbsp;Google Group</a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://github.com/PitchInteractiveInc/Phinch" target="_blank"><i class="icon-github icon-large"></i>&nbsp;&nbsp;Github</a></span>
</section>

<script src="lib/biojs-io-biom.min.js"></script>
<script src="lib/indexedDB.polyfill.js"></script>
<script src="lib/db.js"></script>
<script src="lib/jquery-1.10.1.min.js"></script>
<script src="lib/jquery-ui-1.10.3.custom.min.js"></script>
<script src="lib/blob.js"></script>

<script src="scripts/readFile.js"></script>
<script src="scripts/init.js"></script>
<script> var app; window.onload = function() { app = new init('home');} </script>
Expand Down
8 changes: 8 additions & 0 deletions lib/biojs-io-biom.min.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions server/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"iimog/biom-conversion-server": "^1.0"
}
}
58 changes: 58 additions & 0 deletions server/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 63 additions & 0 deletions server/convert.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php

namespace biomcs;

/**
* This file converts base64 encoded "content" "to" the desired format (hdf5 or json)
* The output format is json that contains biom data base64 encoded as part of the output array:
* Example:
* {
* content: "iUhERg0KGgoAAAAAAAgIAAQAEAAAAAAAAAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/zCEAAAAAAAA...AAAAAAAAAAAAAAAAAAA",
* error: null
* }
*/

// Allow CORS
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: Content-Type");
// Set own content type
header("Content-Type: application/json");

require_once __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php';
// explicitly set CONTENT_TYPE if empty (required for testing)
if(empty($_SERVER['CONTENT_TYPE']))
{
$_SERVER['CONTENT_TYPE'] = "application/x-www-form-urlencoded";
}
// load json data into $_REQUEST if content type is application/json
if($_SERVER["CONTENT_TYPE"] === 'application/json'){
$_REQUEST = json_decode(file_get_contents('php://input'), true);
}
$to = isset($_REQUEST["to"]) ? $_REQUEST["to"] : false;
$content = isset($_REQUEST["content"]) ? $_REQUEST["content"] : false;
$content = base64_decode($content);
if (!$to) {
echo json_encode(array("error" => "Missing parameter 'to' please set to 'json' or 'hdf5'"));
} elseif ($to !== 'json' && $to !== 'hdf5') {
echo json_encode(array("error" => "Illegal value of 'to' parameter please set to 'json' or 'hdf5'"));
} elseif (!$content) {
echo json_encode(array("error" => "Missing parameter 'content' please send the content to convert as base64 encoded string"));
} else {
$biomcs = new BiomCS();
try {
if ($to === "json") {
echo json_encode(
array(
"content" => base64_encode($biomcs->convertToJSON($content)),
"error" => null
),
JSON_PRETTY_PRINT
);
} elseif ($to === "hdf5") {
print json_encode(
array(
"content" => base64_encode($biomcs->convertToHDF5($content)),
"error" => null
),
JSON_PRETTY_PRINT
);
}
} catch (\Exception $e) {
echo json_encode(array("error" => $e->getMessage()), JSON_PRETTY_PRINT);
}
}
3 changes: 1 addition & 2 deletions server/dbconfig-sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
);


$db = new PDO('mysql:host=' . $dbConfig['host'].';dbname=' . $dbConfig['host'],
$db = new PDO('mysql:host=' . $dbConfig['host'].';dbname=' . $dbConfig['dbname'],
$dbConfig['username'], $dbConfig['password']);
var_dump($db)
?>
7 changes: 7 additions & 0 deletions server/vendor/autoload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

// autoload.php @generated by Composer

require_once __DIR__ . '/composer' . '/autoload_real.php';

return ComposerAutoloaderInit2098943a8ff25d68413e17489441d42a::getLoader();
Loading