Skip to content
Permalink
Browse files

remove nested array return

  • Loading branch information
yuj12001 committed Oct 1, 2015
1 parent e845f71 commit 85705d5f684dca3959ba24d169176d890de85ebb
Showing with 32 additions and 28 deletions.
  1. +14 −11 VQI_GenomeBrowser.js
  2. +18 −17 dynamic_loading.php
@@ -1243,8 +1243,8 @@ function VQI_GenomeBrowser(id, serviceURL) {
var start = (Math.round(xScale.domain()[0])).toString();
var end = (Math.round(xScale.domain()[1])).toString();
var chrom = chrom_curr;
var fileHandles = [fileHandle];
var name = [this.name];
//var fileHandles = [fileHandle];
var name = this.name;

var LoadingText = group.append("g")
LoadingText.append("rect")
@@ -1268,15 +1268,15 @@ function VQI_GenomeBrowser(id, serviceURL) {
dataType: "json",
data: {
"getTrackData": "",
"fileHandles": fileHandles,
"fileHandles": fileHandle,
"name": name,
"chrom": chrom,
"start": start,
"end": end
}

}).success(function (returnData) {
drawTrack(returnData[name]);
drawTrack(returnData);
LoadingText.remove();
}
).error(function (req, status, error) {
@@ -1511,8 +1511,8 @@ function VQI_GenomeBrowser(id, serviceURL) {
var start = (Math.round(xScale.domain()[0])).toString();
var end = (Math.round(xScale.domain()[1])).toString();
var chrom = chrom_curr;
var fileHandles = [fileHandle];
var name = [this.name];
//var fileHandles = [fileHandle];
var name = this.name;

var LoadingText = group.append("g")
LoadingText.append("rect")
@@ -1536,18 +1536,21 @@ function VQI_GenomeBrowser(id, serviceURL) {
dataType: "json",
data: {
"getTrackData": "",
"fileHandles": fileHandles,
"fileHandles": fileHandle,
"name": name,
"chrom": chrom,
"start": start,
"end": end
}

}).success(function (returnData) {
if(returnData.length === 1) //if no exons exist
drawTrack(returnData[name]);
else
drawTrack(returnData[name][0], returnData[name][1]);
if(returnData.length == 2) {//exons exist

drawTrack(returnData[0], returnData[1]);
}
else{
drawTrack(returnData);
}
LoadingText.remove();
}
).error(function (req, status, error) {
@@ -442,23 +442,23 @@ function getCpgTrackData($fileHandle,$chrom,$start,$end){
return $resArray;
}
function getTrackData($fileHandles,$name,$chrom,$start,$end){
$returnArray = [];
foreach ($fileHandles as $key => $value) {
function getTrackData($fileHandle,$name,$chrom,$start,$end){
# code...
if ($name[$key] == "HG19"){
$resArray = getHG19TrackData($fileHandles[$key],$chrom,$start,$end);
$returnArray["HG19"] = $resArray;
continue;
}
if ($name[$key] == "cpg"){
$resArray = getCpgTrackData($fileHandles[$key],$chrom,$start,$end);
$returnArray["cpg"] = $resArray;
continue;
}
if ($name == "HG19"){
$resArray = getHG19TrackData($fileHandle,$chrom,$start,$end);
return $resArray;
$fileHandle = $value;
}
else if ($name == "cpg"){
$resArray = getCpgTrackData($fileHandle,$chrom,$start,$end);
return $resArray;
}
//$fileHandle = $value;
else{
$db_name = $GLOBALS['db_name'];
$link = $GLOBALS['DBlink'];
$resArray = [];
@@ -517,10 +517,11 @@ function getTrackData($fileHandles,$name,$chrom,$start,$end){
array_push($resArray, $mergedRect);
}
$resArray = [$resArray];
$returnArray[$name[$key]] = $resArray;
// $resArray = [$resArray];
// $returnArray[$name[$key]] = $resArray;
//$array = [$resArray];
return $resArray;
}
return $returnArray;
}
function getFullTrackData($fileHandles){

0 comments on commit 85705d5

Please sign in to comment.
You can’t perform that action at this time.