diff --git a/cgi-bin/core/custom.js b/cgi-bin/core/custom.js index c65e4f3..5f07da1 100644 --- a/cgi-bin/core/custom.js +++ b/cgi-bin/core/custom.js @@ -4,7 +4,7 @@ // //============================================================================= /** Current version of eFP-Seq Browser with the following format: [v-version][version number: #.#.#][-][p-public OR d-dev][year - 4 digits][month - 2 digits][day - 2 digits] */ -const version = "v1.3.13-p20220502"; +const version = "v1.3.14-p20220606"; /** Selected RPKM mode */ let colouring_mode = "abs"; diff --git a/cgi-bin/core/custom.min.js b/cgi-bin/core/custom.min.js index 07ef7e2..31700ef 100644 --- a/cgi-bin/core/custom.min.js +++ b/cgi-bin/core/custom.min.js @@ -1 +1 @@ -const version="v1.3.13-p20220502";let locus,colouring_mode="abs";null!=document.getElementById("locus")&&(locus=document.getElementById("locus").value);let new_locus,yscale_input,max_abs_scale,old_locus=locus;null!=document.getElementById("yscale_input")&&(yscale_input=document.getElementById("yscale_input").value),null!=document.getElementById("rpkm_scale_input")&&(max_abs_scale=document.getElementById("rpkm_scale_input").value);let locus_start=10326918,locus_end=10330048,splice_variants="",rnaseq_calls=[],exp_info=[],rnaseq_success=0;const date_obj=new Date;let rnaseq_success_current_time,rnaseq_success_end_time,rnaseq_success_start_time=date_obj.getTime(),max_absolute_fpkm=-1,max_log_fpkm=-1,svg_colouring_element=null,gene_structure_colouring_element=null,base_src="cgi-bin/data/bamdata_araport11.xml",upload_src="",dataset_dictionary={"Araport 11 RNA-seq data":"cgi-bin/data/bamdata_araport11.xml","Developmental transcriptome - Klepikova et al":"cgi-bin/data/bamdata_Developmental_transcriptome.xml"},loadNewDataset=!1,count_bam_entries_in_xml=113;function count_bam_num(){const e=new XMLHttpRequest,t=base_src;e.responseType="document",e.onreadystatechange=()=>{if(e.readyState===XMLHttpRequest.DONE&&200===e.status){const t=e.responseXML;t&&t.getElementsByTagName("file")?count_bam_entries_in_xml=e.responseXML.getElementsByTagName("file").length:null==t&&console.log("failed at response"),document.getElementById("testing_count").innerHTML=count_bam_entries_in_xml}},e.open("GET",t),e.send()}function loadingScreen(e=!0){if(!1===e){document.getElementById("loading_screen").className="loading",document.getElementById("body_of").className="body_of_loading",document.getElementById("bodyContainer").classList.add("progressLoading"),document.getElementById("loading_screen").removeAttribute("hidden");const e=document.getElementsByClassName("disableOnLoading");for(const t of e)$("#"+t.id).prop("disabled",!0)}else{document.getElementById("loading_screen").className="loading done_loading",document.getElementById("body_of").className="body_of_loading body_of_loading_done",document.getElementById("bodyContainer").classList.remove("progressLoading"),document.getElementById("loading_screen").setAttribute("hidden",!0);const e=document.getElementsByClassName("disableOnLoading");for(const t of e)$("#"+t.id).prop("disabled",!1);addGFF(),uploadingData=!1}}count_bam_num();const img_loading_base64="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAAAyCAYAAADP/dvoAAAABmJLR0QAwADAAMAanQdUAAAACXBIWXMAAA7CAAAOwgEVKEqAAAAAB3RJTUUH4AoRDzYeAMpyUgAABGJJREFUeNrt3TFoE3scwPGvjxtOzKAQMEOECBkyROhQsWOEChURBFtssdJFB9Gl4OJkwaEtRRAUdLAUqYJgwamIEFAwUoS43RCw0AwpOjhkuCHDQd5Qes9q+7A+7cP2+1na5K53cH/Kl19yIfu63W4XSZL2qL+8BJIkQyhJ0h4VfPvExMSEV0WStGt92zknQkmSE+GPFFOSpN00CToRSpJkCCVJhlCSJEMoSZIhlCTJEEqSZAglSTKEkiQZQkmSDKEkSYZQkiRDKEmSIZQkyRBKe8HDhw/5/Pnzbzn2/v3709/Hx8d/23kkGULpp01PT9NoNH7LsTudDgBJktBut0mSxAsu/Q8CL4G0fUmSEEURcRxTLpc5ePBguu3Lly9EUUQ2m6VcLm/4u0ajQRzH9PT0/PNPGARcu3aNXC6X7lMqlVheXv5u3/Xt69NjJpOht7fXBZEMobRz2u02Z8+eJY5jCoUCtVqN58+fU6lUePLkCXfu3KGnp4d6vU5vby9zc3PA2peCzs7OUiqVvjvm8ePHWVlZoVAocPr0aQYHB6nX6zSbTSqVSnqMk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TtfBI6YF OgIpadkaklGjZtrepIsXL63+U2s8vzHpila+0zsLEQe9ty+kQ7OuFgJ+pseY3nr5cIxtIQt6OkY/ 3lxReHMhF4nm1z+Zv6KP+/PdANuwQcLhhEyQAAAAAElFTkSuQmCC";function generate_colour(e,t,n){e=e.replace(/^\s*#|\s*$/g,""),t=t.replace(/^\s*#|\s*$/g,""),3==e.length&&(e=e.replace(/(.)/g,"$1$1")),3==t.length&&(t=t.replace(/(.)/g,"$1$1"));let l=parseInt(e.substr(0,2),16),o=parseInt(e.substr(2,2),16),a=parseInt(e.substr(4,2),16),s=parseInt(t.substr(0,2),16)-l,i=parseInt(t.substr(2,2),16)-o,r=parseInt(t.substr(4,2),16)-a;return s=(s*n+l).toString(16).split(".")[0],i=(i*n+o).toString(16).split(".")[0],r=(r*n+a).toString(16).split(".")[0],1==s.length&&(s="0"+s),1==i.length&&(i="0"+i),1==r.length&&(r="0"+r),"#"+s+i+r}function round(e,t){return parseFloat(e.toFixed(t))}let colouring_part;function colour_part_by_id(e,t,n,l){colouring_part="all";for(const r of sraList)e.replace("_svg","")==r&&(colouring_part=sraDict[r].svg_part);let o,a,s=n;s=Array.isArray(s)?s[variantPosition]:parseFloat(s),max_abs_scale=document.getElementById("rpkm_scale_input").value,(!max_abs_scale||max_abs_scale<=0)&&(max_abs_scale=1e3),document.getElementById(e)&&(o=document.getElementById(e).getElementsByTagName("path"),a=document.getElementById(e).getElementsByTagName("g"));let i=null;if(o&&a&&(i=Array.prototype.slice.call(o).concat(Array.prototype.slice.call(a))),null!=i){if("abs"==l){const e=255,t=255-parseInt(s/max_abs_scale*255),n=0;if("all"==colouring_part)for(const l of i)l.style.fill="rgb("+e+", "+t+", "+n+")";else for(const l of i)if(l.id==colouring_part)if("g"==l.tagName){const o=l.getElementsByTagName("path");for(const l of o)l.style.fill="rgb("+e+", "+t+", "+n+")"}else l.style.fill="rgb("+e+", "+t+", "+n+")"}else if("rel"==l){let e="";const t=3;let n=0;if("Missing controls data"!=s&&Math.abs(s)>t?n=t:"Missing controls data"!=s&&(n=Math.abs(s)),n/=t,"Missing controls data"==s?e="#D9D9D9":s>0?e=generate_colour("FFFF00","FF0000",n):0==s?e="FFFF00":s<0&&(e=generate_colour("FFFF00","0000FF",n)),"all"==colouring_part)for(const l of i)l.style.fill=e;else for(const l of i)if(l.id==colouring_part)if("g"==l.tagName){const t=l.getElementsByTagName("path");for(const n of t)n.style.fill=e}else l.style.fill=e}document.getElementById(e.replace("_svg","_rpkm")).innerHTML="Missing controls data"==s?s:round(s,2)}else console.log("Paths is null for id = "+e)}let rpkmAverage=1,rpkmMedian=1;function findRPKMValuesAcrossAll(){if(sraDict){const e=Object.keys(sraDict),t=[];let n=0;for(const l of e)if(sraDict[l].RPKM){const e=sraDict[l].RPKM[variantPosition];parseFloat(e)&&(t.push(e),n+=e)}t.length>0&&(rpkmMedian=math.median(t)),rpkmAverage=n/e.length}else displayError("ERROR IN RETRIEVING ALL DATA POINTS WITHIN DATASET")}function switchRPKMMode(e){let t=!1;"rel_radio"===e&&(t=!0),t?(colouring_mode="rel",document.getElementById("abs_radio").classList.remove("active"),document.getElementById("rel_radio").classList.add("active"),$("#rpkm_scale_input").prop("disabled",!0)):(colouring_mode="abs",document.getElementById("rel_radio").classList.remove("active"),document.getElementById("abs_radio").classList.add("active"),$("#rpkm_scale_input").removeAttr("disabled")),rnaseq_calls&&rnaseq_calls.length>0&&whichAbsOrRel()}function colour_svgs_now(){const e=colouring_mode;for(let t=0;t0?o=n/l:(rpkmMedian&&1===rpkmMedian&&findRPKMValuesAcrossAll(),o=rpkmMedian);let a=0;const s=[];let i="";i=sraDict[e].RPKM&&sraDict[e].RPKM[variantPosition]?sraDict[e].RPKM[variantPosition]:0,0==i&&0==o?exp_info[t].splice(4,1,0):a=Math.log2(i/o),s.push(a),sraDict[e].relativeRPKM=a,exp_info[t].splice(4,1,s),exp_info[t].splice(6,1,o),i>=max_absolute_fpkm&&(max_absolute_fpkm=i),"Missing controls data"!=exp_info[t][4]&&Math.abs(exp_info[t][4])>=max_log_fpkm&&Math.abs(exp_info[t][4])<1e3&&(max_log_fpkm=Math.abs(exp_info[t][4])),"rel"===colouring_mode?exp_info[t][4]||0==exp_info[t][4]||(exp_info[t][4]=-999999):exp_info[t][3][variantPosition]||0==exp_info[t][3][variantPosition]||(exp_info[t][3][variantPosition]=-999999)}else logError("Issue retrieving exp_info for "+e+" within BAM entry point "+t);whichAbsOrRel()}document.getElementById("landing").setAttribute("hidden","true"),$("#theTable").trigger("update"),change_rpkm_colour_scale(colouring_mode)}function get_input_values(){locus=document.getElementById("locus").value,locus=locus.trim().toUpperCase(),yscale_input=document.getElementById("yscale_input").value,("Auto"==yscale_input||parseInt(yscale_input)<1)&&(yscale_input=parseInt(-1)),max_abs_scale=document.getElementById("rpkm_scale_input").value}function update_all_images(e){null!=document.getElementById("locus")&&(new_locus=document.getElementById("locus").value,new_locus===old_locus?($.xhrPool.abortAll(),variants_radio_options(e)):new_locus!=old_locus&&(getGFF(new_locus),old_locus=new_locus,setTimeout((function(){$.xhrPool.abortAll(),variants_radio_options(e)}),1650)))}function variants_radio_options(e){get_input_values(),$.ajax({url:"./cgi-bin/get_gene_structures.cgi?locus="+locus,dataType:"json",success:function(t){locus_start=t.locus_start,locus_end=t.locus_end,splice_variants=JSON.stringify(t.splice_variants),populate_table(e),populate_efp_modal(e);const n=document.getElementById("variants_div");if(null!==n&&null!==n.firstChild&&void 0!==n.firstChild)for(;n.firstChild;)n.removeChild(n.firstChild);$("#variant_select").ddslick("destroy");let l='",$("#variants_div").append(l),document.getElementById("variant_select")&&$("#variant_select").ddslick({width:"100%",onSelected:function(){gene_structure_radio_on_change()}}),document.getElementById("landing").setAttribute("hidden","true"),$("#theTable").trigger("update")},error:function(){displayError("ERROR IN get_gene_structures !")}})}function displayError(e){$("#displayError").empty();let t='

'+e+"

PLEASE REFRESH PAGE, RELOAD OR RE-INPUT DATA OR TRY AGAIN AT A LATER TIME

