Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add upload file
  • Loading branch information
yuj12001 committed Oct 11, 2015
1 parent 9d92804 commit c57eb45
Show file tree
Hide file tree
Showing 7 changed files with 227,662 additions and 20 deletions.
22 changes: 18 additions & 4 deletions VQI_GenomeBrowser.js
Expand Up @@ -719,18 +719,28 @@ function VQI_GenomeBrowser(id, serviceURL) {
{
if(key2 === 'custom' || key2 ==='genes')
{
checkTableUpload(genomes[key][key2].table_name)
checkTableUpload(genomes[key][key2].table_name, genomes[key][key2].file)
}
if(key2 === 'cpg')
{
var tempHandles = genomes[key][key2].table_name.split(",");
var fileHandles = genomes[key][key2].file.split(",");
for(var i in tempHandles)
{
checkTableUpload(tempHandles[i].trim())
checkTableUpload(tempHandles[i].trim(), fileHandles[i].trim())
}
}
}
}
selectBox = $("#" + divId +" #genomes").get(0);
selectBox.options.length = 0;
var optionIndex = 0;
for (var key in genomes) {
var text = key;
var value = key;
selectBox.options[optionIndex++] = new Option(text, value);
}

}

this.setGenome = function(genome) {
Expand All @@ -741,19 +751,21 @@ function VQI_GenomeBrowser(id, serviceURL) {
for(var key in genomes[genome])
{
this.addTrack(genome+"_"+key, key, genomes[genome][key])
// console.log(genomes[genome][key]);
}
}
}

var checkTableUpload = function(tableName) {
var checkTableUpload = function(tableName,filePath) {

$.ajax({
url: serviceURL,
type: 'POST',
dataType: "json",
data: {
"checkTable": "",
"tableName": tableName
"tableName": tableName,
"filePath": filePath
}

}).success(function (returnData) {
Expand Down Expand Up @@ -1225,6 +1237,7 @@ function VQI_GenomeBrowser(id, serviceURL) {
}

}).success(function (returnData) {
// console.log(returnData);
drawTrack(returnData);
LoadingText.remove();
}
Expand Down Expand Up @@ -1490,6 +1503,7 @@ function VQI_GenomeBrowser(id, serviceURL) {
}

}).success(function (returnData) {
// console.log(returnData);
if(returnData.length == 2) {//exons exist

drawTrack(returnData[0], returnData[1]);
Expand Down
24 changes: 14 additions & 10 deletions VQI_GenomeBrowserDemo.html
Expand Up @@ -45,21 +45,25 @@
/*fasta: {fasta: "../../genome/hg19.fa", index: "../../genome/hg19.fa.fai"},
genes: {file: "../../genome/hg19_genes.txt", table_name:'hg19_gene_annotation'},
cpg: {file: "../../genome/hg19_genes.txt", table_name:'hg19_cpg'},*/
fasta: {fasta: "/Users/corywang/Downloads/hg19.fa.txt", index : "/Users/corywang/Downloads/hg19.fa.fai.txt"},
genes: {file: "", table_name: "upload1436481988"},
cpg: {file: "", table_name: "upload1437097194,upload1437098473,upload1437098556"},
custom: {file: "", table_name:'upload1436411775'}
//fasta: {fasta: "/Users/corywang/Downloads/hg19.fa.txt", index : "/Users/corywang/Downloads/hg19.fa.fai.txt"},
genes: {file: "hg19_refgene.txt", table_name: "hg19_refgene"},
cpg: {file: "cpg_site_hg19.txt,shelve_hg19.txt,shoer_hg19.txt", table_name: "cpg_site_hg19,shelve_hg19,shoer_hg19"},
//custom: {file: "", table_name:'upload1436411775'}
},
"MM9":{
fasta: {fasta: "/Users/corywang/Downloads/mm9.fa.txt", index: "/Users/corywang/Downloads/mm9.fa.fai.txt"},
//genes: {file: "../../genome/mm9/mm9_genes.txt", table_name:'mm9_gene_annotation'},
// "MM9":{
// fasta: {fasta: "/Users/corywang/Downloads/mm9.fa.txt", index: "/Users/corywang/Downloads/mm9.fa.fai.txt"},
// //genes: {file: "../../genome/mm9/mm9_genes.txt", table_name:'mm9_gene_annotation'},

// gene_annotation: {label: 'mm9', table_name:'mm9_gene_annotation'},
},
// // gene_annotation: {label: 'mm9', table_name:'mm9_gene_annotation'},
// },
};

obj.loadGenomes(genomes); //loads the genomes based on the datastructure described above
obj.setGenome("HG19");
setTimeout(function(){ hs()}, 3000);
function hs (){
obj.setGenome("HG19");
}
//obj.setGenome("HG19");
// obj.setGenome("MM9"); //should set hg19 genome in dropdown and display fasta, cpg and genes tracks.

// addTrack(); should add track using the data array supplied.
Expand Down

0 comments on commit c57eb45

Please sign in to comment.