";console.error("Error in logic:",e),$("#displayError").append(t),$("#locus_button").prop("disabled",!0),$("#abs_scale_button").prop("disabled",!0),progress_percent=100,$("div#progress").width(progress_percent+"%"),loadingScreen(!0),document.title=`eFP-Seq Browser: !ERROR! - ${locus} - ${datasetName}`}function logError(e){console.error("Error in logic:",e)}let variant_selected,variantPosition=0;function gene_structure_radio_on_change(){if(document.getElementsByClassName("dd-selected-value")&&document.getElementsByClassName("dd-selected-value")[0]&&document.getElementsByClassName("dd-selected-value")[0].value){variant_selected=document.getElementsByClassName("dd-selected-value")[0].value,variantPosition=variant_selected;let e=document.getElementsByClassName("dd-selected-image")[0].src;document.getElementsByClassName("dd-selected-image")&&document.getElementsByClassName("dd-selected-image")[0]&&!document.getElementsByClassName("dd-selected-image")[0].alt&&(document.getElementsByClassName("dd-selected-image")[0].alt="RNA-Seq Coverage");let t=document.getElementsByClassName("gene_structure_img");for(let n=0;n0)for(let n=0;n0&&(document.getElementById("compareGeneVariants").disabled=!1),t[3]||0==t[3]||(t[3]=-999999);let e="";if(variant_selected&&sraDict[n].RPKM&&sraDict[n].RPKM[variant_selected]){let l=sraDict[n].RPKM[variant_selected].toFixed(2);document.getElementById(t[0].split("_svg")[0]+"_rpkm").innerHTML=l,e=l}else{let n=0;document.getElementById(t[0].split("_svg")[0]+"_rpkm").innerHTML=n,e=n}colour_part_by_id(n+"_svg",sraDict[n].svg_part,e,colouring_mode)}}function parseIntArray(e){for(let t=0,n=e.length;t1?n[1]:e}else if("Amazon AWS"===sraDict[sraList[t]].bam_type){let e=sraDict[sraList[t]].drive_link,n=e.split("amazonaws.com/");1===n.length&&(n=e.split("araport.cyverse-cdn.tacc.cloud/")),match_drive=n.length>1?n[1]:e}data={status:e,numberofreads:sraDict[sraList[t]].numberofreads,hexcodecolour:sraDict[sraList[t]].hexColourCode,remoteDrive:match_drive,bamType:sraDict[sraList[t]].bam_type,filename:sraDict[sraList[t]].filenameIn,tissue:n,record:l,locus:locus,variant:1,start:locus_start,end:locus_end,yscale:yscale_input,cachedDatapoints:publicData,struct:splice_variants,dumpMethod:dumpMethod},$.ajax({method:"POST",url:rnaseq_image_url,data:data,dataType:"json",failure:function(){$("#failure").show()},success:function(e){let t=99;count_bam_entries_in_xml>0&&(t=parseInt((count_bam_entries_in_xml-1)/count_bam_entries_in_xml*100)),rnaseq_success++;let n=new Date;if(rnaseq_success_current_time=n.getTime(),progress_percent=rnaseq_change/count_bam_entries_in_xml*100,$("div#progress").width(progress_percent+"%"),progress_percent>t&&loadingScreen(!0),document.getElementById("progress_tooltip").innerHTML="Current progress is at "+progress_percent+"% done",document.getElementById("progress").title=progress_percent.toFixed(2)+"% ("+rnaseq_change+"/"+count_bam_entries_in_xml+")",document.title="eFP-Seq Browser:",progress_percent<100&&(document.title+=` Loading ${progress_percent.toFixed(1)}% -`),document.title+=` ${locus} - ${datasetName}`,e.status&&"success"===e.status&&e.record){let t=e.record||"unknown";if(listOfRecordsDisplayed.includes(t)?(t=findUnusedRecordDisplayName(t,listOfRecordsDisplayed),listOfRecordsDisplayed.push(t)):listOfRecordsDisplayed.push(t),listOfRecordsDisplayed=[],sraDict[t].bp_length=parseFloat(e.end)-parseFloat(e.start),sraDict[t].bp_start=parseFloat(e.start),sraDict[t].bp_end=parseFloat(e.end),sraDict[t].MappedReads=e.reads_mapped_to_locus,totalreadsMapped_dic[t]=e.totalReadsMapped,sraDict[t].locusValue=e.locus,sraDict[t].r=e.r,sraDict[t].dataVisualization=e.rnaseqbase64,locus!=e.locus)throw new Error(`ERROR: ${locus}'s RNA-Seq API request returned with data for some other locus.`);let n=[];if(e.ss_y&&e.sum_y&&e.sum_xy&&e.sum_x&&e.ss_x&&e.end&&e.start){parseInt(e.ss_y);let t=parseInt(e.sum_y),l=parseInt(e.ss_y),o=parseIntArray(e.sum_xy.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),a=parseIntArray(e.sum_x.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),s=(parseIntArray(e.sum_xx.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),parseIntArray(e.ss_x.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),parseIntArray(e.ss_x.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(","))),i=parseInt(e.end)-parseInt(e.start),r=[];for(let e=0;e=3?(document.getElementById(t+"_rnaseq_img").src="data:image/png;base64,"+e.rnaseqbase64,rnaseq_change+=1):(document.getElementById(t+"_rnaseq_img").src="https://"+window.location.host+window.location.pathname+"cgi-bin/img/error.webp",console.error("Unable to create RNA-Seq map coverage data for: Locus - "+locus+", SRA - "+t+", dataset - "+base_src)):(document.getElementById(t+"_rnaseq_img")&&(document.getElementById(t+"_rnaseq_img").src="https://"+window.location.host+window.location.pathname+"cgi-bin/img/error.webp"),console.error("Unable to create RNA-Seq map coverage data for: Locus - "+locus+", SRA - "+t+", dataset - "+base_src)),document.getElementById(t+"_rpb").innerHTML=parseFloat(n[0]).toFixed(2),sraDict[t].rpb=parseFloat(n[0]).toFixed(2),document.getElementById(t+"_rpkm").innerHTML=e["absolute-fpkm"],updateRPKMAbsoluteMax(e["absolute-fpkm"]),sraDict[t].RPKM=e["absolute-fpkm"],rpkmCount++,document.getElementById(t+"_totalReadsNum").innerHTML="Total reads = "+e.totalReadsMapped,callDumpOutputs)if(dumpOutputs+='\t\telif (record == "'+e.record+'"):\n',"complex"==dumpMethod){for(dumpOutputs+='\t\t\tdumpJSON(200, "'+e.locus+'", '+e.variant+", "+e.chromosome+", "+e.start+", "+e.end+', "'+e.record+'", "'+e.tissue+'", "'+e.rnaseqbase64+'", '+e.reads_mapped_to_locus+", "+e["absolute-fpkm"]+", ["+e.r+"], "+e.totalReadsMapped+", ["+e.exp_arr+"], [",n=0;nLoad time ~= "+String(round(parseInt(rnaseq_success_end_time-rnaseq_success_start_time)/6e4))+" mins."),document.getElementById("landing").setAttribute("hidden","true"),$("#theTable").trigger("update"),responsiveRNAWidthResize(),toggleResponsiveTable()}})}}}function findUnusedRecordDisplayName(e="unknown",t=sraList,n=0){if(Array.isArray(t)){let l=e+"_"+n;if(t.includes(l))findUnusedRecordDisplayName(e,t,n+1);else if(!t.includes(l))return l}else findUnusedRecordDisplayName(e,t=[])}function updateRPKMAbsoluteMax(e){let t=parseInt(document.getElementById("rpkm_scale_input").value);1e3===t&&(t=1);let n=parseInt(e);n>t&&(document.getElementById("rpkm_scale_input").value=n)}function checkAgainstSVG(e,t,n=!1){let l=t;if("ath-10dayOldSeedling.svg"===e||"ath-10dayOldSeedling.min.svg"===e)!0===n?l="10 Day Old Seedling":"all"!=t&&"root"!=t&&"shoot"!=t&&(l="all");else if("ath-15dayOldSeedling.svg"===e||"ath-15dayOldSeedling.min.svg"===e)!0===n?l="15 Day Old Seedling":"all"!=t&&"root"!=t&&"shoot"!=t&&(l="all");else if("ath-etiolatedSeedling.svg"===e||"ath-etiolatedSeedling.min.svg"===e)!0===n?l="Etiolated Seedling":"etiolatedseedling"!=t&&(l="etiolatedseedling");else if("ath-Flower.svg"===e||"ath-Flower.min.svg"===e)!0===n?l="Flower":"flower"!=t&&"receptacle"!=t&&(l="flower");else if("ath-FlowerParts.svg"===e||"ath-FlowerParts.min.svg"===e)!0===n?l="Flower Parts":"all"!=t&&"petals"!=t&&"stamen"!=t&&"sepals"!=t&&"carpels"!=t&&(l="all");else if("ath-GerminatingSeed.svg"===e||"ath-GerminatingSeed.min.svg"===e)!0===n?l="Germinating Seed":"all"!=t&&(l="all");else if("ath-Internode.svg"===e||"ath-Internode.min.svg"===e)!0===n?l="Internode":"all"!=t&&(l="all");else if("ath-leaf.svg"===e||"ath-leaf.min.svg"===e)!0===n?l="Leaf":"leaf"!=t&&(l="leaf");else if("ath-LeafParts.svg"===e||"ath-LeafParts.min.svg"===e)!0===n?l="Leaf Parts":"all"!=t&&"lamina"!=t&&"petiole"!=t&&"veins"!=t&&(l="all");else if("ath-Pollen.svg"===e||"ath-Pollen.min.svg"===e)!0===n?l="Pollen":"all"!=t&&(l="all");else if("ath-RootTip.svg"===e||"ath-RootTip.min.svg"===e)!0===n?l="Root Tip":"all"!=t&&(l="all");else if("ath-rosettePlusRoot.svg"===e||"ath-rosettePlusRoot.min.svg"===e)!0===n?l="Rosette Plus Root":"all"!=t&&"shoot"!=t&&"root"!=t&&(l="all");else if("ath-Seed1-4.svg"===e||"ath-Seed1-4.min.svg"===e)!0===n?l="Seed 1-4":"all"!=t&&(l="all");else if("ath-Seed5-7.svg"===e||"ath-Seed5-7.min.svg"===e)!0===n?l="Seed 5-7":"all"!=t&&(l="all");else if("ath-Seed8+.svg"===e||"ath-Seed8+.min.svg"===e)!0===n?l="Seed 8+":"all"!=t&&(l="all");else if("ath-SenescentLeaf.svg"===e||"ath-SenescentLeaf.min.svg"===e)!0===n?l="Senescent Leaf":"all"!=t&&(l="all");else if("ath-ShootApexInflorescense.svg"===e||"ath-ShootApexInflorescense.min.svg"===e)!0===n?l="Shoot Apex Inflorescense":"all"!=t&&(l="all");else if("ath-ShootApexVegetative-Transition.svg"===e||"ath-ShootApexVegetative-Transition.min.svg"===e)!0===n?l="Shoot Apex Vegetative-Transition":"all"!=t&&(l="all");else if("ath-Silique1-5.svg"===e||"ath-Silique1-5.min.svg"===e)!0===n?l="Silique 1-5":"all"!=t&&(l="all");else if("ath-Silique6-10.svg"===e||"ath-Silique6-10.min.svg"===e)!0===n?l="Silique 6-10":"all"!=t&&(l="all");else if("ath-YoungLeaf1-4.svg"===e||"ath-YoungLeaf1-4.min.svg"===e)!0===n?l="Young Leaf 1-4":"all"!=t&&(l="all");else if("ath-EarlyBuddingFlower.svg"===e||"ath-EarlyBuddingFlower.min.svg"===e)!0===n?l="Early Budding Flower":"all"!=t&&"shoot"!=t&&"buds"!=t&&(l="all");else if("ath-FlowerBud.svg"===e||"ath-FlowerBud.min.svg"===e)!0===n?l="Flower Bud":"flowerBud"==t&&"ath-10dayOldSeedling.min.svg"!==e||(l="flowerBud");else if("ath-Stamen.svg"===e||"ath-Stamen.min.svg"===e)!0===n?l="Stamen":"all"!=t&&"anthers"!=t&&"filament"!=t&&(l="all");else if("ath-StigmaAndOvaries.svg"===e||"ath-StigmaAndOvaries.min.svg"===e)!0===n?l="Stigma And Ovaries":"all"!=t&&"Stigma_tissue"!=t&&"Ovary_tissue"!=t&&(l="all");else if("ath-WholeSilique.svg"===e||"ath-WholeSilique.min.svg"===e)!0===n?l="Whole Silique":"all"!=t&&"silique"!=t&&"seed"!=t&&(l="silique");else if("ath-youngSeedling.svg"===e||"ath-youngSeedling.min.svg"===e)!0===n?l="Young Seedling":"all"!=t&&"root"!=t&&"hypocotyl"!=t&&"cotyledon"!=t&&(l="all");else if("ath-FlowerDevelopment1.svg"===e||"ath-FlowerDevelopment1.min.svg"===e)!0===n?l="Late Flower Development (1)":"flowerDevelopmentPart1"!=t&&(l="flowerDevelopmentPart1");else if("ath-FlowerDevelopment2.svg"===e||"ath-FlowerDevelopment2.min.svg"===e)!0===n?l="Flower Development 2":"flowerDevelopmentPart2"!=t&&(l="flowerDevelopmentPart2");else if("ath-FlowerDevelopment3.svg"===e||"ath-FlowerDevelopment3.min.svg"===e)!0===n?l="Flower Development 3":"flowerDevelopmentPart3"!=t&&(l="flowerDevelopmentPart3");else if("ath-FlowerDevelopment4.svg"===e||"ath-FlowerDevelopment4.min.svg"===e)!0===n?l="Flower Development 4":"flowerDevelopmentPart4"!=t&&(l="flowerDevelopmentPart4");else if("ath-FlowerDevelopment5.svg"===e||"ath-FlowerDevelopment5.min.svg"===e)!0===n?l="Flower Development 5":"flowerDevelopmentPart5"!=t&&(l="flowerDevelopmentPart5");else if("ath-FlowerDevelopment6-8.svg"===e||"ath-FlowerDevelopment6-8.min.svg"===e)!0===n?l="Flower Development 6-8":"flowerDevelopmentPart6"!=t&&(l="flowerDevelopmentPart6");else if("ath-FlowerDevelopment9-11.svg"===e||"ath-FlowerDevelopment9-11.min.svg"===e)!0===n?l="Flower Development 9-11":"flowerDevelopmentPart9"!=t&&(l="flowerDevelopmentPart9");else if("ath-FlowerDevelopment12-14.svg"===e||"ath-FlowerDevelopment12-14.min.svg"===e)!0===n?l="Flower Development 12-14":"flowerDevelopmentPart12"!=t&&(l="flowerDevelopmentPart12");else if("ath-FlowerDevelopment15-18.svg"===e||"ath-FlowerDevelopment15-18.min.svg"===e)!0===n?l="Flower Development 15-18":"flowerDevelopmentPart15"!=t&&(l="flowerDevelopmentPart15");else if("ath-FlowerDevelopment19.svg"===e||"ath-FlowerDevelopment19.min.svg"===e)!0===n?l="Flower Development 19":"flowerDevelopmentPart19"!=t&&(l="flowerDevelopmentPart19");else if("ath-Other.svg"===e||"ath-Other.min.svg"===e)if(!0===n)l="Other";else if("all"!=t)return"all";return l}let efp_table_column,variantdiv_str,sraList=[],sraDict={},sraCountDic={},tissueSRADic={},datasetName="data",iteration_num=1,moreDetails='Show More Details arrow_drop_down',lessDetails='Show Less Details arrow_drop_up';function populate_table(e){$("#theTable").empty(),$("#compareTable").empty(),rnaseq_calls=[],exp_info=[],rnaseq_success=0,date_obj5=new Date,rnaseq_success_start_time=date_obj5.getTime(),max_absolute_fpkm=-1,max_log_fpkm=-1,svg_colouring_element=null,gene_structure_colouring_element=null,sraList=[],sraDict={},sraCountDic={},tissueSRADic={},rpkmAverage=1,rpkmMedian=1;$("#theTable").append('
Title
Sorting arrow
RNA-Seq CoverageRNA-Seq mapped image
rpb
Default sort arrow
eFP (RPKM)
RPKM
Default sort arrow
Details
Default sort arrow
');$("#compareTable").append('
Title
RNA-Seq CoverageRNA-Seq mapped image
rpb
eFP (RPKM)
RPKM
Details
'),$.ajax({url:base_src,dataType:"xml",success:function(t){$(t).find("files").each((function(){datasetName=$(this).attr("xmltitle")||"Uploaded dataset",datasetName=datasetName.trim(),0===datasetName.length&&(datasetName="Uploaded dataset"),document.getElementById("uploaded_dataset").innerHTML=datasetName})),document.title="eFP-Seq Browser:",progress_percent<100&&(document.title+=` Loading ${progress_percent.toFixed(1)}% -`),document.title+=` ${locus} - ${datasetName}`,iteration_num=1,$(t).find("file").each((function(){let t=$(this).attr("record_number")||"unknown";if(sraList.includes(t)&&(t=findUnusedRecordDisplayName(t,sraList)),sraList.includes(t)){if(sraCountDic[t]){sraCountDic[t]+=1;let e=t+"("+sraCountDic[t]+")";sraList.push(e),sraDict[e]={}}}else sraCountDic[t]=1,sraList.push(t),sraDict[t]={};let n=$(this).attr("description");sraDict[t].title=n;let l=$(this).attr("info");sraDict[t].description=l;let o=$(this).attr("svgname");sraDict[t].svg=o;let a=$(this).attr("svg_subunit");a=checkAgainstSVG(o,a),sraDict[t].svg_part=a,tissueSRADic[checkAgainstSVG(o,a,!0)]?tissueSRADic[checkAgainstSVG(o,a,!0)].push(t):tissueSRADic[checkAgainstSVG(o,a,!0)]=[t];let s=$(this).attr("url");sraDict[t].url=s;let i=$(this).attr("publication_link");sraDict[t].publicationid=i;let r,d=$(this).attr("total_reads_mapped");null!=d&&""!=d||(d="0"),sraDict[t].numberofreads=d,r=null==$(this).attr("hex_colour")||""==$(this).attr("hex_colour")?"0x64cc65":$(this).attr("hex_colour"),sraDict[t].hexColourCode=r;let c=$(this).attr("filename");null!=c&&""!=c&&null!=c||(c="accepted_hits.bam"),sraDict[t].filenameIn=c;let u=$(this).attr("species");sraDict[t].species=u;let m=[];if(null==$(this).find("controls")[0].innerHTML)for(let e=1;e<$(this).find("controls")[0].childNodes.length;e+2)m.push($(this).find("controls")[0].childNodes[e].firstChild.textContent);else null!=$(this).find("controls")[0].innerHTML&&(m=$(this).find("controls")[0].innerHTML.replace(//g,"").replace(/<\/bam_exp>/g,",").replace(/\n/g," ").replace(/ /g,"").split(","));sraDict[t].controls=m;let g="";if(m.length>0)for(let e=m.length;e--;)"MEDIAN"!=m[e]?g+=''+m[e]+" ":g+=m[e];sraDict[t].links=g;let p="";if(m.length>0)for(let e=0;e',y="\n\t\n";y+="\t\t\n",v+='\n",v+=`\n\t\t\t\t\t\n\n\t\t\t\t`,v+='",v+='\n",v+='',v+='\n",v+='',v+="",iteration_num++,$("#theTable").append(v);let w=document.getElementsByClassName("fltrow")[0].childNodes[6];(w&&void 0===w.classList[0]||"undefined"===w.classList[0])&&(w.classList=["colCompare"],w.innerHTML=''),exp_info.push([t+"_svg",a,m,0,0,0,0]),!0===loadNewDataset?(setTimeout((function(){count_bam_num()}),200),setTimeout((function(){rnaseq_images(e)}),10)):rnaseq_images(e)})),$.tablesorter.addParser({id:"rpb_sorter",is:function(){return!1},format:function(e){return NaN==e?-99999:null==e?-999999:e==1/0?99999:e==-1/0?-99999:parseFloat(e)},type:"numeric"}),$.tablesorter.addParser({id:"rpkm_sorter",is:function(){return!1},format:function(e){return NaN==e?-99999:null==e?-999999:e==1/0?99999:e==-1/0?-99999:"Missing controls data"==e?-9999999:parseFloat(e)},type:"numeric"}),$("#theTable").tablesorter({headers:{0:{},1:{sorter:!1},2:{sorter:"rpb_sorter"},3:{},4:{sorter:"rpkm_sorter"},5:{}}}),$("#theTable").trigger("update")}});for(new TableFilter("theTable",{base_path:"cgi-bin/core/packages/tableFilter/",columns_exact_match:[!1,!1,!1,!1,!1,!1],watermark:["Filter","Filter","Filter","Filter","Filter","Filter"],highlight_keywords:!1,no_results_message:!0,auto_filter:!0,auto_filter_delay:500,col_1:"none",popup_filters:!1,filters_row_index:1,alternate_rows:!1,msg_filter:"Filtering..."}).init(),change_rpkm_colour_scale(colouring_mode),i=0;i',variantdiv_str+="",document.getElementsByClassName("fltrow")[0].childNodes[1].innerHTML=variantdiv_str,$("#variant_select").ddslick({width:"100%",onSelected:function(){gene_structure_radio_on_change()}})}function clickDetailsTextChange(e){if(null!=document.getElementById(e))if(document.getElementById(e).innerHTML==moreDetails){document.getElementById(e).setAttribute("hidden",!0);const t=document.getElementById(document.getElementById(e).name);t.textContent=t.getAttribute("name")}else if(document.getElementById(e).innerHTML==lessDetails){const t=e.substring(0,e.length-5);document.getElementById(t).removeAttribute("hidden");const n=document.getElementById(document.getElementById(e).name);n.textContent=truncateDescription(n.getAttribute("name"))}}function truncateDescription(e){if(null!=e||null!=e)return e.length>30?e.substring(0,30)+"...":e}let remainder_efp=0,efp_length=0,eFPSortedSRA=[],efp_RPKM_values=[];function populate_efp_modal(){toggleResponsiveTable(2),$("#efpModalTable").empty(),efp_table_column="",eFPSortedSRA=[];const e=document.getElementsByClassName("colTitle");for(let t=2;t AGI-ID: '+locus+"

"),"abs"===colouring_mode?$("#efpModalTable").append(`\n\t\t\t\t

\n\t\t\t\t\teFP Colour Scale:\n\n\t\t\t\t\t\n\n\t\t\t\t\tMin: ${Math.min.apply(null,efp_RPKM_values).toFixed(1)} RPKM,\n\n\t\t\t\t\tMax: ${Math.max.apply(null,efp_RPKM_values).toFixed(1)} RPKM\n\t\t\t\t

\n\n\t\t\t\t
\n\n\t\t\t\t
"+document.getElementById("xmlDatabase").value+"
'+n+"\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\n\t\t\t\t\t
'+"-9999
'+document.getElementById(o.substring(4).replace(".svg","_svg")).innerHTML+'
'+o.substring(4).replace(".svg","")+"
-9999
'+truncateDescription(l)+"
","Amazon AWS"===f&&(v+=''),t.includes("unknown")&&!i||(v+='"),v+='"+moreDetails.trim()+"",v+='
\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t`):"rel"===colouring_mode&&$("#efpModalTable").append(`\n\t\t\t\t

\n\t\t\t\t\teFP Colour Scale:\n\n\t\t\t\t\t\n\n\t\t\t\t\tMin: ${Math.min.apply(null,efp_RPKM_values).toFixed(1)},\n\n\t\t\t\t\tMax: ${Math.max.apply(null,efp_RPKM_values).toFixed(1)}\n\t\t\t\t

\n\n\t\t\t\t
\n\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t`),$("#efpModalTable").append('
'),i=0;i<11*~~(eFPSortedSRA.length/11);i+=11)if("null"!=document.getElementById(eFPSortedSRA[i+10]).outerHTML){efp_table_column="";for(let e=0;e<11;e++)efp_table_column+='
"+document.getElementById(eFPSortedSRA[i+e]+"_svg").outerHTML+''+eFPSortedSRA[i+e]+" - "+sraDict[eFPSortedSRA[i+e]].title+"
";efp_table_column+="",$("#eFPtable").append(efp_table_column)}for(let t=0;t<12;t++)if(remainder_efp===t){efp_table_column="";for(let e=remainder_efp;e>0;e--)efp_table_column+='
"+document.getElementById(eFPSortedSRA[efp_length-e]+"_svg").outerHTML+''+eFPSortedSRA[efp_length-e]+" - "+sraDict[eFPSortedSRA[efp_length-e]].title+"
";efp_table_column+="",$("#eFPtable").append(efp_table_column)}toggleResponsiveTable()}function change_rpkm_colour_scale(e){if(null===svg_colouring_element&&document.getElementById("flt3_theTable")&&document.getElementById("flt3_theTable").parentElement&&(svg_colouring_element=document.getElementById("flt3_theTable").parentElement),svg_colouring_element&&svg_colouring_element.innerHTML&&(svg_colouring_element.innerHTML=""),"rel"==e){const e=document.createElement("img");e.src="data:image/png;base64,"+relative_rpkm_scale,e.style="margin-top: 10px;",svg_colouring_element&&svg_colouring_element.appendChild(e)}else{const e=document.createElement("img");e.src="data:image/png;base64,"+absolute_rpkm_scale,e.style="margin-top: 10px;",e.alt="Absolute RPKM Scale",svg_colouring_element&&svg_colouring_element.appendChild(e)}const t=["colTitle","colRNA","colrpb","coleFP","colRPKM","colDetails"];let n=[];document.getElementsByClassName("fltrow")&&document.getElementsByClassName("fltrow")[0]&&(n=document.getElementsByClassName("fltrow")[0].getElementsByTagName("td"));for(let l=0;l=1&&e[2]<=5||"C"==e[2]||"M"==e[2]||"c"==e[2]||"m"==e[2])&&("G"==e[3]||"g"==e[3])&&e[4]>=0&&e[4]<=9&&e[5]>=0&&e[5]<=9&&e[6]>=0&&e[6]<=9&&e[7]>=0&&e[7]<=9&&e[8]>=0&&e[8]<=9?$("#locus_button").removeAttr("disabled"):$("#locus_button").prop("disabled",!0)}function yscale_validation(){const e=document.getElementById("yscale_input").value;parseInt(e)>0||"Auto"==e||""==e?$("#locus_button").removeAttr("disabled"):$("#locus_button").prop("disabled",!0)}function rpkm_validation(){parseInt(document.getElementById("rpkm_scale_input").value)>0?$("#abs_scale_button").removeAttr("disabled"):$("#abs_scale_button").prop("disabled",!0)}const base_dataset_dictionary={"Araport 11 RNA-seq data":"cgi-bin/data/bamdata_araport11.xml","Developmental transcriptome - Klepikova et al":"cgi-bin/data/bamdata_Developmental_transcriptome.xml"};let databasesAdded=!1;function reset_database_options(){$(".userAdded").remove(),dataset_dictionary=base_dataset_dictionary,list_modified=!1,databasesAdded=!1}let xml_title,get_xml_list_output=[],user_exist=!1,list_modified=!1,check_for_change=0,match_title={},title_list=[];function get_user_XML_display(){const e=findAuthUser();""==users_email&&null==users_email&&null==users_email||users_email!==e?""!=users_email&&users_email!=e&&(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in")):$.ajax({url:"https://bar.utoronto.ca/webservices/eFP-Seq_Browser/get_xml_list.php?user="+users_email,dataType:"json",failure:function(){console.log("ERROR! Something went wrong")},success:function(e){xml_title=void 0,match_title={},title_list=[];let t=1,n=1;if(get_xml_list_output=e,"fail"==get_xml_list_output.status)console.log("Error code: "+get_xml_list_output.error),user_exist=!1;else if("success"==get_xml_list_output.status){if(user_exist=!0,check_for_change!=get_xml_list_output.files.length&&(reset_database_options(),list_modified=!1),check_for_change=get_xml_list_output.files.length,get_xml_list_output.files.length>0)for(let e=0;e'+title_list[i]+"";list_modified=!0}),1e3)}databasesAdded=!0}})}let datalist=[],datalist_Title={};function create_data_list(e){if(datalist=[],datalist_Title={},e>0)for(let t=0;t{if(t.readyState===XMLHttpRequest.DONE&&200===t.status){let n=t.responseXML;if(n){let t=n.getElementsByTagName("files")[0].attributes.xmltitle.nodeValue;datalist_Title[t]=e[dlCallPosition],dlCallPosition+=1,DatalistXHRCall(e)}}},t.open("GET",n),t.send()}}function validateEmail(e){return/\S+@\S+\.\S+/.test(e)}function findAuthUser(){let e="";if(gapi){const t=gapi.auth2.getAuthInstance().currentUser;if(t){const n=Object.keys(t);for(const l of n){const n=t[l];if(n&&Object.keys(n).length>0){const t=Object.keys(n);for(const l of t){const t=n[l];if(t&&Object.keys(t).length>0){const n=Object.keys(t);for(const l of n){const n=t[l];if("string"==typeof n&&validateEmail(n)){e=n;break}}}}}}}else logError("Unable to reach current user from OAuth")}else logError("Unable to reach data from OAuth");return e}function check_if_Google_login(){const e=findAuthUser();""!=users_email&&users_email===e?!1===databasesAdded&&(document.getElementById("private_dataset_header").style.display="block",get_user_XML_display()):""!=users_email&&users_email!=e?(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in")):remove_private_database()}function add_user_xml_by_upload(){get_user_XML_display(),setTimeout((function(){const e=findAuthUser();user_exist?user_exist&&(null==dataset_dictionary[datasetName]?users_email===e?$.ajax({method:"POST",url:"https://bar.utoronto.ca/webservices/eFP-Seq_Browser/upload.php",data:{user:users_email,xml:upload_src,title:datasetName}}):""!=users_email&&users_email!=e&&(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in")):null!=dataset_dictionary[datasetName]&&(users_email===e?(list_modified=!1,check_for_change=0,$.ajax({url:"https://bar.utoronto.ca/webservices/eFP-Seq_Browser/delete_xml.php?user="+users_email+"&file="+match_title[datasetName]}),$.ajax({method:"POST",url:"https://bar.utoronto.ca/webservices/eFP-Seq_Browser/upload.php",data:{user:users_email,xml:upload_src,title:datasetName}})):""!=users_email&&users_email!=e&&(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in")))):users_email===e?$.ajax({method:"POST",url:"https://bar.utoronto.ca/webservices/eFP-Seq_Browser/upload.php",data:{user:users_email,xml:upload_src,title:datasetName}}):""!=users_email&&users_email!=e&&(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in")),get_user_XML_display()}),1e4)}let uploadingData=!1;function which_upload_option(){uploadingData=!0;const e=findAuthUser();""!=users_email&&users_email===e?document.getElementById("upload_modal").click():""!=users_email&&users_email!=e?(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in")):""==users_email&&document.getElementById("upload_logX").click()}const public_dataset_dictionary={"Araport 11 RNA-seq data":"cgi-bin/data/bamdata_araport11.xml","Developmental transcriptome - Klepikova et al":"cgi-bin/data/bamdata_Developmental_transcriptome.xml"};let public_title_list=[],total_amount_of_datasets=0;function delete_fill(){$("#delete_fill").empty(),$("#publicDatabaseDownload").empty(),public_title_list=[];for(let t in public_dataset_dictionary)public_dataset_dictionary.hasOwnProperty(t)&&public_title_list.push(t);let e=0;for(total_amount_of_datasets=public_title_list.length+title_list.length,i=0;i '+public_title_list[i]+"
"),e+=1;for(i=0;i '+title_list[i]+"
"),e+=1}let isDeletePublicDisabled=!1;function disableDeletePublic(){for(i=0;i\n\t\n",n+="\t\t"+fileTitle+"\n",n+=table_base,t.each((function(){n+="\t\t\n";const e=$(this).attr("description");n+="\t\t\t"+e+"\n";const t=$(this).attr("info");n+="\t\t\t"+t+"\n";const l=$(this).attr("record_number");n+="\t\t\t"+l+"\n";const o=$(this).attr("name");n+="\t\t\t"+o+"\n";const a=$(this).attr("bam_type");n+="\t\t\t"+a+"\n";let s=$(this).attr("filename");null!=s&&"undefined"!==s&&".bam"!==s||(s="accepted_hits.bam"),n+="\t\t\t"+s+"\n";const i=$(this).attr("publication_link");n+="\t\t\t"+i+"\n";const r=$(this).attr("url");n+="\t\t\t"+r+"\n";let d=$(this).attr("total_reads_mapped");null!=d&&""!=d||(d="0"),n+="\t\t\t"+d+"\n";const c=$(this).attr("read_map_method");n+="\t\t\t"+c+"\n";let u=$(this).attr("species");null!=u&&""!=u||(u="Arabidopsis thaliana"),n+="\t\t\t"+u+"\n";const m=$(this).attr("svgname");n+="\t\t\t"+m+"\n";const g=$(this).attr("svg_subunit");n+="\t\t\t"+g+"\n";let p="";if($(this).find("controls")[0].innerHTML)for(let n=1;n<$(this).find("controls")[0].childNodes.length;n+=2)$(this).find("controls")[0].childNodes[n].firstChild&&(p+=$(this).find("controls")[0].childNodes[n].firstChild.textContent,n<$(this).find("controls")[0].childNodes.length-2&&(p+=", "));n+="\t\t\t"+p+"\n";let _="";if($(this).find("groupwith")[0].innerHTML)for(let n=1;n<$(this).find("groupwith")[0].childNodes.length;n+=2)$(this).find("groupwith")[0].childNodes[n].firstChild&&(_+=$(this).find("groupwith")[0].childNodes[n].firstChild.textContent,n<$(this).find("groupwith")[0].childNodes.length-2&&(_+=", "));n+="\t\t\t"+_+"\n",n+="\t\t\n"})),n+="\t\n",document.getElementById("XMLtoCSVtable").innerHTML+=n}})}}function download_XMLtableCSV(){for(let e=0;e\n",e+=downloadIndexTable_base;for(const t of eFPSortedSRA)e+="\t\t\n",e+="\t\t\t"+sraDict[t].title+"\n",e+="\t\t\t"+t+"\n",e+="\t\t\t"+sraDict[t].svg.substr(4,sraDict[t].svg.length-8)+"\n",e+="\t\t\t"+sraDict[t].svg_part+"\n",e+="\t\t\t"+sraDict[t].locusValue+"\n",e+="\t\t\t"+String(sraDict[t].bp_length)+"\n",e+="\t\t\t"+String(sraDict[t].bp_start)+"\n",e+="\t\t\t"+String(sraDict[t].bp_end)+"\n",e+="\t\t\t"+sraDict[t].numberofreads+"\n",e+="\t\t\t"+String(sraDict[t].MappedReads)+"\n",e+="\t\t\t"+sraDict[t].rpb+"\n",e+="\t\t\t"+String(sraDict[t].RPKM[variantPosition].toFixed(2))+"\n",e+="\t\t\t"+String(sraDict[t].controlsString)+"\n",e+="\t\t\n";e+="\t\n",document.getElementById("hiddenDownloadModal_table").innerHTML+=e,$("#hiddenDownloadModal_table").tableToCSV(),document.getElementById("download_icon").classList.remove("progressLoading"),document.getElementById("bodyContainer").classList.remove("progressLoading")}let publicData=!0;function changePublicData(e=!1){publicData=!e&&!uploadingData&&(1==document.getElementById("xmlDatabase").selectedIndex||2==document.getElementById("xmlDatabase").selectedIndex)}let isPrecache=!0;function checkPreload(){if(get_input_values(),verifyLoci(locus)){loadingScreen(!1),progress_percent=0,document.title=`eFP-Seq Browser: Loading 0% - ${locus}`,document.getElementById("progress").title="0%",$("div#progress").width(progress_percent+"%");for(const e in public_dataset_dictionary){if(base_src===public_dataset_dictionary[e]){publicData=!0;break}publicData=!1}publicData&&"AT2G24270"==locus&&"simple"==dumpMethod&&!callDumpOutputs?(variants_radio_options(1),isPrecache=!0):(update_all_images(0),isPrecache=!1)}else console.error(`The following locus is not valid: ${locus}`)}function verifyLoci(e){if("string"==typeof e){const t=new RegExp("^[A][T][MC0-9][G][0-9]{5}[.][0-9]{1,2}$|^[A][T][MC0-9][G][0-9]{5}$","i");return e.trim().match(t)}return!1}let parse_output,GFF_List=[];function getGFF(e){GFF_List=[],$.ajax({url:"https://bar.utoronto.ca/webservices/bar_araport/gene_structure_by_locus.php?locus="+e,dataType:"json",failure:function(){console.log("Getting GFFs (getGFF) information failed to retrieve locus information from Araport11")},success:function(e){if(parse_output=e,parse_output.wasSuccessful){const e=parse_output.features[0].subfeatures;for(i=0;i0)for(let e=0;e0){const e=document.getElementById("locus").value.trim().split("/");e[0]?document.getElementById("locus").value=e[0].toUpperCase().trim():document.getElementById("locus").value=document.getElementById("locus").value.trim(),locus_validation()}}function returnBackToTop(){document.getElementById("main_content").scrollTop=0}function toggleOptionsTable(){"false"===document.getElementById("tableToggle").getAttribute("aria-expanded")?(document.getElementById("tableToggle").setAttribute("aria-expanded",!0),document.getElementById("filterDropdown").classList.add("show")):(document.getElementById("tableToggle").setAttribute("aria-expanded",!1),document.getElementById("filterDropdown").classList.remove("show"))}function toggleTableOptionsView(){document.getElementById("tableFilter-tab").classList.value.includes("active")?(document.getElementById("tableFilter-tab").classList.remove("active"),document.getElementById("eFPFilter-tab").classList.add("active"),document.getElementById("tableFilter").classList.remove("show","active"),document.getElementById("eFPFilter").classList.add("show","active")):(document.getElementById("tableFilter-tab").classList.add("active"),document.getElementById("eFPFilter-tab").classList.remove("active"),document.getElementById("tableFilter").classList.add("show","active"),document.getElementById("eFPFilter").classList.remove("show","active"))}let downloadDivNum=1;function downloadDiv(e){html2canvas(document.getElementById(e)).then((e=>{$("#appendCanvas").empty(),e.id="downloadDivNum_"+downloadDivNum,document.getElementById("appendCanvas").appendChild(e),document.getElementById("downloadDivNum_"+downloadDivNum).style.width="100%",$("#DownloadImageModal").modal("toggle"),downloadDivNum++}))}function displayNavBAR(e=!1){$("#navbar_menu").is(":visible")||e?(document.getElementById("navbar_menu").style.display="none",document.getElementById("main_content").className="col-sm-12",document.getElementById("openMenu").style.display="block",document.getElementById("theTable")&&document.getElementById("theTable").classList.add("RNATable")):!1===$("#navbar_menu").is(":visible")&&(document.getElementById("navbar_menu").style.display="block",document.getElementById("main_content").className="col-sm-9",document.getElementById("openMenu").style.display="none",document.getElementById("theTable")&&document.getElementById("theTable").classList.remove("RNATable"))}function adjustFooterSize(){const e=document.getElementById("navbar_menu");e&&(document.getElementById("nm_footer").style.width=e.offsetWidth+"px",e.scrollHeight==e.clientHeight?document.getElementById("nm_footer").classList.contains("navbar_menu_footer_overflow_abs")||(document.getElementById("nm_footer").classList.remove("navbar_menu_footer_overflow_sticky"),document.getElementById("nm_footer").classList.add("navbar_menu_footer_overflow_abs")):e.scrollHeight>e.clientHeight&&(document.getElementById("nm_footer").classList.contains("navbar_menu_footer_overflow_sticky")||(document.getElementById("nm_footer").classList.remove("navbar_menu_footer_overflow_abs"),document.getElementById("nm_footer").classList.add("navbar_menu_footer_overflow_sticky"))))}function adjustTableOptionsDropdownSize(){document.getElementById("filterDropdown").style.left=(document.body.offsetWidth-2*document.getElementById("tableToggle").offsetWidth-document.getElementById("filterDropdown").offsetWidth).toString()+"px"}function adjustSubmissionIFrameSize(){const e=.7*window.innerHeight;document.getElementById("submissioniframe").height=e+"px"}let usedToggle=!1;function toggleTableCol(e,t){const n=document.getElementsByClassName(e);if(t)for(const l of n)l&&l.removeAttribute("hidden");else if(!t)for(const l of n)l&&l.setAttribute("hidden",!0)}let responsiveRNAWidthAdjusted=!1;function responsiveRNAWidthResize(){const e=document.getElementsByClassName("responsiveRNAWidth");if(window.innerWidth<=575){for(i=0;i575&&responsiveRNAWidthAdjusted)for(i=0;i=1100&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!0,!0,!0,!0,!1):3==e||window.innerWidth<830&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!1,!1,!1,!1,!1):4==e||window.innerWidth<900&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!0,!1,!1,!1,!1):5==e||window.innerWidth<990&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!0,!1,!0,!1,!1):(6==e||window.innerWidth<1100&&!usedToggle)&&toggleResponsiveTableOptions(!0,!0,!0,!0,!0,!1,!1))}let ToggledTable=[!0,!0,!0,!0,!0,!0,!1];function RememberToggleOptions(e=!0,t=!0,n=!0,l=!0,o=!0,a=!0,s=!1){ToggledTable=[e,t,n,l,o,a,s]}const colSortList=["colTitle","colrpb","colRPKM","colDetails"];function ResizeArrowRow(){for(const e of colSortList){const t=e+"Row";document.getElementById(t).style.width=document.getElementById(t).parentNode.offsetWidth-2+"px";CheckElementWidth(e+"Arrow",8)}}function CheckElementWidth(e,t){document.getElementById(e).offsetWidth{-1!==navigator.userAgent.indexOf(e)&&o++})),o!=t){n=element,l=!1;break}}}if(n){$("#notChrome").empty();const e=' or through the following Google search results';$("#notChrome").append(e)}BrowserDetected=!0}}function CreateFilteredeFPList(){if($("#filtereFPList").empty(),tissueSRADic){const e=Object.keys(tissueSRADic);for(const t of e){let e='
  • ';e+='',e+='

    '+t+"

    ",e+="
  • ",$("#filtereFPList").append(e)}}else logError("Unable to use tissueSRADic")}function ToggleFilteredeFP(e,t){const n=e.replace("_"," "),l=tissueSRADic[n];if(!0===t)for(i=0;i1)if("locus"===l[0].split("%20").join(" ").trim()){const n=e.substring(6).split("%20").join(" ").trim();shareLinkInputs.locus=n,document.getElementById("locus").value=n,t=!0}else if("dataset"===l[0].split("%20").join(" ").trim()){const t=e.substring(8).split("%20").join(" ").trim();shareLinkInputs.dataset=t,base_src=t,n=!0}}t&&n?(emptyLanding(),progress_percent=0,document.title=`eFP-Seq Browser: Loading 0% - ${locus}`,sraDict={},sraCountDic={},loadNewDataset=!1,setTimeout((function(){count_bam_num(),disableAllComparison(),checkPreload()}),200),toggleResponsiveTable(0)):displayError(t&&!1===n?"ERROR IN SHARE LINK! Missing dataset":!1===t&&n?"ERROR IN SHARE LINK! Missing locus":"ERROR IN SHARE LINK! Missing locus and dataset")}}function copyToClipboard(){""!==document.getElementById("shareLinkTextArea").trim()&&(document.getElementById("shareLinkTextArea").select(),document.execCommand("copy"))}let allCheckedOptions=[];function tableCheckbox(e,t=!1){const n=e.split("_")[0];if(t)disableAllComparison();else if(!1===t&&document.getElementById(e)&&document.getElementById(e).checked){allCheckedOptions.push(n);const t={};for(let e=0;e';parseInt(e)===parseInt(variantPosition)?l+=''+document.getElementById(n+"_title").innerHTML+" ... ("+GFF_List[e]+")\n":l+='^^^ ... ('+GFF_List[e]+")\n",l+='RNA-Seq mapped image for:'+n+'
    Gene variant image for:'+n+'\n',l+=''+sraDict[n].r[e].toFixed(2)+"",l+='
    '+document.getElementById(sraDict[n].svg.substr(4).replace(".svg","_svg")).innerHTML+'
    '+sraDict[n].svg.substring(4).replace(".svg","")+"
    \n",l+=''+sraDict[n].RPKM[e].toFixed(2)+"",parseInt(e)===parseInt(variantPosition)?l+='
    '+document.getElementById(n+"_description").innerHTML+'
    '+document.getElementById("igbLink_"+n).innerHTML+'
    '+document.getElementById("extraLinks_"+n).innerHTML+"
    \n":l+='^^^\n',l+="",t[e]=n+"_compareRow"+e,document.getElementById("compareTable").innerHTML+=l,document.getElementById(n+"_rnaseq_img"+e)&&document.getElementById(n+"_rnaseq_img"+e).setAttribute("src",document.getElementById(n+"_rnaseq_img").src),document.getElementById(n+"_gene_structure_img"+e)&&document.getElementById(n+"_gene_structure_img"+e).setAttribute("src",document.getElementsByClassName("dd-option-image")[e].src),sraDict[n].RPKM&&sraDict[n].RPKM[e]&&colour_part_by_id(n+"_svg"+e,sraDict[n].svg_part,sraDict[n].RPKM[e],colouring_mode)}document.getElementById(e).checked=!0,document.getElementById("allCheckbox").checked=!0,"rel"!=colouring_mode&&(document.getElementById("compareGeneVariants").disabled=!1)}else!1===t?(disableCompare(n),allCheckedOptions.splice(allCheckedOptions.indexOf(n),1),document.getElementById(e).checked=!1):!0===t&&disableAllComparison(),0===allCheckedOptions.length&&(document.getElementById("compareGeneVariants").disabled=!0)}function disableCompare(e){for(let t=0;t=0;l--)document.getElementsByClassName("compareDataRow")[l].remove();allCheckedOptions=[],e=document.getElementsByClassName("compareCheckbox");for(let l=0;l0&&hiddenGoogleSignin(),getGFF(locus),$("#locus").autocomplete({source:function(e,t){const n=e.term.split(/,\s*/).pop();$.ajax({type:"GET",url:"https://bar.utoronto.ca/webservices/eFP-Seq_Browser/idautocomplete.cgi?species=Arabidopsis_thaliana&term="+n,dataType:"json"}).done((function(e){e&&e.length>=7?t(e.slice(0,7)):t(e)}))},close:function(){correctAGIIDInput()}});const e=document.getElementById("submissioniframe");e&&e.setAttribute("src",e.getAttribute("data-src")),adjustSubmissionIFrameSize(),readShareLink()}$(window).resize((function(){adjustFooterSize(),adjustSubmissionIFrameSize(),responsiveRNAWidthResize(),toggleResponsiveTable(),adjustTableOptionsDropdownSize(),setTimeout((function(){adjustFooterSize()}),10)})),adjustFooterSize(),window.addEventListener("load",(function(){init()})); \ No newline at end of file +const version="v1.3.14-p20220606";let locus,colouring_mode="abs";null!=document.getElementById("locus")&&(locus=document.getElementById("locus").value);let new_locus,yscale_input,max_abs_scale,old_locus=locus;null!=document.getElementById("yscale_input")&&(yscale_input=document.getElementById("yscale_input").value),null!=document.getElementById("rpkm_scale_input")&&(max_abs_scale=document.getElementById("rpkm_scale_input").value);let locus_start=10326918,locus_end=10330048,splice_variants="",rnaseq_calls=[],exp_info=[],rnaseq_success=0;const date_obj=new Date;let rnaseq_success_current_time,rnaseq_success_end_time,rnaseq_success_start_time=date_obj.getTime(),max_absolute_fpkm=-1,max_log_fpkm=-1,svg_colouring_element=null,gene_structure_colouring_element=null,base_src="cgi-bin/data/bamdata_araport11.xml",upload_src="",dataset_dictionary={"Araport 11 RNA-seq data":"cgi-bin/data/bamdata_araport11.xml","Developmental transcriptome - Klepikova et al":"cgi-bin/data/bamdata_Developmental_transcriptome.xml"},loadNewDataset=!1,count_bam_entries_in_xml=113;function count_bam_num(){const e=new XMLHttpRequest,t=base_src;e.responseType="document",e.onreadystatechange=()=>{if(e.readyState===XMLHttpRequest.DONE&&200===e.status){const t=e.responseXML;t&&t.getElementsByTagName("file")?count_bam_entries_in_xml=e.responseXML.getElementsByTagName("file").length:null==t&&console.log("failed at response"),document.getElementById("testing_count").innerHTML=count_bam_entries_in_xml}},e.open("GET",t),e.send()}function loadingScreen(e=!0){if(!1===e){document.getElementById("loading_screen").className="loading",document.getElementById("body_of").className="body_of_loading",document.getElementById("bodyContainer").classList.add("progressLoading"),document.getElementById("loading_screen").removeAttribute("hidden");const e=document.getElementsByClassName("disableOnLoading");for(const t of e)$("#"+t.id).prop("disabled",!0)}else{document.getElementById("loading_screen").className="loading done_loading",document.getElementById("body_of").className="body_of_loading body_of_loading_done",document.getElementById("bodyContainer").classList.remove("progressLoading"),document.getElementById("loading_screen").setAttribute("hidden",!0);const e=document.getElementsByClassName("disableOnLoading");for(const t of e)$("#"+t.id).prop("disabled",!1);addGFF(),uploadingData=!1}}count_bam_num();const img_loading_base64="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAAAyCAYAAADP/dvoAAAABmJLR0QAwADAAMAanQdUAAAACXBIWXMAAA7CAAAOwgEVKEqAAAAAB3RJTUUH4AoRDzYeAMpyUgAABGJJREFUeNrt3TFoE3scwPGvjxtOzKAQMEOECBkyROhQsWOEChURBFtssdJFB9Gl4OJkwaEtRRAUdLAUqYJgwamIEFAwUoS43RCw0AwpOjhkuCHDQd5Qes9q+7A+7cP2+1na5K53cH/Kl19yIfu63W4XSZL2qL+8BJIkQyhJ0h4VfPvExMSEV0WStGt92zknQkmSE+GPFFOSpN00CToRSpJkCCVJhlCSJEMoSZIhlCTJEEqSZAglSTKEkiQZQkmSDKEkSYZQkiRDKEmSIZQkyRBKe8HDhw/5/Pnzbzn2/v3709/Hx8d/23kkGULpp01PT9NoNH7LsTudDgBJktBut0mSxAsu/Q8CL4G0f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IkGUJJkgyhJEmGUJKkP9mWX8PkN9RLkpwIJUna5fZ1u92ul0GS5EQoSdIe9DfEVWhcl8IjHgAAAABJRU5ErkJggg==";let img_gene_struct_1="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAAAIBAMAAACYMuIQAAAAFVBMVEX///8AAADcFDz/jAAAAP+m 3KYAfQDytQt7AAAACXBIWXMAAA7EAAAOxAGVKw4bAAAATklEQVQ4jWNgYGANxQnC0iAggQEE0mAA lYcFgBWw4RZIQOEmYJNF0Q4zAQ4Qkqm4XQ8CIMWMw96HgsPdh4zD3oeCwx2MgDgc/vlw2JelAO7V xD0GmsY3AAAAAElFTkSuQmCC ";const img_gene_struct_error="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAAAICAIAAADlfmh0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAMBSURBVGhD7Vi7ceswEGQrVBUMxC40wwKYKVANDpwpVuIqVIx6ealxHxzuA9BPsmfMGQOzgQgs7hZH3RrW8O/20dHR0dHxMrqN7gbneZAxLg/3GAlh13R6r8QhmgYQDtc3/Py2TMOwni2hCtg13/UM7M1x/gh06b6JHwxVx2X9zzfb8W10G90NXF/JozhdnNEmCKsNGgUU6EQtTgTsetZG99DJv6Xh18/eEtDt9efRbXQ30O6mH8XpwszjdFDWBu0BF9K40XmlTqSDj/M6ljssBqeBKXDXRASagb0c536k+WE4XjjL7f3KZJ4sHH1HRgF5QFgfKggzoRxnXO5GdluD04mPcGQfwQR/5CNXimNE+rwxi4RKM1ZVYKoPGwfPJc2px4P6ktDwBfGn6HgV3UZ3g9QSeWQ35BH/W6cZaCrXP6m74kbxSmICoWaj9MGR5fIiBPFrMQJYoj50N53yiB1bOCyM5tER0llgMoaKwjY4GBMhqYuGls6sDQoowurB5cgtTqmeSZHgs7SrB0x4rYmZ/m7B0tfFyVkKxy+JHi+sNtPxHLqN7gbwvVctmh+LV4YZ5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KGgoAAAANSUhEUgAAALQAAAAPBAMAAAC/7vi3AAAAGFBMVEX///9QUFAAAADcFDz/jAAA AP+m3KYAfQCnICW7AAAArklEQVQ4jd3UMQ+CQAwF4OaG66ourpcO/DCGm7v17/vKBUU8SozBGBvy xo9HD6DzB3OicK4WTa7RfIGWgiiH0In6tBK/iMpKhsvyWAfB7NGlJEHQFA+6U5ZVjf2OTtfBI6YF OgIpadkaklGjZtrepIsXL63+U2s8vzHpila+0zsLEQe9ty+kQ7OuFgJ+pseY3nr5cIxtIQt6OkY/ 3lxReHMhF4nm1z+Zv6KP+/PdANuwQcLhhEyQAAAAAElFTkSuQmCC";function generate_colour(e,t,n){e=e.replace(/^\s*#|\s*$/g,""),t=t.replace(/^\s*#|\s*$/g,""),3==e.length&&(e=e.replace(/(.)/g,"$1$1")),3==t.length&&(t=t.replace(/(.)/g,"$1$1"));let l=parseInt(e.substr(0,2),16),o=parseInt(e.substr(2,2),16),a=parseInt(e.substr(4,2),16),s=parseInt(t.substr(0,2),16)-l,i=parseInt(t.substr(2,2),16)-o,r=parseInt(t.substr(4,2),16)-a;return s=(s*n+l).toString(16).split(".")[0],i=(i*n+o).toString(16).split(".")[0],r=(r*n+a).toString(16).split(".")[0],1==s.length&&(s="0"+s),1==i.length&&(i="0"+i),1==r.length&&(r="0"+r),"#"+s+i+r}function round(e,t){return parseFloat(e.toFixed(t))}let colouring_part;function colour_part_by_id(e,t,n,l){colouring_part="all";for(const r of sraList)e.replace("_svg","")==r&&(colouring_part=sraDict[r].svg_part);let o,a,s=n;s=Array.isArray(s)?s[variantPosition]:parseFloat(s),max_abs_scale=document.getElementById("rpkm_scale_input").value,(!max_abs_scale||max_abs_scale<=0)&&(max_abs_scale=1e3),document.getElementById(e)&&(o=document.getElementById(e).getElementsByTagName("path"),a=document.getElementById(e).getElementsByTagName("g"));let i=null;if(o&&a&&(i=Array.prototype.slice.call(o).concat(Array.prototype.slice.call(a))),null!=i){if("abs"==l){const e=255,t=255-parseInt(s/max_abs_scale*255),n=0;if("all"==colouring_part)for(const l of i)l.style.fill="rgb("+e+", "+t+", "+n+")";else for(const l of i)if(l.id==colouring_part)if("g"==l.tagName){const o=l.getElementsByTagName("path");for(const l of o)l.style.fill="rgb("+e+", "+t+", "+n+")"}else l.style.fill="rgb("+e+", "+t+", "+n+")"}else if("rel"==l){let e="";const t=3;let n=0;if("Missing controls data"!=s&&Math.abs(s)>t?n=t:"Missing controls data"!=s&&(n=Math.abs(s)),n/=t,"Missing controls data"==s?e="#D9D9D9":s>0?e=generate_colour("FFFF00","FF0000",n):0==s?e="FFFF00":s<0&&(e=generate_colour("FFFF00","0000FF",n)),"all"==colouring_part)for(const l of i)l.style.fill=e;else for(const l of i)if(l.id==colouring_part)if("g"==l.tagName){const t=l.getElementsByTagName("path");for(const n of t)n.style.fill=e}else l.style.fill=e}document.getElementById(e.replace("_svg","_rpkm")).innerHTML="Missing controls data"==s?s:round(s,2)}else console.log("Paths is null for id = "+e)}let rpkmAverage=1,rpkmMedian=1;function findRPKMValuesAcrossAll(){if(sraDict){const e=Object.keys(sraDict),t=[];let n=0;for(const l of e)if(sraDict[l].RPKM){const e=sraDict[l].RPKM[variantPosition];parseFloat(e)&&(t.push(e),n+=e)}t.length>0&&(rpkmMedian=math.median(t)),rpkmAverage=n/e.length}else displayError("ERROR IN RETRIEVING ALL DATA POINTS WITHIN DATASET")}function switchRPKMMode(e){let t=!1;"rel_radio"===e&&(t=!0),t?(colouring_mode="rel",document.getElementById("abs_radio").classList.remove("active"),document.getElementById("rel_radio").classList.add("active"),$("#rpkm_scale_input").prop("disabled",!0)):(colouring_mode="abs",document.getElementById("rel_radio").classList.remove("active"),document.getElementById("abs_radio").classList.add("active"),$("#rpkm_scale_input").removeAttr("disabled")),rnaseq_calls&&rnaseq_calls.length>0&&whichAbsOrRel()}function colour_svgs_now(){const e=colouring_mode;for(let t=0;t0?o=n/l:(rpkmMedian&&1===rpkmMedian&&findRPKMValuesAcrossAll(),o=rpkmMedian);let a=0;const s=[];let i="";i=sraDict[e].RPKM&&sraDict[e].RPKM[variantPosition]?sraDict[e].RPKM[variantPosition]:0,0==i&&0==o?exp_info[t].splice(4,1,0):a=Math.log2(i/o),s.push(a),sraDict[e].relativeRPKM=a,exp_info[t].splice(4,1,s),exp_info[t].splice(6,1,o),i>=max_absolute_fpkm&&(max_absolute_fpkm=i),"Missing controls data"!=exp_info[t][4]&&Math.abs(exp_info[t][4])>=max_log_fpkm&&Math.abs(exp_info[t][4])<1e3&&(max_log_fpkm=Math.abs(exp_info[t][4])),"rel"===colouring_mode?exp_info[t][4]||0==exp_info[t][4]||(exp_info[t][4]=-999999):exp_info[t][3][variantPosition]||0==exp_info[t][3][variantPosition]||(exp_info[t][3][variantPosition]=-999999)}else logError("Issue retrieving exp_info for "+e+" within BAM entry point "+t);whichAbsOrRel()}document.getElementById("landing").setAttribute("hidden","true"),$("#theTable").trigger("update"),change_rpkm_colour_scale(colouring_mode)}function get_input_values(){locus=document.getElementById("locus").value,locus=locus.trim().toUpperCase(),yscale_input=document.getElementById("yscale_input").value,("Auto"==yscale_input||parseInt(yscale_input)<1)&&(yscale_input=parseInt(-1)),max_abs_scale=document.getElementById("rpkm_scale_input").value}function update_all_images(e){null!=document.getElementById("locus")&&(new_locus=document.getElementById("locus").value,new_locus===old_locus?($.xhrPool.abortAll(),variants_radio_options(e)):new_locus!=old_locus&&(getGFF(new_locus),old_locus=new_locus,setTimeout((function(){$.xhrPool.abortAll(),variants_radio_options(e)}),1650)))}function variants_radio_options(e){get_input_values(),$.ajax({url:"./cgi-bin/get_gene_structures.cgi?locus="+locus,dataType:"json",success:function(t){locus_start=t.locus_start,locus_end=t.locus_end,splice_variants=JSON.stringify(t.splice_variants),populate_table(e),populate_efp_modal(e);const n=document.getElementById("variants_div");if(null!==n&&null!==n.firstChild&&void 0!==n.firstChild)for(;n.firstChild;)n.removeChild(n.firstChild);$("#variant_select").ddslick("destroy");let l='",$("#variants_div").append(l),document.getElementById("variant_select")&&$("#variant_select").ddslick({width:"100%",onSelected:function(){gene_structure_radio_on_change()}}),document.getElementById("landing").setAttribute("hidden","true"),$("#theTable").trigger("update")},error:function(){displayError("ERROR IN get_gene_structures !")}})}function displayError(e){$("#displayError").empty();let t='

    '+e+"

    PLEASE REFRESH PAGE, RELOAD OR RE-INPUT DATA OR TRY AGAIN AT A LATER TIME

    ";console.error("Error in logic:",e),$("#displayError").append(t),$("#locus_button").prop("disabled",!0),$("#abs_scale_button").prop("disabled",!0),progress_percent=100,$("div#progress").width(progress_percent+"%"),loadingScreen(!0),document.title=`eFP-Seq Browser: !ERROR! - ${locus} - ${datasetName}`}function logError(e){console.error("Error in logic:",e)}let variant_selected,variantPosition=0;function gene_structure_radio_on_change(){if(document.getElementsByClassName("dd-selected-value")&&document.getElementsByClassName("dd-selected-value")[0]&&document.getElementsByClassName("dd-selected-value")[0].value){variant_selected=document.getElementsByClassName("dd-selected-value")[0].value,variantPosition=variant_selected;let e=document.getElementsByClassName("dd-selected-image")[0].src;document.getElementsByClassName("dd-selected-image")&&document.getElementsByClassName("dd-selected-image")[0]&&!document.getElementsByClassName("dd-selected-image")[0].alt&&(document.getElementsByClassName("dd-selected-image")[0].alt="RNA-Seq Coverage");let t=document.getElementsByClassName("gene_structure_img");for(let n=0;n0)for(let n=0;n0&&(document.getElementById("compareGeneVariants").disabled=!1),t[3]||0==t[3]||(t[3]=-999999);let e="";if(variant_selected&&sraDict[n].RPKM&&sraDict[n].RPKM[variant_selected]){let l=sraDict[n].RPKM[variant_selected].toFixed(2);document.getElementById(t[0].split("_svg")[0]+"_rpkm").innerHTML=l,e=l}else{let n=0;document.getElementById(t[0].split("_svg")[0]+"_rpkm").innerHTML=n,e=n}colour_part_by_id(n+"_svg",sraDict[n].svg_part,e,colouring_mode)}}function parseIntArray(e){for(let t=0,n=e.length;t1?n[1]:e}else if("Amazon AWS"===sraDict[sraList[t]].bam_type){let e=sraDict[sraList[t]].drive_link,n=e.split("amazonaws.com/");1===n.length&&(n=e.split("araport.cyverse-cdn.tacc.cloud/")),match_drive=n.length>1?n[1]:e}data={status:e,numberofreads:sraDict[sraList[t]].numberofreads,hexcodecolour:sraDict[sraList[t]].hexColourCode,remoteDrive:match_drive,bamType:sraDict[sraList[t]].bam_type,filename:sraDict[sraList[t]].filenameIn,tissue:n,record:l,locus:locus,variant:1,start:locus_start,end:locus_end,yscale:yscale_input,cachedDatapoints:publicData,struct:splice_variants,dumpMethod:dumpMethod},$.ajax({method:"POST",url:rnaseq_image_url,data:data,dataType:"json",failure:function(){$("#failure").show()},success:function(e){let t=99;count_bam_entries_in_xml>0&&(t=parseInt((count_bam_entries_in_xml-1)/count_bam_entries_in_xml*100)),rnaseq_success++;let n=new Date;if(rnaseq_success_current_time=n.getTime(),progress_percent=rnaseq_change/count_bam_entries_in_xml*100,$("div#progress").width(progress_percent+"%"),progress_percent>t&&loadingScreen(!0),document.getElementById("progress_tooltip").innerHTML="Current progress is at "+progress_percent+"% done",document.getElementById("progress").title=progress_percent.toFixed(2)+"% ("+rnaseq_change+"/"+count_bam_entries_in_xml+")",document.title="eFP-Seq Browser:",progress_percent<100&&(document.title+=` Loading ${progress_percent.toFixed(1)}% -`),document.title+=` ${locus} - ${datasetName}`,e.status&&"success"===e.status&&e.record){let t=e.record||"unknown";if(listOfRecordsDisplayed.includes(t)?(t=findUnusedRecordDisplayName(t,listOfRecordsDisplayed),listOfRecordsDisplayed.push(t)):listOfRecordsDisplayed.push(t),listOfRecordsDisplayed=[],sraDict[t].bp_length=parseFloat(e.end)-parseFloat(e.start),sraDict[t].bp_start=parseFloat(e.start),sraDict[t].bp_end=parseFloat(e.end),sraDict[t].MappedReads=e.reads_mapped_to_locus,totalreadsMapped_dic[t]=e.totalReadsMapped,sraDict[t].locusValue=e.locus,sraDict[t].r=e.r,sraDict[t].dataVisualization=e.rnaseqbase64,locus!=e.locus)throw new Error(`ERROR: ${locus}'s RNA-Seq API request returned with data for some other locus.`);let n=[];if(e.ss_y&&e.sum_y&&e.sum_xy&&e.sum_x&&e.ss_x&&e.end&&e.start){parseInt(e.ss_y);let t=parseInt(e.sum_y),l=parseInt(e.ss_y),o=parseIntArray(e.sum_xy.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),a=parseIntArray(e.sum_x.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),s=(parseIntArray(e.sum_xx.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),parseIntArray(e.ss_x.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),parseIntArray(e.ss_x.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(","))),i=parseInt(e.end)-parseInt(e.start),r=[];for(let e=0;e=3?(document.getElementById(t+"_rnaseq_img").src="data:image/png;base64,"+e.rnaseqbase64,rnaseq_change+=1):(document.getElementById(t+"_rnaseq_img").src="https://"+window.location.host+window.location.pathname+"cgi-bin/img/error.webp",console.error("Unable to create RNA-Seq map coverage data for: Locus - "+locus+", SRA - "+t+", dataset - "+base_src)):(document.getElementById(t+"_rnaseq_img")&&(document.getElementById(t+"_rnaseq_img").src="https://"+window.location.host+window.location.pathname+"cgi-bin/img/error.webp"),console.error("Unable to create RNA-Seq map coverage data for: Locus - "+locus+", SRA - "+t+", dataset - "+base_src)),document.getElementById(t+"_rpb").innerHTML=parseFloat(n[0]).toFixed(2),sraDict[t].rpb=parseFloat(n[0]).toFixed(2),document.getElementById(t+"_rpkm").innerHTML=e["absolute-fpkm"],updateRPKMAbsoluteMax(e["absolute-fpkm"]),sraDict[t].RPKM=e["absolute-fpkm"],rpkmCount++,document.getElementById(t+"_totalReadsNum").innerHTML="Total reads = "+e.totalReadsMapped,callDumpOutputs)if(dumpOutputs+='\t\telif (record == "'+e.record+'"):\n',"complex"==dumpMethod){for(dumpOutputs+='\t\t\tdumpJSON(200, "'+e.locus+'", '+e.variant+", "+e.chromosome+", "+e.start+", "+e.end+', "'+e.record+'", "'+e.tissue+'", "'+e.rnaseqbase64+'", '+e.reads_mapped_to_locus+", "+e["absolute-fpkm"]+", ["+e.r+"], "+e.totalReadsMapped+", ["+e.exp_arr+"], [",n=0;nLoad time ~= "+String(round(parseInt(rnaseq_success_end_time-rnaseq_success_start_time)/6e4))+" mins."),document.getElementById("landing").setAttribute("hidden","true"),$("#theTable").trigger("update"),responsiveRNAWidthResize(),toggleResponsiveTable()}})}}}function findUnusedRecordDisplayName(e="unknown",t=sraList,n=0){if(Array.isArray(t)){let l=e+"_"+n;if(t.includes(l))findUnusedRecordDisplayName(e,t,n+1);else if(!t.includes(l))return l}else findUnusedRecordDisplayName(e,t=[])}function updateRPKMAbsoluteMax(e){let t=parseInt(document.getElementById("rpkm_scale_input").value);1e3===t&&(t=1);let n=parseInt(e);n>t&&(document.getElementById("rpkm_scale_input").value=n)}function checkAgainstSVG(e,t,n=!1){let l=t;if("ath-10dayOldSeedling.svg"===e||"ath-10dayOldSeedling.min.svg"===e)!0===n?l="10 Day Old Seedling":"all"!=t&&"root"!=t&&"shoot"!=t&&(l="all");else if("ath-15dayOldSeedling.svg"===e||"ath-15dayOldSeedling.min.svg"===e)!0===n?l="15 Day Old Seedling":"all"!=t&&"root"!=t&&"shoot"!=t&&(l="all");else if("ath-etiolatedSeedling.svg"===e||"ath-etiolatedSeedling.min.svg"===e)!0===n?l="Etiolated Seedling":"etiolatedseedling"!=t&&(l="etiolatedseedling");else if("ath-Flower.svg"===e||"ath-Flower.min.svg"===e)!0===n?l="Flower":"flower"!=t&&"receptacle"!=t&&(l="flower");else if("ath-FlowerParts.svg"===e||"ath-FlowerParts.min.svg"===e)!0===n?l="Flower Parts":"all"!=t&&"petals"!=t&&"stamen"!=t&&"sepals"!=t&&"carpels"!=t&&(l="all");else if("ath-GerminatingSeed.svg"===e||"ath-GerminatingSeed.min.svg"===e)!0===n?l="Germinating Seed":"all"!=t&&(l="all");else if("ath-Internode.svg"===e||"ath-Internode.min.svg"===e)!0===n?l="Internode":"all"!=t&&(l="all");else if("ath-leaf.svg"===e||"ath-leaf.min.svg"===e)!0===n?l="Leaf":"leaf"!=t&&(l="leaf");else if("ath-LeafParts.svg"===e||"ath-LeafParts.min.svg"===e)!0===n?l="Leaf Parts":"all"!=t&&"lamina"!=t&&"petiole"!=t&&"veins"!=t&&(l="all");else if("ath-Pollen.svg"===e||"ath-Pollen.min.svg"===e)!0===n?l="Pollen":"all"!=t&&(l="all");else if("ath-RootTip.svg"===e||"ath-RootTip.min.svg"===e)!0===n?l="Root Tip":"all"!=t&&(l="all");else if("ath-rosettePlusRoot.svg"===e||"ath-rosettePlusRoot.min.svg"===e)!0===n?l="Rosette Plus Root":"all"!=t&&"shoot"!=t&&"root"!=t&&(l="all");else if("ath-Seed1-4.svg"===e||"ath-Seed1-4.min.svg"===e)!0===n?l="Seed 1-4":"all"!=t&&(l="all");else if("ath-Seed5-7.svg"===e||"ath-Seed5-7.min.svg"===e)!0===n?l="Seed 5-7":"all"!=t&&(l="all");else if("ath-Seed8+.svg"===e||"ath-Seed8+.min.svg"===e)!0===n?l="Seed 8+":"all"!=t&&(l="all");else if("ath-SenescentLeaf.svg"===e||"ath-SenescentLeaf.min.svg"===e)!0===n?l="Senescent Leaf":"all"!=t&&(l="all");else if("ath-ShootApexInflorescense.svg"===e||"ath-ShootApexInflorescense.min.svg"===e)!0===n?l="Shoot Apex Inflorescense":"all"!=t&&(l="all");else if("ath-ShootApexVegetative-Transition.svg"===e||"ath-ShootApexVegetative-Transition.min.svg"===e)!0===n?l="Shoot Apex Vegetative-Transition":"all"!=t&&(l="all");else if("ath-Silique1-5.svg"===e||"ath-Silique1-5.min.svg"===e)!0===n?l="Silique 1-5":"all"!=t&&(l="all");else if("ath-Silique6-10.svg"===e||"ath-Silique6-10.min.svg"===e)!0===n?l="Silique 6-10":"all"!=t&&(l="all");else if("ath-YoungLeaf1-4.svg"===e||"ath-YoungLeaf1-4.min.svg"===e)!0===n?l="Young Leaf 1-4":"all"!=t&&(l="all");else if("ath-EarlyBuddingFlower.svg"===e||"ath-EarlyBuddingFlower.min.svg"===e)!0===n?l="Early Budding Flower":"all"!=t&&"shoot"!=t&&"buds"!=t&&(l="all");else if("ath-FlowerBud.svg"===e||"ath-FlowerBud.min.svg"===e)!0===n?l="Flower Bud":"flowerBud"==t&&"ath-10dayOldSeedling.min.svg"!==e||(l="flowerBud");else if("ath-Stamen.svg"===e||"ath-Stamen.min.svg"===e)!0===n?l="Stamen":"all"!=t&&"anthers"!=t&&"filament"!=t&&(l="all");else if("ath-StigmaAndOvaries.svg"===e||"ath-StigmaAndOvaries.min.svg"===e)!0===n?l="Stigma And Ovaries":"all"!=t&&"Stigma_tissue"!=t&&"Ovary_tissue"!=t&&(l="all");else if("ath-WholeSilique.svg"===e||"ath-WholeSilique.min.svg"===e)!0===n?l="Whole Silique":"all"!=t&&"silique"!=t&&"seed"!=t&&(l="silique");else if("ath-youngSeedling.svg"===e||"ath-youngSeedling.min.svg"===e)!0===n?l="Young Seedling":"all"!=t&&"root"!=t&&"hypocotyl"!=t&&"cotyledon"!=t&&(l="all");else if("ath-FlowerDevelopment1.svg"===e||"ath-FlowerDevelopment1.min.svg"===e)!0===n?l="Late Flower Development (1)":"flowerDevelopmentPart1"!=t&&(l="flowerDevelopmentPart1");else if("ath-FlowerDevelopment2.svg"===e||"ath-FlowerDevelopment2.min.svg"===e)!0===n?l="Flower Development 2":"flowerDevelopmentPart2"!=t&&(l="flowerDevelopmentPart2");else if("ath-FlowerDevelopment3.svg"===e||"ath-FlowerDevelopment3.min.svg"===e)!0===n?l="Flower Development 3":"flowerDevelopmentPart3"!=t&&(l="flowerDevelopmentPart3");else if("ath-FlowerDevelopment4.svg"===e||"ath-FlowerDevelopment4.min.svg"===e)!0===n?l="Flower Development 4":"flowerDevelopmentPart4"!=t&&(l="flowerDevelopmentPart4");else if("ath-FlowerDevelopment5.svg"===e||"ath-FlowerDevelopment5.min.svg"===e)!0===n?l="Flower Development 5":"flowerDevelopmentPart5"!=t&&(l="flowerDevelopmentPart5");else if("ath-FlowerDevelopment6-8.svg"===e||"ath-FlowerDevelopment6-8.min.svg"===e)!0===n?l="Flower Development 6-8":"flowerDevelopmentPart6"!=t&&(l="flowerDevelopmentPart6");else if("ath-FlowerDevelopment9-11.svg"===e||"ath-FlowerDevelopment9-11.min.svg"===e)!0===n?l="Flower Development 9-11":"flowerDevelopmentPart9"!=t&&(l="flowerDevelopmentPart9");else if("ath-FlowerDevelopment12-14.svg"===e||"ath-FlowerDevelopment12-14.min.svg"===e)!0===n?l="Flower Development 12-14":"flowerDevelopmentPart12"!=t&&(l="flowerDevelopmentPart12");else if("ath-FlowerDevelopment15-18.svg"===e||"ath-FlowerDevelopment15-18.min.svg"===e)!0===n?l="Flower Development 15-18":"flowerDevelopmentPart15"!=t&&(l="flowerDevelopmentPart15");else if("ath-FlowerDevelopment19.svg"===e||"ath-FlowerDevelopment19.min.svg"===e)!0===n?l="Flower Development 19":"flowerDevelopmentPart19"!=t&&(l="flowerDevelopmentPart19");else if("ath-Other.svg"===e||"ath-Other.min.svg"===e)if(!0===n)l="Other";else if("all"!=t)return"all";return l}let efp_table_column,variantdiv_str,sraList=[],sraDict={},sraCountDic={},tissueSRADic={},datasetName="data",iteration_num=1,moreDetails='Show More Details arrow_drop_down',lessDetails='Show Less Details arrow_drop_up';function populate_table(e){$("#theTable").empty(),$("#compareTable").empty(),rnaseq_calls=[],exp_info=[],rnaseq_success=0,date_obj5=new Date,rnaseq_success_start_time=date_obj5.getTime(),max_absolute_fpkm=-1,max_log_fpkm=-1,svg_colouring_element=null,gene_structure_colouring_element=null,sraList=[],sraDict={},sraCountDic={},tissueSRADic={},rpkmAverage=1,rpkmMedian=1;$("#theTable").append('
    Title
    Sorting arrow
    RNA-Seq CoverageRNA-Seq mapped image
    rpb
    Default sort arrow
    eFP (RPKM)
    RPKM
    Default sort arrow
    Details
    Default sort arrow
    ');$("#compareTable").append('
    Title
    RNA-Seq CoverageRNA-Seq mapped image
    rpb
    eFP (RPKM)
    RPKM
    Details
    '),$.ajax({url:base_src,dataType:"xml",success:function(t){$(t).find("files").each((function(){datasetName=$(this).attr("xmltitle")||"Uploaded dataset",datasetName=datasetName.trim(),0===datasetName.length&&(datasetName="Uploaded dataset"),document.getElementById("uploaded_dataset").innerHTML=datasetName})),document.title="eFP-Seq Browser:",progress_percent<100&&(document.title+=` Loading ${progress_percent.toFixed(1)}% -`),document.title+=` ${locus} - ${datasetName}`,iteration_num=1,$(t).find("file").each((function(){let t=$(this).attr("record_number")||"unknown";if(sraList.includes(t)&&(t=findUnusedRecordDisplayName(t,sraList)),sraList.includes(t)){if(sraCountDic[t]){sraCountDic[t]+=1;let e=t+"("+sraCountDic[t]+")";sraList.push(e),sraDict[e]={}}}else sraCountDic[t]=1,sraList.push(t),sraDict[t]={};let n=$(this).attr("description");sraDict[t].title=n;let l=$(this).attr("info");sraDict[t].description=l;let o=$(this).attr("svgname");sraDict[t].svg=o;let a=$(this).attr("svg_subunit");a=checkAgainstSVG(o,a),sraDict[t].svg_part=a,tissueSRADic[checkAgainstSVG(o,a,!0)]?tissueSRADic[checkAgainstSVG(o,a,!0)].push(t):tissueSRADic[checkAgainstSVG(o,a,!0)]=[t];let s=$(this).attr("url");sraDict[t].url=s;let i=$(this).attr("publication_link");sraDict[t].publicationid=i;let r,d=$(this).attr("total_reads_mapped");null!=d&&""!=d||(d="0"),sraDict[t].numberofreads=d,r=null==$(this).attr("hex_colour")||""==$(this).attr("hex_colour")?"0x64cc65":$(this).attr("hex_colour"),sraDict[t].hexColourCode=r;let c=$(this).attr("filename");null!=c&&""!=c&&null!=c||(c="accepted_hits.bam"),sraDict[t].filenameIn=c;let u=$(this).attr("species");sraDict[t].species=u;let m=[];if(null==$(this).find("controls")[0].innerHTML)for(let e=1;e<$(this).find("controls")[0].childNodes.length;e+2)m.push($(this).find("controls")[0].childNodes[e].firstChild.textContent);else null!=$(this).find("controls")[0].innerHTML&&(m=$(this).find("controls")[0].innerHTML.replace(//g,"").replace(/<\/bam_exp>/g,",").replace(/\n/g," ").replace(/ /g,"").split(","));sraDict[t].controls=m;let g="";if(m.length>0)for(let e=m.length;e--;)"MEDIAN"!=m[e]?g+=''+m[e]+" ":g+=m[e];sraDict[t].links=g;let p="";if(m.length>0)for(let e=0;e',y="\n\t\n";y+="\t\t\n",v+='\n",v+=`\n\t\t\t\t\t\n\n\t\t\t\t`,v+='",v+='\n",v+='',v+='\n",v+='',v+="",iteration_num++,$("#theTable").append(v);let w=document.getElementsByClassName("fltrow")[0].childNodes[6];(w&&void 0===w.classList[0]||"undefined"===w.classList[0])&&(w.classList=["colCompare"],w.innerHTML=''),exp_info.push([t+"_svg",a,m,0,0,0,0]),!0===loadNewDataset?(setTimeout((function(){count_bam_num()}),200),setTimeout((function(){rnaseq_images(e)}),10)):rnaseq_images(e)})),$.tablesorter.addParser({id:"rpb_sorter",is:function(){return!1},format:function(e){return NaN==e?-99999:null==e?-999999:e==1/0?99999:e==-1/0?-99999:parseFloat(e)},type:"numeric"}),$.tablesorter.addParser({id:"rpkm_sorter",is:function(){return!1},format:function(e){return NaN==e?-99999:null==e?-999999:e==1/0?99999:e==-1/0?-99999:"Missing controls data"==e?-9999999:parseFloat(e)},type:"numeric"}),$("#theTable").tablesorter({headers:{0:{},1:{sorter:!1},2:{sorter:"rpb_sorter"},3:{},4:{sorter:"rpkm_sorter"},5:{}}}),$("#theTable").trigger("update")}});for(new TableFilter("theTable",{base_path:"cgi-bin/core/packages/tableFilter/",columns_exact_match:[!1,!1,!1,!1,!1,!1],watermark:["Filter","Filter","Filter","Filter","Filter","Filter"],highlight_keywords:!1,no_results_message:!0,auto_filter:!0,auto_filter_delay:500,col_1:"none",popup_filters:!1,filters_row_index:1,alternate_rows:!1,msg_filter:"Filtering..."}).init(),change_rpkm_colour_scale(colouring_mode),i=0;i',variantdiv_str+="",document.getElementsByClassName("fltrow")[0].childNodes[1].innerHTML=variantdiv_str,$("#variant_select").ddslick({width:"100%",onSelected:function(){gene_structure_radio_on_change()}})}function clickDetailsTextChange(e){if(null!=document.getElementById(e))if(document.getElementById(e).innerHTML==moreDetails){document.getElementById(e).setAttribute("hidden",!0);const t=document.getElementById(document.getElementById(e).name);t.textContent=t.getAttribute("name")}else if(document.getElementById(e).innerHTML==lessDetails){const t=e.substring(0,e.length-5);document.getElementById(t).removeAttribute("hidden");const n=document.getElementById(document.getElementById(e).name);n.textContent=truncateDescription(n.getAttribute("name"))}}function truncateDescription(e){if(null!=e||null!=e)return e.length>30?e.substring(0,30)+"...":e}let remainder_efp=0,efp_length=0,eFPSortedSRA=[],efp_RPKM_values=[];function populate_efp_modal(){toggleResponsiveTable(2),$("#efpModalTable").empty(),efp_table_column="",eFPSortedSRA=[];const e=document.getElementsByClassName("colTitle");for(let t=2;t AGI-ID: '+locus+"

    "),"abs"===colouring_mode?$("#efpModalTable").append(`\n\t\t\t\t

    \n\t\t\t\t\teFP Colour Scale:\n\n\t\t\t\t\t\n\n\t\t\t\t\tMin: ${Math.min.apply(null,efp_RPKM_values).toFixed(1)} RPKM,\n\n\t\t\t\t\tMax: ${Math.max.apply(null,efp_RPKM_values).toFixed(1)} RPKM\n\t\t\t\t

    \n\n\t\t\t\t
    \n\n\t\t\t\t
    "+document.getElementById("xmlDatabase").value+"
    '+n+"\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t
    \n\n\t\t\t\t\t\t\n\t\t\t\t\t
    '+"-9999
    '+document.getElementById(o.substring(4).replace(".svg","_svg")).innerHTML+'
    '+o.substring(4).replace(".svg","")+"
    -9999
    '+truncateDescription(l)+"
    ","Amazon AWS"===f&&(v+=''),t.includes("unknown")&&!i||(v+='"),v+='"+moreDetails.trim()+"",v+='
    \n\t\t\t\t\t\n\t\t\t\t\n\t\t\t`):"rel"===colouring_mode&&$("#efpModalTable").append(`\n\t\t\t\t

    \n\t\t\t\t\teFP Colour Scale:\n\n\t\t\t\t\t\n\n\t\t\t\t\tMin: ${Math.min.apply(null,efp_RPKM_values).toFixed(1)},\n\n\t\t\t\t\tMax: ${Math.max.apply(null,efp_RPKM_values).toFixed(1)}\n\t\t\t\t

    \n\n\t\t\t\t
    \n\n\t\t\t\t
    \n\t\t\t\t\t\n\t\t\t\t\n\t\t\t`),$("#efpModalTable").append('
    '),i=0;i<11*~~(eFPSortedSRA.length/11);i+=11)if("null"!=document.getElementById(eFPSortedSRA[i+10]).outerHTML){efp_table_column="";for(let e=0;e<11;e++)efp_table_column+='
    "+document.getElementById(eFPSortedSRA[i+e]+"_svg").outerHTML+''+eFPSortedSRA[i+e]+" - "+sraDict[eFPSortedSRA[i+e]].title+"
    ";efp_table_column+="",$("#eFPtable").append(efp_table_column)}for(let t=0;t<12;t++)if(remainder_efp===t){efp_table_column="";for(let e=remainder_efp;e>0;e--)efp_table_column+='
    "+document.getElementById(eFPSortedSRA[efp_length-e]+"_svg").outerHTML+''+eFPSortedSRA[efp_length-e]+" - "+sraDict[eFPSortedSRA[efp_length-e]].title+"
    ";efp_table_column+="",$("#eFPtable").append(efp_table_column)}toggleResponsiveTable()}function change_rpkm_colour_scale(e){if(null===svg_colouring_element&&document.getElementById("flt3_theTable")&&document.getElementById("flt3_theTable").parentElement&&(svg_colouring_element=document.getElementById("flt3_theTable").parentElement),svg_colouring_element&&svg_colouring_element.innerHTML&&(svg_colouring_element.innerHTML=""),"rel"==e){const e=document.createElement("img");e.src="data:image/png;base64,"+relative_rpkm_scale,e.style="margin-top: 10px;",svg_colouring_element&&svg_colouring_element.appendChild(e)}else{const e=document.createElement("img");e.src="data:image/png;base64,"+absolute_rpkm_scale,e.style="margin-top: 10px;",e.alt="Absolute RPKM Scale",svg_colouring_element&&svg_colouring_element.appendChild(e)}const t=["colTitle","colRNA","colrpb","coleFP","colRPKM","colDetails"];let n=[];document.getElementsByClassName("fltrow")&&document.getElementsByClassName("fltrow")[0]&&(n=document.getElementsByClassName("fltrow")[0].getElementsByTagName("td"));for(let l=0;l=1&&e[2]<=5||"C"==e[2]||"M"==e[2]||"c"==e[2]||"m"==e[2])&&("G"==e[3]||"g"==e[3])&&e[4]>=0&&e[4]<=9&&e[5]>=0&&e[5]<=9&&e[6]>=0&&e[6]<=9&&e[7]>=0&&e[7]<=9&&e[8]>=0&&e[8]<=9?$("#locus_button").removeAttr("disabled"):$("#locus_button").prop("disabled",!0)}function yscale_validation(){const e=document.getElementById("yscale_input").value;parseInt(e)>0||"Auto"==e||""==e?$("#locus_button").removeAttr("disabled"):$("#locus_button").prop("disabled",!0)}function rpkm_validation(){parseInt(document.getElementById("rpkm_scale_input").value)>0?$("#abs_scale_button").removeAttr("disabled"):$("#abs_scale_button").prop("disabled",!0)}const base_dataset_dictionary={"Araport 11 RNA-seq data":"cgi-bin/data/bamdata_araport11.xml","Developmental transcriptome - Klepikova et al":"cgi-bin/data/bamdata_Developmental_transcriptome.xml"};let databasesAdded=!1;function reset_database_options(){$(".userAdded").remove(),dataset_dictionary=base_dataset_dictionary,list_modified=!1,databasesAdded=!1}let xml_title,get_xml_list_output=[],user_exist=!1,list_modified=!1,check_for_change=0,match_title={},title_list=[];function get_user_XML_display(){const e=findAuthUser();""==users_email&&null==users_email&&null==users_email||users_email!==e?""!=users_email&&users_email!=e&&(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in")):$.ajax({url:"https://bar.utoronto.ca/webservices/eFP-Seq_Browser/get_xml_list.php?user="+users_email,dataType:"json",failure:function(){console.log("ERROR! Something went wrong")},success:function(e){xml_title=void 0,match_title={},title_list=[];let t=1,n=1;if(get_xml_list_output=e,"fail"==get_xml_list_output.status)console.log("Error code: "+get_xml_list_output.error),user_exist=!1;else if("success"==get_xml_list_output.status){if(user_exist=!0,check_for_change!=get_xml_list_output.files.length&&(reset_database_options(),list_modified=!1),check_for_change=get_xml_list_output.files.length,get_xml_list_output.files.length>0)for(let e=0;e'+title_list[i]+"";list_modified=!0}),1e3)}databasesAdded=!0}})}let datalist=[],datalist_Title={};function create_data_list(e){if(datalist=[],datalist_Title={},e>0)for(let t=0;t{if(t.readyState===XMLHttpRequest.DONE&&200===t.status){let n=t.responseXML;if(n){let t=n.getElementsByTagName("files")[0].attributes.xmltitle.nodeValue;datalist_Title[t]=e[dlCallPosition],dlCallPosition+=1,DatalistXHRCall(e)}}},t.open("GET",n),t.send()}}function validateEmail(e){return/\S+@\S+\.\S+/.test(e)}function findAuthUser(){let e="";if(gapi){const t=gapi.auth2.getAuthInstance().currentUser;if(t){const n=Object.keys(t);for(const l of n){const n=t[l];if(n&&Object.keys(n).length>0){const t=Object.keys(n);for(const l of t){const t=n[l];if(t&&Object.keys(t).length>0){const n=Object.keys(t);for(const l of n){const n=t[l];if("string"==typeof n&&validateEmail(n)){e=n;break}}}}}}}else logError("Unable to reach current user from OAuth")}else logError("Unable to reach data from OAuth");return e}function check_if_Google_login(){const e=findAuthUser();""!=users_email&&users_email===e?!1===databasesAdded&&(document.getElementById("private_dataset_header").style.display="block",get_user_XML_display()):""!=users_email&&users_email!=e?(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in")):remove_private_database()}function add_user_xml_by_upload(){get_user_XML_display(),setTimeout((function(){const e=findAuthUser();user_exist?user_exist&&(null==dataset_dictionary[datasetName]?users_email===e?$.ajax({method:"POST",url:"https://bar.utoronto.ca/webservices/eFP-Seq_Browser/upload.php",data:{user:users_email,xml:upload_src,title:datasetName}}):""!=users_email&&users_email!=e&&(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in")):null!=dataset_dictionary[datasetName]&&(users_email===e?(list_modified=!1,check_for_change=0,$.ajax({url:"https://bar.utoronto.ca/webservices/eFP-Seq_Browser/delete_xml.php?user="+users_email+"&file="+match_title[datasetName]}),$.ajax({method:"POST",url:"https://bar.utoronto.ca/webservices/eFP-Seq_Browser/upload.php",data:{user:users_email,xml:upload_src,title:datasetName}})):""!=users_email&&users_email!=e&&(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in")))):users_email===e?$.ajax({method:"POST",url:"https://bar.utoronto.ca/webservices/eFP-Seq_Browser/upload.php",data:{user:users_email,xml:upload_src,title:datasetName}}):""!=users_email&&users_email!=e&&(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in")),get_user_XML_display()}),1e4)}let uploadingData=!1;function which_upload_option(){uploadingData=!0;const e=findAuthUser();""!=users_email&&users_email===e?document.getElementById("upload_modal").click():""!=users_email&&users_email!=e?(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in")):""==users_email&&document.getElementById("upload_logX").click()}const public_dataset_dictionary={"Araport 11 RNA-seq data":"cgi-bin/data/bamdata_araport11.xml","Developmental transcriptome - Klepikova et al":"cgi-bin/data/bamdata_Developmental_transcriptome.xml"};let public_title_list=[],total_amount_of_datasets=0;function delete_fill(){$("#delete_fill").empty(),$("#publicDatabaseDownload").empty(),public_title_list=[];for(let t in public_dataset_dictionary)public_dataset_dictionary.hasOwnProperty(t)&&public_title_list.push(t);let e=0;for(total_amount_of_datasets=public_title_list.length+title_list.length,i=0;i '+public_title_list[i]+"
    "),e+=1;for(i=0;i '+title_list[i]+"
    "),e+=1}let isDeletePublicDisabled=!1;function disableDeletePublic(){for(i=0;i\n\t\n",n+="\t\t"+fileTitle+"\n",n+=table_base,t.each((function(){n+="\t\t\n";const e=$(this).attr("description");n+="\t\t\t"+e+"\n";const t=$(this).attr("info");n+="\t\t\t"+t+"\n";const l=$(this).attr("record_number");n+="\t\t\t"+l+"\n";const o=$(this).attr("name");n+="\t\t\t"+o+"\n";const a=$(this).attr("bam_type");n+="\t\t\t"+a+"\n";let s=$(this).attr("filename");null!=s&&"undefined"!==s&&".bam"!==s||(s="accepted_hits.bam"),n+="\t\t\t"+s+"\n";const i=$(this).attr("publication_link");n+="\t\t\t"+i+"\n";const r=$(this).attr("url");n+="\t\t\t"+r+"\n";let d=$(this).attr("total_reads_mapped");null!=d&&""!=d||(d="0"),n+="\t\t\t"+d+"\n";const c=$(this).attr("read_map_method");n+="\t\t\t"+c+"\n";let u=$(this).attr("species");null!=u&&""!=u||(u="Arabidopsis thaliana"),n+="\t\t\t"+u+"\n";const m=$(this).attr("svgname");n+="\t\t\t"+m+"\n";const g=$(this).attr("svg_subunit");n+="\t\t\t"+g+"\n";let p="";if($(this).find("controls")[0].innerHTML)for(let n=1;n<$(this).find("controls")[0].childNodes.length;n+=2)$(this).find("controls")[0].childNodes[n].firstChild&&(p+=$(this).find("controls")[0].childNodes[n].firstChild.textContent,n<$(this).find("controls")[0].childNodes.length-2&&(p+=", "));n+="\t\t\t"+p+"\n";let _="";if($(this).find("groupwith")[0].innerHTML)for(let n=1;n<$(this).find("groupwith")[0].childNodes.length;n+=2)$(this).find("groupwith")[0].childNodes[n].firstChild&&(_+=$(this).find("groupwith")[0].childNodes[n].firstChild.textContent,n<$(this).find("groupwith")[0].childNodes.length-2&&(_+=", "));n+="\t\t\t"+_+"\n",n+="\t\t\n"})),n+="\t\n",document.getElementById("XMLtoCSVtable").innerHTML+=n}})}}function download_XMLtableCSV(){for(let e=0;e\n",e+=downloadIndexTable_base;for(const t of eFPSortedSRA)e+="\t\t\n",e+="\t\t\t"+sraDict[t].title+"\n",e+="\t\t\t"+t+"\n",e+="\t\t\t"+sraDict[t].svg.substr(4,sraDict[t].svg.length-8)+"\n",e+="\t\t\t"+sraDict[t].svg_part+"\n",e+="\t\t\t"+sraDict[t].locusValue+"\n",e+="\t\t\t"+String(sraDict[t].bp_length)+"\n",e+="\t\t\t"+String(sraDict[t].bp_start)+"\n",e+="\t\t\t"+String(sraDict[t].bp_end)+"\n",e+="\t\t\t"+sraDict[t].numberofreads+"\n",e+="\t\t\t"+String(sraDict[t].MappedReads)+"\n",e+="\t\t\t"+sraDict[t].rpb+"\n",e+="\t\t\t"+String(sraDict[t].RPKM[variantPosition].toFixed(2))+"\n",e+="\t\t\t"+String(sraDict[t].controlsString)+"\n",e+="\t\t\n";e+="\t\n",document.getElementById("hiddenDownloadModal_table").innerHTML+=e,$("#hiddenDownloadModal_table").tableToCSV(),document.getElementById("download_icon").classList.remove("progressLoading"),document.getElementById("bodyContainer").classList.remove("progressLoading")}let publicData=!0;function changePublicData(e=!1){publicData=!e&&!uploadingData&&(1==document.getElementById("xmlDatabase").selectedIndex||2==document.getElementById("xmlDatabase").selectedIndex)}let isPrecache=!0;function checkPreload(){if(get_input_values(),verifyLoci(locus)){loadingScreen(!1),progress_percent=0,document.title=`eFP-Seq Browser: Loading 0% - ${locus}`,document.getElementById("progress").title="0%",$("div#progress").width(progress_percent+"%");for(const e in public_dataset_dictionary){if(base_src===public_dataset_dictionary[e]){publicData=!0;break}publicData=!1}publicData&&"AT2G24270"==locus&&"simple"==dumpMethod&&!callDumpOutputs?(variants_radio_options(1),isPrecache=!0):(update_all_images(0),isPrecache=!1)}else console.error(`The following locus is not valid: ${locus}`)}function verifyLoci(e){if("string"==typeof e){const t=new RegExp("^[A][T][MC0-9][G][0-9]{5}[.][0-9]{1,2}$|^[A][T][MC0-9][G][0-9]{5}$","i");return e.trim().match(t)}return!1}let parse_output,GFF_List=[];function getGFF(e){GFF_List=[],$.ajax({url:"https://bar.utoronto.ca/webservices/bar_araport/gene_structure_by_locus.php?locus="+e,dataType:"json",failure:function(){console.log("Getting GFFs (getGFF) information failed to retrieve locus information from Araport11")},success:function(e){if(parse_output=e,parse_output.wasSuccessful){const e=parse_output.features[0].subfeatures;for(i=0;i0)for(let e=0;e0){const e=document.getElementById("locus").value.trim().split("/");e[0]?document.getElementById("locus").value=e[0].toUpperCase().trim():document.getElementById("locus").value=document.getElementById("locus").value.trim(),locus_validation()}}function returnBackToTop(){document.getElementById("main_content").scrollTop=0}function toggleOptionsTable(){"false"===document.getElementById("tableToggle").getAttribute("aria-expanded")?(document.getElementById("tableToggle").setAttribute("aria-expanded",!0),document.getElementById("filterDropdown").classList.add("show")):(document.getElementById("tableToggle").setAttribute("aria-expanded",!1),document.getElementById("filterDropdown").classList.remove("show"))}function toggleTableOptionsView(){document.getElementById("tableFilter-tab").classList.value.includes("active")?(document.getElementById("tableFilter-tab").classList.remove("active"),document.getElementById("eFPFilter-tab").classList.add("active"),document.getElementById("tableFilter").classList.remove("show","active"),document.getElementById("eFPFilter").classList.add("show","active")):(document.getElementById("tableFilter-tab").classList.add("active"),document.getElementById("eFPFilter-tab").classList.remove("active"),document.getElementById("tableFilter").classList.add("show","active"),document.getElementById("eFPFilter").classList.remove("show","active"))}let downloadDivNum=1;function downloadDiv(e){html2canvas(document.getElementById(e)).then((e=>{$("#appendCanvas").empty(),e.id="downloadDivNum_"+downloadDivNum,document.getElementById("appendCanvas").appendChild(e),document.getElementById("downloadDivNum_"+downloadDivNum).style.width="100%",$("#DownloadImageModal").modal("toggle"),downloadDivNum++}))}function displayNavBAR(e=!1){$("#navbar_menu").is(":visible")||e?(document.getElementById("navbar_menu").style.display="none",document.getElementById("main_content").className="col-sm-12",document.getElementById("openMenu").style.display="block",document.getElementById("theTable")&&document.getElementById("theTable").classList.add("RNATable")):!1===$("#navbar_menu").is(":visible")&&(document.getElementById("navbar_menu").style.display="block",document.getElementById("main_content").className="col-sm-9",document.getElementById("openMenu").style.display="none",document.getElementById("theTable")&&document.getElementById("theTable").classList.remove("RNATable"))}function adjustFooterSize(){const e=document.getElementById("navbar_menu");e&&(document.getElementById("nm_footer").style.width=e.offsetWidth+"px",e.scrollHeight==e.clientHeight?document.getElementById("nm_footer").classList.contains("navbar_menu_footer_overflow_abs")||(document.getElementById("nm_footer").classList.remove("navbar_menu_footer_overflow_sticky"),document.getElementById("nm_footer").classList.add("navbar_menu_footer_overflow_abs")):e.scrollHeight>e.clientHeight&&(document.getElementById("nm_footer").classList.contains("navbar_menu_footer_overflow_sticky")||(document.getElementById("nm_footer").classList.remove("navbar_menu_footer_overflow_abs"),document.getElementById("nm_footer").classList.add("navbar_menu_footer_overflow_sticky"))))}function adjustTableOptionsDropdownSize(){document.getElementById("filterDropdown").style.left=(document.body.offsetWidth-2*document.getElementById("tableToggle").offsetWidth-document.getElementById("filterDropdown").offsetWidth).toString()+"px"}function adjustSubmissionIFrameSize(){const e=.7*window.innerHeight;document.getElementById("submissioniframe").height=e+"px"}let usedToggle=!1;function toggleTableCol(e,t){const n=document.getElementsByClassName(e);if(t)for(const l of n)l&&l.removeAttribute("hidden");else if(!t)for(const l of n)l&&l.setAttribute("hidden",!0)}let responsiveRNAWidthAdjusted=!1;function responsiveRNAWidthResize(){const e=document.getElementsByClassName("responsiveRNAWidth");if(window.innerWidth<=575){for(i=0;i575&&responsiveRNAWidthAdjusted)for(i=0;i=1100&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!0,!0,!0,!0,!1):3==e||window.innerWidth<830&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!1,!1,!1,!1,!1):4==e||window.innerWidth<900&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!0,!1,!1,!1,!1):5==e||window.innerWidth<990&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!0,!1,!0,!1,!1):(6==e||window.innerWidth<1100&&!usedToggle)&&toggleResponsiveTableOptions(!0,!0,!0,!0,!0,!1,!1))}let ToggledTable=[!0,!0,!0,!0,!0,!0,!1];function RememberToggleOptions(e=!0,t=!0,n=!0,l=!0,o=!0,a=!0,s=!1){ToggledTable=[e,t,n,l,o,a,s]}const colSortList=["colTitle","colrpb","colRPKM","colDetails"];function ResizeArrowRow(){for(const e of colSortList){const t=e+"Row";document.getElementById(t).style.width=document.getElementById(t).parentNode.offsetWidth-2+"px";CheckElementWidth(e+"Arrow",8)}}function CheckElementWidth(e,t){document.getElementById(e).offsetWidth{-1!==navigator.userAgent.indexOf(e)&&o++})),o!=t){n=element,l=!1;break}}}if(n){$("#notChrome").empty();const e=' or through the following Google search results';$("#notChrome").append(e)}BrowserDetected=!0}}function CreateFilteredeFPList(){if($("#filtereFPList").empty(),tissueSRADic){const e=Object.keys(tissueSRADic);for(const t of e){let e='
  • ';e+='',e+='

    '+t+"

    ",e+="
  • ",$("#filtereFPList").append(e)}}else logError("Unable to use tissueSRADic")}function ToggleFilteredeFP(e,t){const n=e.replace("_"," "),l=tissueSRADic[n];if(!0===t)for(i=0;i1)if("locus"===l[0].split("%20").join(" ").trim()){const n=e.substring(6).split("%20").join(" ").trim();shareLinkInputs.locus=n,document.getElementById("locus").value=n,t=!0}else if("dataset"===l[0].split("%20").join(" ").trim()){const t=e.substring(8).split("%20").join(" ").trim();shareLinkInputs.dataset=t,base_src=t,n=!0}}t&&n?(emptyLanding(),progress_percent=0,document.title=`eFP-Seq Browser: Loading 0% - ${locus}`,sraDict={},sraCountDic={},loadNewDataset=!1,setTimeout((function(){count_bam_num(),disableAllComparison(),checkPreload()}),200),toggleResponsiveTable(0)):displayError(t&&!1===n?"ERROR IN SHARE LINK! Missing dataset":!1===t&&n?"ERROR IN SHARE LINK! Missing locus":"ERROR IN SHARE LINK! Missing locus and dataset")}}function copyToClipboard(){""!==document.getElementById("shareLinkTextArea").trim()&&(document.getElementById("shareLinkTextArea").select(),document.execCommand("copy"))}let allCheckedOptions=[];function tableCheckbox(e,t=!1){const n=e.split("_")[0];if(t)disableAllComparison();else if(!1===t&&document.getElementById(e)&&document.getElementById(e).checked){allCheckedOptions.push(n);const t={};for(let e=0;e';parseInt(e)===parseInt(variantPosition)?l+=''+document.getElementById(n+"_title").innerHTML+" ... ("+GFF_List[e]+")\n":l+='^^^ ... ('+GFF_List[e]+")\n",l+='RNA-Seq mapped image for:'+n+'
    Gene variant image for:'+n+'\n',l+=''+sraDict[n].r[e].toFixed(2)+"",l+='
    '+document.getElementById(sraDict[n].svg.substr(4).replace(".svg","_svg")).innerHTML+'
    '+sraDict[n].svg.substring(4).replace(".svg","")+"
    \n",l+=''+sraDict[n].RPKM[e].toFixed(2)+"",parseInt(e)===parseInt(variantPosition)?l+='
    '+document.getElementById(n+"_description").innerHTML+'
    '+document.getElementById("igbLink_"+n).innerHTML+'
    '+document.getElementById("extraLinks_"+n).innerHTML+"
    \n":l+='^^^\n',l+="",t[e]=n+"_compareRow"+e,document.getElementById("compareTable").innerHTML+=l,document.getElementById(n+"_rnaseq_img"+e)&&document.getElementById(n+"_rnaseq_img"+e).setAttribute("src",document.getElementById(n+"_rnaseq_img").src),document.getElementById(n+"_gene_structure_img"+e)&&document.getElementById(n+"_gene_structure_img"+e).setAttribute("src",document.getElementsByClassName("dd-option-image")[e].src),sraDict[n].RPKM&&sraDict[n].RPKM[e]&&colour_part_by_id(n+"_svg"+e,sraDict[n].svg_part,sraDict[n].RPKM[e],colouring_mode)}document.getElementById(e).checked=!0,document.getElementById("allCheckbox").checked=!0,"rel"!=colouring_mode&&(document.getElementById("compareGeneVariants").disabled=!1)}else!1===t?(disableCompare(n),allCheckedOptions.splice(allCheckedOptions.indexOf(n),1),document.getElementById(e).checked=!1):!0===t&&disableAllComparison(),0===allCheckedOptions.length&&(document.getElementById("compareGeneVariants").disabled=!0)}function disableCompare(e){for(let t=0;t=0;l--)document.getElementsByClassName("compareDataRow")[l].remove();allCheckedOptions=[],e=document.getElementsByClassName("compareCheckbox");for(let l=0;l0&&hiddenGoogleSignin(),getGFF(locus),$("#locus").autocomplete({source:function(e,t){const n=e.term.split(/,\s*/).pop();$.ajax({type:"GET",url:"https://bar.utoronto.ca/webservices/eFP-Seq_Browser/idautocomplete.cgi?species=Arabidopsis_thaliana&term="+n,dataType:"json"}).done((function(e){e&&e.length>=7?t(e.slice(0,7)):t(e)}))},close:function(){correctAGIIDInput()}});const e=document.getElementById("submissioniframe");e&&e.setAttribute("src",e.getAttribute("data-src")),adjustSubmissionIFrameSize(),readShareLink()}$(window).resize((function(){adjustFooterSize(),adjustSubmissionIFrameSize(),responsiveRNAWidthResize(),toggleResponsiveTable(),adjustTableOptionsDropdownSize(),setTimeout((function(){adjustFooterSize()}),10)})),adjustFooterSize(),window.addEventListener("load",(function(){init()})); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 46af347..bfb2b6b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "efp-seq_browser", - "version": "1.3.13", + "version": "1.3.14", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "efp-seq_browser", - "version": "1.3.13", + "version": "1.3.14", "license": "GPL-2.0" } } diff --git a/package.json b/package.json index da8858d..20260a3 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "url": "https://bar.utoronto.ca/" } ], - "version": "1.3.13", + "version": "1.3.14", "private": true, "description": "Search among 113 RNA-seq data sets used by Araport 11 to reannotate the Arabidopsis genome (Cheng et al. 2016, http://biorxiv.org/content/early/2016/04/05/047308). The eFP-Seq Browser will retrieve the number of reads mapped and display these above the desired Araport 11 gene model. You can sort or filter the columns.", "main": "index.html",