From a5b952bf2df11e9c8538b372f2ee0d3c23d1fa90 Mon Sep 17 00:00:00 2001 From: Alexander Sullivan Date: Mon, 15 Jan 2024 15:10:51 -0500 Subject: [PATCH] chore: update version and changelog --- CHANGELOG.md | 57 ++++++++++++++++++++++++++++++++++++++ cgi-bin/core/custom.js | 2 +- cgi-bin/core/custom.min.js | 2 +- package.json | 2 +- 4 files changed, 60 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f81d8e3..2655b41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,63 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p To see tags and releases, please go to [Tags](https://github.com/BioAnalyticResource/eFP-Seq_Browser/tags) on [GitHub](https://github.com/BioAnalyticResource/eFP-Seq_Browser). +## [1.3.15] - 2024-01-15 + +UI/UX: + +- Added toast notifications for error messages +- Centered the loading indicator + +Optimization: + +- Made SEO improvements +- Made more accessibility adjustments +- Optimized images +- Preload styles +- Reduced complexity of some functions +- Refactored some code +- Removed unused CSS +- Set loading from lazy to auto for largest LCP +- Update cookies `SameSite` to `Lax` and `Secure` + +Security: + +- Update CSP with `base-uri` +- Update `Permissions-Policy` +- Update htaccess + +Update: + +- Migrate to new Google Identity Services library +- No longer supporting Internet Explorer +- Update Python 2 to 3 +- Update packages +- Updated workbox settings + +Documentation: + +- Added CHANGELOG markdown file +- Improved readability of some code +- Sorted uncategorized CSS styles to make them more readable +- Updated README + +Bug fix: + +- Fixed "Duplicate without user-selected canonical" +- Fixed compatibility with Pillow (PIL) 9.5 +- Fixed deprecated `btoa` functions +- Fixed eFP-Seq Browser web manifest trying to overwrite BAR's web manifest name - now both use same web manifest +- Fixed issue where if code is run on a non-BAR server, was still trying to access the BAR's GAPI/Google OAuth +- Fixed issue where loading indicator was not green +- Fixed issue where submission page was broken on local instances of the eFP-Seq Browser +- Fixed issue where the title of the uploaded file to a user from an XML was not reachable +- Fixed issue where variables were not initialized in loops +- Fixed issue with service worker not working with Python/CGI scripts +- Fixed missing Apple metadata +- Fixed missing Math.js source map +- Fixed service workers trying to register when is not supported for some users +- Fixed typos + ## [1.3.14] - 2022-06-09 **A brand new version of the [eFP-Seq Browser](https://bar.utoronto.ca/eFP-Seq_Browser/) has dropped!** diff --git a/cgi-bin/core/custom.js b/cgi-bin/core/custom.js index 14d55d3..5f31fab 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.14-p20240113"; +const version = "v1.3.15-p20240115"; /** Selected RPKM mode */ let colouring_mode = "abs"; diff --git a/cgi-bin/core/custom.min.js b/cgi-bin/core/custom.min.js index dc5dca0..ff08cab 100644 --- a/cgi-bin/core/custom.min.js +++ b/cgi-bin/core/custom.min.js @@ -1 +1 @@ -const version="v1.3.14-p20240113";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 t=new XMLHttpRequest,e=base_src;t.responseType="document",t.onreadystatechange=()=>{if(t.readyState===XMLHttpRequest.DONE&&200===t.status){const e=t.responseXML;e&&e.getElementsByTagName("file")?count_bam_entries_in_xml=t.responseXML.getElementsByTagName("file").length:null==e&&console.log("failed at response"),document.getElementById("testing_count").innerHTML=count_bam_entries_in_xml}},t.open("GET",e),t.send()}function loadingScreen(t=!0){if(!1===t){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 t=document.getElementsByClassName("disableOnLoading");for(const e of t)$("#"+e.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 t=document.getElementsByClassName("disableOnLoading");for(const e of t)$("#"+e.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/PNPGARcu3aNX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Whcl8IjHgAAAABJRU5ErkJggg==";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+LV4YZ5U0J0Ay52exGB53oK2+iYXvYGwHKKAOWKJHqTyXGuhUKwAHBK6GCsAYnn8jJVhqaO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AA AP+m3KYAfQCnICW7AAAArklEQVQ4jd3UMQ+CQAwF4OaG66ourpcO/DCGm7v17/vKBUU8SozBGBvy xo9HD6DzB3OicK4WTa7RfIGWgiiH0In6tBK/iMpKhsvyWAfB7NGlJEHQFA+6U5ZVjf2OTtfBI6YF OgIpadkaklGjZtrepIsXL63+U2s8vzHpila+0zsLEQe9ty+kQ7OuFgJ+pseY3nr5cIxtIQt6OkY/ 3lxReHMhF4nm1z+Zv6KP+/PdANuwQcLhhEyQAAAAAElFTkSuQmCC";function generate_colour(t,e,n){t=t.replace(/^\s*#|\s*$/g,""),e=e.replace(/^\s*#|\s*$/g,""),3==t.length&&(t=t.replace(/(.)/g,"$1$1")),3==e.length&&(e=e.replace(/(.)/g,"$1$1"));let a=parseInt(t.substr(0,2),16),o=parseInt(t.substr(2,2),16),s=parseInt(t.substr(4,2),16),l=parseInt(e.substr(0,2),16)-a,i=parseInt(e.substr(2,2),16)-o,r=parseInt(e.substr(4,2),16)-s;return l=(l*n+a).toString(16).split(".")[0],i=(i*n+o).toString(16).split(".")[0],r=(r*n+s).toString(16).split(".")[0],1==l.length&&(l="0"+l),1==i.length&&(i="0"+i),1==r.length&&(r="0"+r),"#"+l+i+r}function round(t,e){return parseFloat(t.toFixed(e))}let colouring_part;function colour_part_by_id(t,e,n,a){colouring_part="all";for(const r of sraList)t.replace("_svg","")==r&&(colouring_part=sraDict[r].svg_part);let o,s,l=n;l=Array.isArray(l)?l[variantPosition]:parseFloat(l),max_abs_scale=document.getElementById("rpkm_scale_input").value,(!max_abs_scale||max_abs_scale<=0)&&(max_abs_scale=1e3),document.getElementById(t)&&(o=document.getElementById(t).getElementsByTagName("path"),s=document.getElementById(t).getElementsByTagName("g"));let i=null;if(o&&s&&(i=Array.prototype.slice.call(o).concat(Array.prototype.slice.call(s))),null!=i){if("abs"==a){const t=255,e=255-parseInt(l/max_abs_scale*255),n=0;if("all"==colouring_part)for(const a of i)a.style.fill="rgb("+t+", "+e+", "+n+")";else for(const a of i)if(a.id==colouring_part)if("g"==a.tagName){const o=a.getElementsByTagName("path");for(const a of o)a.style.fill="rgb("+t+", "+e+", "+n+")"}else a.style.fill="rgb("+t+", "+e+", "+n+")"}else if("rel"==a){let t="";const e=3;let n=0;if("Missing controls data"!=l&&Math.abs(l)>e?n=e:"Missing controls data"!=l&&(n=Math.abs(l)),n/=e,"Missing controls data"==l?t="#D9D9D9":l>0?t=generate_colour("FFFF00","FF0000",n):0==l?t="FFFF00":l<0&&(t=generate_colour("FFFF00","0000FF",n)),"all"==colouring_part)for(const a of i)a.style.fill=t;else for(const a of i)if(a.id==colouring_part)if("g"==a.tagName){const e=a.getElementsByTagName("path");for(const n of e)n.style.fill=t}else a.style.fill=t}document.getElementById(t.replace("_svg","_rpkm")).innerHTML="Missing controls data"==l?l:round(l,2)}else console.log("Paths is null for id = "+t)}let rpkmAverage=1,rpkmMedian=1;function findRPKMValuesAcrossAll(){if(sraDict){const t=Object.keys(sraDict),e=[];let n=0;for(const a of t)if(sraDict[a].RPKM){const t=sraDict[a].RPKM[variantPosition];parseFloat(t)&&(e.push(t),n+=t)}e.length>0&&(rpkmMedian=math.median(e)),rpkmAverage=n/t.length}else displayError("ERROR IN RETRIEVING ALL DATA POINTS WITHIN DATASET")}function switchRPKMMode(t){let e=!1;"rel_radio"===t&&(e=!0),e?(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 t=colouring_mode;for(let e=0;e0?o=n/a:(rpkmMedian&&1===rpkmMedian&&findRPKMValuesAcrossAll(),o=rpkmMedian);let s=0;const l=[];let i="";i=sraDict[t].RPKM&&sraDict[t].RPKM[variantPosition]?sraDict[t].RPKM[variantPosition]:0,0==i&&0==o?exp_info[e].splice(4,1,0):s=Math.log2(i/o),l.push(s),sraDict[t].relativeRPKM=s,exp_info[e].splice(4,1,l),exp_info[e].splice(6,1,o),i>=max_absolute_fpkm&&(max_absolute_fpkm=i),"Missing controls data"!=exp_info[e][4]&&Math.abs(exp_info[e][4])>=max_log_fpkm&&Math.abs(exp_info[e][4])<1e3&&(max_log_fpkm=Math.abs(exp_info[e][4])),"rel"===colouring_mode?exp_info[e][4]||0==exp_info[e][4]||(exp_info[e][4]=-999999):exp_info[e][3][variantPosition]||0==exp_info[e][3][variantPosition]||(exp_info[e][3][variantPosition]=-999999)}else logError("Issue retrieving exp_info for "+t+" within BAM entry point "+e);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(t){null!=document.getElementById("locus")&&(new_locus=document.getElementById("locus").value,new_locus===old_locus?($.xhrPool.abortAll(),variants_radio_options(t)):new_locus!=old_locus&&(getGFF(new_locus),old_locus=new_locus,setTimeout((function(){$.xhrPool.abortAll(),variants_radio_options(t)}),1650)))}function variants_radio_options(t){get_input_values(),$.ajax({url:"./cgi-bin/get_gene_structures.cgi?locus="+locus,dataType:"json",success:function(e){locus_start=e.locus_start,locus_end=e.locus_end,splice_variants=JSON.stringify(e.splice_variants),populate_table(t),populate_efp_modal(t);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 a='",$("#variants_div").append(a),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(t,e,n){displayError("ERROR IN get_gene_structures !"),generateToastNotification(`Error processing gene structures: ${error.message}`,"ERROR"),console.log(`Error processing gene structures: ${error.message}`)}})}function displayError(t){$("#displayError").empty();let e='

'+t+"

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

";console.error("Error in logic:",t),$("#displayError").append(e),$("#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(t){console.error("Error in logic:",t)}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 t=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 e=document.getElementsByClassName("gene_structure_img");for(let n=0;n0)for(let n=0;n0&&(document.getElementById("compareGeneVariants").disabled=!1),e[3]||0==e[3]||(e[3]=-999999);let t="";if(variant_selected&&sraDict[n].RPKM&&sraDict[n].RPKM[variant_selected]){let a=sraDict[n].RPKM[variant_selected].toFixed(2);document.getElementById(e[0].split("_svg")[0]+"_rpkm").innerHTML=a,t=a}else{let n=0;document.getElementById(e[0].split("_svg")[0]+"_rpkm").innerHTML=n,t=n}colour_part_by_id(n+"_svg",sraDict[n].svg_part,t,colouring_mode)}}function parseIntArray(t){for(let e=0,n=t.length;e1?n[1]:t}else if("Amazon AWS"===sraDict[sraList[e]].bam_type){let t=sraDict[sraList[e]].drive_link,n=t.split("amazonaws.com/");1===n.length&&(n=t.split("araport.cyverse-cdn.tacc.cloud/")),match_drive=n.length>1?n[1]:t}data={status:t,numberofreads:sraDict[sraList[e]].numberofreads,hexcodecolour:sraDict[sraList[e]].hexColourCode,remoteDrive:match_drive,bamType:sraDict[sraList[e]].bam_type,filename:sraDict[sraList[e]].filenameIn,tissue:n,record:a,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(t){let e=99;count_bam_entries_in_xml>0&&(e=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>e&&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}`,t.status&&"success"===t.status&&t.record){let e=t.record||"unknown";if(listOfRecordsDisplayed.includes(e)?(e=findUnusedRecordDisplayName(e,listOfRecordsDisplayed),listOfRecordsDisplayed.push(e)):listOfRecordsDisplayed.push(e),listOfRecordsDisplayed=[],sraDict[e].bp_length=parseFloat(t.end)-parseFloat(t.start),sraDict[e].bp_start=parseFloat(t.start),sraDict[e].bp_end=parseFloat(t.end),sraDict[e].MappedReads=t.reads_mapped_to_locus,totalreadsMapped_dic[e]=t.totalReadsMapped,sraDict[e].locusValue=t.locus,sraDict[e].r=t.r,sraDict[e].dataVisualization=t.rnaseqbase64,locus!=t.locus)throw new Error(`ERROR: ${locus}'s RNA-Seq API request returned with data for some other locus.`);let n=[];if(t.ss_y&&t.sum_y&&t.sum_xy&&t.sum_x&&t.ss_x&&t.end&&t.start){parseInt(t.ss_y);let e=parseInt(t.sum_y),a=parseInt(t.ss_y),o=parseIntArray(t.sum_xy.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),s=parseIntArray(t.sum_x.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),l=(parseIntArray(t.sum_xx.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),parseIntArray(t.ss_x.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),parseIntArray(t.ss_x.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(","))),i=parseInt(t.end)-parseInt(t.start),r=[];for(let t=0;t=3?(document.getElementById(e+"_rnaseq_img").src="data:image/png;base64,"+t.rnaseqbase64,rnaseq_change+=1):(document.getElementById(e+"_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 - "+e+", dataset - "+base_src)):(document.getElementById(`${e}_rnaseq_img`)&&(document.getElementById(`${e}_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 - "+e+", dataset - "+base_src)),document.getElementById(e+"_rpb").innerHTML=parseFloat(n[0]).toFixed(2),sraDict[e].rpb=parseFloat(n[0]).toFixed(2),document.getElementById(e+"_rpkm").innerHTML=t["absolute-fpkm"],updateRPKMAbsoluteMax(t["absolute-fpkm"]),sraDict[e].RPKM=t["absolute-fpkm"],rpkmCount++,document.getElementById(e+"_totalReadsNum").innerHTML="Total reads = "+t.totalReadsMapped,callDumpOutputs)if(dumpOutputs+='\t\telif (record == "'+t.record+'"):\n',"complex"==dumpMethod){for(dumpOutputs+='\t\t\tdumpJSON(200, "'+t.locus+'", '+t.variant+", "+t.chromosome+", "+t.start+", "+t.end+', "'+t.record+'", "'+t.tissue+'", "'+t.rnaseqbase64+'", '+t.reads_mapped_to_locus+", "+t["absolute-fpkm"]+", ["+t.r+"], "+t.totalReadsMapped+", ["+t.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()},error:function(t,e,n){generateToastNotification(`Error getting RNA-Seq map coverage for ${data.record} - ${n.message}`,"ERROR"),console.error("Error getting RNA-Seq map coverage!",t,e,n)}})}}}function findUnusedRecordDisplayName(t="unknown",e=sraList,n=0){if(Array.isArray(e)){let a=t+"_"+n;if(e.includes(a))findUnusedRecordDisplayName(t,e,n+1);else if(!e.includes(a))return a}else findUnusedRecordDisplayName(t,e=[])}function updateRPKMAbsoluteMax(t){let e=parseInt(document.getElementById("rpkm_scale_input").value);1e3===e&&(e=1);let n=parseInt(t);n>e&&(document.getElementById("rpkm_scale_input").value=n)}const svgAgainstData={"ath-10dayOldSeedling":{name:"10 Day Old Seedling",subunit:["all","root","shoot"]},"ath-15dayOldSeedling":{name:"15 Day Old Seedling",subunit:["all","root","shoot"]},"ath-etiolatedSeedling":{name:"Etiolated Seedling",subunit:["etiolatedseedling"]},"ath-Flower":{name:"Flower",subunit:["flower","receptacle"]},"ath-FlowerParts":{name:"Flower Parts",subunit:["all","petals","stamen","sepals","carpels"]},"ath-GerminatingSeed":{name:"Germinating Seed"},"ath-Internode":{name:"Internode"},"ath-leaf":{name:"Leaf",subunit:["leaf"]},"ath-LeafParts":{name:"Leaf Parts",subunit:["all","lamina","petiole","veins"]},"ath-Pollen":{name:"Pollen"},"ath-RootTip":{name:"Root Tip"},"ath-rosettePlusRoot":{name:"Rosette Plus Root",subunit:["all","shoot","root"]},"ath-Seed1-4":{name:"Seed 1-4"},"ath-Seed5-7":{name:"Seed 5-7"},"ath-Seed8+":{name:"Seed 8+"},"ath-SenescentLeaf":{name:"Senescent Leaf"},"ath-ShootApexInflorescense":{name:"Shoot Apex Inflorescense"},"ath-ShootApexVegetative-Transition":{name:"Shoot Apex Vegetative-Transition"},"ath-Silique1-5":{name:"Silique 1-5"},"ath-Silique6-10":{name:"Silique 6-10"},"ath-YoungLeaf1-4":{name:"Young Leaf 1-4"},"ath-EarlyBuddingFlower":{name:"Early Budding Flower",subunit:["all","shoot","buds"]},"ath-EarlyBuddingFlower":{name:"Early Budding Flower",subunit:["all","shoot","buds"]},"ath-FlowerBud":{name:"Flower Bud",subunit:["flowerBud"]},"ath-Stamen":{name:"Stamen",subunit:["all","anthers","filament"]},"ath-StigmaAndOvaries":{name:"Stigma And Ovaries",subunit:["all","Stigma_tissue","Ovary_tissue"]},"ath-WholeSilique":{name:"Whole Silique",subunit:["silique","all","seed"]},"ath-youngSeedling":{name:"Young Seedling",subunit:["all","root","hypocotyl","cotyledon"]},"ath-FlowerDevelopment1":{name:"Late Flower Development (1)",subunit:["flowerDevelopmentPart1"]},"ath-FlowerDevelopment2":{name:"Flower Development 2",subunit:["flowerDevelopmentPart2"]},"ath-FlowerDevelopment3":{name:"Flower Development 3",subunit:["flowerDevelopmentPart3"]},"ath-FlowerDevelopment4":{name:"Flower Development 4",subunit:["flowerDevelopmentPart4"]},"ath-FlowerDevelopment5":{name:"Flower Development 5",subunit:["flowerDevelopmentPart5"]},"ath-FlowerDevelopment6-8":{name:"Flower Development 6-8",subunit:["flowerDevelopmentPart6"]},"ath-FlowerDevelopment9-11":{name:"Flower Development 9-11",subunit:["flowerDevelopmentPart9"]},"ath-FlowerDevelopment12-14":{name:"Flower Development 12-14",subunit:["flowerDevelopmentPart12"]},"ath-FlowerDevelopment15-18":{name:"Flower Development 15-18",subunit:["flowerDevelopmentPart15"]},"ath-FlowerDevelopment19":{name:"Flower Development 19",subunit:["flowerDevelopmentPart19"]},"ath-Other":{name:"Other"}};function checkAgainstSVG(t,e,n=!1){let a=t.split(".")[0],o=n?svgAgainstData[a].name:e;return svgAgainstData[a]&&!n&&(svgAgainstData[a].subunit?svgAgainstData[a].subunit.includes(e)||(svgAgainstData[a].subunit_name?o=svgAgainstData[a].subunit_name:svgAgainstData[a].subunit[0]&&(o=svgAgainstData[a].subunit[0])):"all"!==e&&(o="all")),o}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(t){$("#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;let e='RNA-Seq mapped image',n='
Title
Sorting arrow
RNA-Seq Coverage'+e+'
rpb
Default sort arrow
eFP (RPKM)
RPKM
Default sort arrow
Details
Default sort arrow
';$("#theTable").append(n);let a='
Title
RNA-Seq Coverage'+e+'
rpb
eFP (RPKM)
RPKM
Details
';$("#compareTable").append(a),$.ajax({url:base_src,dataType:"xml",success:function(e){$(e).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,$(e).find("file").each((function(){let e=$(this).attr("record_number")||"unknown";if(sraList.includes(e)&&(e=findUnusedRecordDisplayName(e,sraList)),sraList.includes(e)){if(sraCountDic[e]){sraCountDic[e]+=1;let t=e+"("+sraCountDic[e]+")";sraList.push(t),sraDict[t]={}}}else sraCountDic[e]=1,sraList.push(e),sraDict[e]={};let n=$(this).attr("description");sraDict[e].title=n;let a=$(this).attr("info");sraDict[e].description=a;let o=$(this).attr("svgname");sraDict[e].svg=o;let s=$(this).attr("svg_subunit");s=checkAgainstSVG(o,s),sraDict[e].svg_part=s,tissueSRADic[checkAgainstSVG(o,s,!0)]?tissueSRADic[checkAgainstSVG(o,s,!0)].push(e):tissueSRADic[checkAgainstSVG(o,s,!0)]=[e];let l=$(this).attr("url");sraDict[e].url=l;let i=$(this).attr("publication_link");sraDict[e].publicationid=i;let r,d=$(this).attr("total_reads_mapped");null!=d&&""!=d||(d="0"),sraDict[e].numberofreads=d,r=null==$(this).attr("hex_colour")||""==$(this).attr("hex_colour")?"0x64cc65":$(this).attr("hex_colour"),sraDict[e].hexColourCode=r;let c=$(this).attr("filename");null!=c&&""!=c&&null!=c||(c="accepted_hits.bam"),sraDict[e].filenameIn=c;let u=$(this).attr("species");sraDict[e].species=u;let m=[];if(null==$(this).find("controls")[0].innerHTML)for(let t=1;t<$(this).find("controls")[0].childNodes.length;t+2)m.push($(this).find("controls")[0].childNodes[t].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[e].controls=m;let g="";if(m.length>0)for(let t=m.length;t--;)"MEDIAN"!=m[t]?g+=''+m[t]+" ":g+=m[t];sraDict[e].links=g;let p="";if(m.length>0)for(let t=0;t',v="\n\t\n";v+="\t\t\n",y+='\n",y+=`\n\t\t\t\t\t\n\n\t\t\t\t`,y+='",y+='\n",y+='',y+='\n",y+='',y+="",iteration_num++,$("#theTable").append(y);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([e+"_svg",s,m,0,0,0,0]),!0===loadNewDataset?(setTimeout((function(){count_bam_num()}),200),setTimeout((function(){rnaseq_images(t)}),10)):rnaseq_images(t)})),$.tablesorter.addParser({id:"rpb_sorter",is:function(t){return!1},format:function(t){return NaN==t?-99999:null==t?-999999:t==1/0?99999:t==-1/0?-99999:parseFloat(t)},type:"numeric"}),$.tablesorter.addParser({id:"rpkm_sorter",is:function(t){return!1},format:function(t){return NaN==t?-99999:null==t?-999999:t==1/0?99999:t==-1/0?-99999:"Missing controls data"==t?-9999999:parseFloat(t)},type:"numeric"}),$("#theTable").tablesorter({headers:{0:{},1:{sorter:!1},2:{sorter:"rpb_sorter"},3:{},4:{sorter:"rpkm_sorter"},5:{}}}),$("#theTable").trigger("update")},error:function(t,e,n){generateToastNotification(`Error getting data from data file: ${n.message}`,"ERROR"),console.log("Error getting data from data file: "+n.message)}});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);for(let o=0;o',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(t){if(null!=document.getElementById(t))if(document.getElementById(t).innerHTML==moreDetails){document.getElementById(t).setAttribute("hidden",!0);const e=document.getElementById(document.getElementById(t).name);e.textContent=e.getAttribute("name")}else if(document.getElementById(t).innerHTML==lessDetails){const e=t.substring(0,t.length-5);document.getElementById(e).removeAttribute("hidden");const n=document.getElementById(document.getElementById(t).name);n.textContent=truncateDescription(n.getAttribute("name"))}}function truncateDescription(t){if(null!=t||null!=t)return t.length>30?t.substring(0,30)+"...":t}let remainder_efp=0,efp_length=0,eFPSortedSRA=[],efp_RPKM_values=[];function populate_efp_modal(t){toggleResponsiveTable(2),$("#efpModalTable").empty(),efp_table_column="",eFPSortedSRA=[];const e=document.getElementsByClassName("colTitle");for(let n=2;n\n\t\t\t\tAGI-ID:\n\t\t\t\t\t\n\t\t\t\t\t\t${locus}\n\t\t\t\t\t\n\t\t\t

\n\t\t`),"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(a)+"
","Amazon AWS"===f&&(y+=''),e.includes("unknown")&&!i||(y+='"),y+='"+moreDetails.trim()+"",y+='
\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('
');for(let n=0;n<11*~~(eFPSortedSRA.length/11);n+=11)if("null"!=document.getElementById(eFPSortedSRA[n+10]).outerHTML){efp_table_column="";for(let t=0;t<11;t++)efp_table_column+=generateEFPTableItem(eFPSortedSRA[n+t],sraDict[eFPSortedSRA[n+t]].title);efp_table_column+="",$("#eFPtable").append(efp_table_column)}for(let n=0;n<12;n++)if(remainder_efp===n){efp_table_column="";for(let t=remainder_efp;t>0;t--)efp_table_column+=generateEFPTableItem(eFPSortedSRA[efp_length-t],sraDict[eFPSortedSRA[efp_length-t]].title);efp_table_column+="",$("#eFPtable").append(efp_table_column)}toggleResponsiveTable()}function generateEFPTableItem(t,e){return t&&e?`\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t${document.getElementById(t+"_svg").outerHTML}\n\t\t\t\t\t\n\t\t\t\t\t${t} - ${e}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t`:""}function change_rpkm_colour_scale(t){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"==t){const t=document.createElement("img");t.src="data:image/png;base64,"+relative_rpkm_scale,t.style="margin-top: 10px;",svg_colouring_element&&svg_colouring_element.appendChild(t)}else{const t=document.createElement("img");t.src="data:image/png;base64,"+absolute_rpkm_scale,t.style="margin-top: 10px;",t.alt="Absolute RPKM Scale",svg_colouring_element&&svg_colouring_element.appendChild(t)}const e=["colTitle","colRNA","colrpb","coleFP","colRPKM","colDetails"];let n=[];document.getElementsByClassName("fltrow")&&document.getElementsByClassName("fltrow")[0]&&(n=document.getElementsByClassName("fltrow")[0].getElementsByTagName("td"));for(let a=0;a=1&&t[2]<=5||"C"==t[2]||"M"==t[2]||"c"==t[2]||"m"==t[2])&&("G"==t[3]||"g"==t[3])&&t[4]>=0&&t[4]<=9&&t[5]>=0&&t[5]<=9&&t[6]>=0&&t[6]<=9&&t[7]>=0&&t[7]<=9&&t[8]>=0&&t[8]<=9?$("#locus_button").removeAttr("disabled"):$("#locus_button").prop("disabled",!0)}function yscale_validation(){const t=document.getElementById("yscale_input").value;parseInt(t)>0||"Auto"==t||""==t?$("#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 t=findAuthUser();""==users_email&&null==users_email&&null==users_email||users_email!==t?""!=users_email&&users_email!=t&&(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(t){xml_title=void 0,match_title={},title_list=[];let e=1,n=1;if(get_xml_list_output=t,"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 t=0;t\n\t\t\t\t\t\t\t\t\t\t${title_list[t]}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t`;list_modified=!0}),1e3)}databasesAdded=!0},error:function(t,e,n){generateToastNotification(`Error getting user data: ${n.message}`,"ERROR"),console.log(`Error getting user data: ${n.message}`)}})}let datalist=[],datalist_Title={};function create_data_list(t){if(datalist=[],datalist_Title={},t>0)for(let e=0;e{if(e.readyState===XMLHttpRequest.DONE&&200===e.status){let n=e.responseXML;if(n){let e=n.getElementsByTagName("files")[0].attributes.xmltitle.nodeValue;datalist_Title[e]=t[dlCallPosition],dlCallPosition+=1,DatalistXHRCall(t)}}},e.open("GET",n),e.send()}}function validateEmail(t){return/\S+@\S+\.\S+/.test(t)}function findAuthUser(){return global_user&&global_user.email?global_user.email:""}function check_if_Google_login(){const t=findAuthUser();users_email&&t&&users_email===t?!1===databasesAdded&&(document.getElementById("private_dataset_header").style.display="block",get_user_XML_display()):(signOut(),remove_private_database())}function add_user_xml_by_upload(){get_user_XML_display(),setTimeout((function(){const t=findAuthUser();user_exist?user_exist&&(dataset_dictionary[datasetName]?dataset_dictionary[datasetName]&&(users_email===t?(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!=t&&(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in"))):users_email===t?$.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!=t&&(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in"))):users_email===t?$.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!=t&&(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 t=findAuthUser();""!=users_email&&users_email===t?document.getElementById("upload_modal").click():""!=users_email&&users_email!=t?(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 e in public_dataset_dictionary)public_dataset_dictionary.hasOwnProperty(e)&&public_title_list.push(e);let t=0;total_amount_of_datasets=public_title_list.length+title_list.length;for(let e=0;e\n\t\t\t\t\t${public_title_list[e]}\n\t\t\t\t\n\t\t\t\t
\n\t\t\t`),t+=1;for(let e=0;e\n\t\t\t\t\t${title_list[e]}\n\t\t\t\t\n\t\t\t\t
\n\t\t\t`),t+=1}let isDeletePublicDisabled=!1;function disableDeletePublic(){for(let t=0;t\n\t\n",a+="\t\t"+e+"\n",a+=table_base,n.each((function(){a+="\t\t\n";const t=$(this).attr("description");a+="\t\t\t"+t+"\n";const e=$(this).attr("info");a+="\t\t\t"+e+"\n";const n=$(this).attr("record_number");a+="\t\t\t"+n+"\n";const o=$(this).attr("name");a+="\t\t\t"+o+"\n";const s=$(this).attr("bam_type");a+="\t\t\t"+s+"\n";let l=$(this).attr("filename");null!=l&&"undefined"!==l&&".bam"!==l||(l="accepted_hits.bam"),a+="\t\t\t"+l+"\n";const i=$(this).attr("publication_link");a+="\t\t\t"+i+"\n";const r=$(this).attr("url");a+="\t\t\t"+r+"\n";let d=$(this).attr("total_reads_mapped");null!=d&&""!=d||(d="0"),a+="\t\t\t"+d+"\n";const c=$(this).attr("read_map_method");a+="\t\t\t"+c+"\n";let u=$(this).attr("species");null!=u&&""!=u||(u="Arabidopsis thaliana"),a+="\t\t\t"+u+"\n";const m=$(this).attr("svgname");a+="\t\t\t"+m+"\n";const g=$(this).attr("svg_subunit");a+="\t\t\t"+g+"\n";let p="";if($(this).find("controls")[0].innerHTML)for(let a=1;a<$(this).find("controls")[0].childNodes.length;a+=2)$(this).find("controls")[0].childNodes[a].firstChild&&(p+=$(this).find("controls")[0].childNodes[a].firstChild.textContent,a<$(this).find("controls")[0].childNodes.length-2&&(p+=", "));a+="\t\t\t"+p+"\n";let _="";if($(this).find("groupwith")[0].innerHTML)for(let a=1;a<$(this).find("groupwith")[0].childNodes.length;a+=2)$(this).find("groupwith")[0].childNodes[a].firstChild&&(_+=$(this).find("groupwith")[0].childNodes[a].firstChild.textContent,a<$(this).find("groupwith")[0].childNodes.length-2&&(_+=", "));a+="\t\t\t"+_+"\n",a+="\t\t\n"})),a+="\t\n",document.getElementById("XMLtoCSVtable").innerHTML+=a},error:function(t,e,n){generateToastNotification(`Error filling data table: ${n.message}`,"ERROR"),console.log(`Error filling data table: ${n.message}`)}})}}function download_XMLtableCSV(){for(let t=0;t\n",t+=downloadIndexTable_base;for(const e of eFPSortedSRA)t+="\t\t\n",t+="\t\t\t"+sraDict[e].title+"\n",t+="\t\t\t"+e+"\n",t+="\t\t\t"+sraDict[e].svg.substr(4,sraDict[e].svg.length-8)+"\n",t+="\t\t\t"+sraDict[e].svg_part+"\n",t+="\t\t\t"+sraDict[e].locusValue+"\n",t+="\t\t\t"+String(sraDict[e].bp_length)+"\n",t+="\t\t\t"+String(sraDict[e].bp_start)+"\n",t+="\t\t\t"+String(sraDict[e].bp_end)+"\n",t+="\t\t\t"+sraDict[e].numberofreads+"\n",t+="\t\t\t"+String(sraDict[e].MappedReads)+"\n",t+="\t\t\t"+sraDict[e].rpb+"\n",t+="\t\t\t"+String(sraDict[e].RPKM[variantPosition].toFixed(2))+"\n",t+="\t\t\t"+String(sraDict[e].controlsString)+"\n",t+="\t\t\n";t+="\t\n",document.getElementById("hiddenDownloadModal_table").innerHTML+=t,$("#hiddenDownloadModal_table").tableToCSV(),document.getElementById("download_icon").classList.remove("progressLoading"),document.getElementById("bodyContainer").classList.remove("progressLoading")}let publicData=!0;function changePublicData(t=!1){publicData=!t&&!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 t in public_dataset_dictionary){if(base_src===public_dataset_dictionary[t]){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(t){if("string"==typeof t){const e=new RegExp("^[A][T][MC0-9][G][0-9]{5}[.][0-9]{1,2}$|^[A][T][MC0-9][G][0-9]{5}$","i");return t.trim().match(e)}return!1}let parse_output,GFF_List=[];function getGFF(t){GFF_List=[],$.ajax({url:`https://bar.utoronto.ca/webservices/bar_araport/gene_structure_by_locus.php?locus=${t}`,dataType:"json",crossDomain:!0,headers:{"Access-Control-Allow-Origin":"*"},failure:function(){console.log("Getting GFFs (getGFF) information failed to retrieve locus information from Araport11")},success:function(t){if(parse_output=t,parse_output.wasSuccessful){let t=parse_output.features[0].subfeatures;for(let e=0;e0)for(let t=0;t0){const t=document.getElementById("locus").value.trim().split("/");t[0]?document.getElementById("locus").value=t[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(t){html2canvas(document.getElementById(t)).then((t=>{$("#appendCanvas").empty(),t.id="downloadDivNum_"+downloadDivNum,document.getElementById("appendCanvas").appendChild(t),document.getElementById("downloadDivNum_"+downloadDivNum).style.width="100%",$("#DownloadImageModal").modal("toggle"),downloadDivNum++}))}function displayNavBAR(t=!1){const e=$("#navbar_menu").is(":visible")||t;document.getElementById("navbar_menu").style.display=e?"none":"block",document.getElementById("main_content").className=e?"col-sm-12":"col-sm-9",document.getElementById("openMenu").style.display=e?"block":"none",document.getElementById("theTable")&&(e?document.getElementById("theTable").classList.add("RNATable"):document.getElementById("theTable").classList.remove("RNATable"))}function adjustFooterSize(){const t=document.getElementById("navbar_menu");t&&(document.getElementById("nm_footer").style.width=t.offsetWidth+"px",t.scrollHeight==t.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")):t.scrollHeight>t.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 t=.7*window.innerHeight;document.getElementById("submissioniframe").height=t+"px"}let usedToggle=!1;function toggleTableCol(t,e){const n=document.getElementsByClassName(t);if(e)for(const a of n)a&&a.removeAttribute("hidden");else if(!e)for(const a of n)a&&a.setAttribute("hidden",!0)}let responsiveRNAWidthAdjusted=!1;function responsiveRNAWidthResize(){const t=document.getElementsByClassName("responsiveRNAWidth");if(window.innerWidth<=575){for(let e=0;e575&&responsiveRNAWidthAdjusted)for(let e=0;e=1100&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!0,!0,!0,!0,!1):3==t||window.innerWidth<830&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!1,!1,!1,!1,!1):4==t||window.innerWidth<900&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!0,!1,!1,!1,!1):5==t||window.innerWidth<990&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!0,!1,!0,!1,!1):(6==t||window.innerWidth<1100&&!usedToggle)&&toggleResponsiveTableOptions(!0,!0,!0,!0,!0,!1,!1))}let ToggledTable=[!0,!0,!0,!0,!0,!0,!1];function RememberToggleOptions(t=!0,e=!0,n=!0,a=!0,o=!0,s=!0,l=!1){ToggledTable=[t,e,n,a,o,s,l]}const colSortList=["colTitle","colrpb","colRPKM","colDetails"];function ResizeArrowRow(){for(const t of colSortList){const e=t+"Row";document.getElementById(e).style.width=document.getElementById(e).parentNode.offsetWidth-2+"px";CheckElementWidth(t+"Arrow",8)}}function CheckElementWidth(t,e){document.getElementById(t).offsetWidth{-1!==navigator.userAgent.indexOf(t)&&o++})),o!=e){n=element,a=!1;break}}}if(n){$("#notChrome").empty();const t=' or through the following Google search results';$("#notChrome").append(t)}BrowserDetected=!0}}function CreateFilteredeFPList(){if($("#filtereFPList").empty(),tissueSRADic){const t=Object.keys(tissueSRADic);for(const e of t){let t='
  • ';t+='',t+='

    '+e+"

    ",t+="
  • ",$("#filtereFPList").append(t)}}else logError("Unable to use tissueSRADic")}function ToggleFilteredeFP(t,e){const n=t.replace("_"," "),a=tissueSRADic[n];if(!0===e)for(let o=0;o1)if("locus"===a[0].split("%20").join(" ").trim()){const n=t.substring(6).split("%20").join(" ").trim();shareLinkInputs.locus=n,document.getElementById("locus").value=n,e=!0}else if("dataset"===a[0].split("%20").join(" ").trim()){const e=t.substring(8).split("%20").join(" ").trim();shareLinkInputs.dataset=e,base_src=e,n=!0}}e&&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(e&&!1===n?"ERROR IN SHARE LINK! Missing dataset":!1===e&&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(t,e=!1){const n=t.split("_")[0];if(e)disableAllComparison();else if(!1===e&&document.getElementById(t)&&document.getElementById(t).checked){allCheckedOptions.push(n);const e={};for(let t=0;t';parseInt(t)===parseInt(variantPosition)?a+=''+document.getElementById(n+"_title").innerHTML+" ... ("+GFF_List[t]+")\n":a+='^^^ ... ('+GFF_List[t]+")\n",a+='RNA-Seq mapped image for:'+n+'
    Gene variant image for:'+n+'\n',a+=''+sraDict[n].r[t].toFixed(2)+"",a+='
    '+document.getElementById(sraDict[n].svg.substr(4).replace(".svg","_svg")).innerHTML+'
    '+sraDict[n].svg.substring(4).replace(".svg","")+"
    \n",a+=''+sraDict[n].RPKM[t].toFixed(2)+"",parseInt(t)===parseInt(variantPosition)?a+='
    '+document.getElementById(n+"_description").innerHTML+'
    '+document.getElementById("igbLink_"+n).innerHTML+'
    '+document.getElementById("extraLinks_"+n).innerHTML+"
    \n":a+='^^^\n',a+="",e[t]=n+"_compareRow"+t,document.getElementById("compareTable").innerHTML+=a,document.getElementById(n+"_rnaseq_img"+t)&&document.getElementById(n+"_rnaseq_img"+t).setAttribute("src",document.getElementById(n+"_rnaseq_img").src),document.getElementById(n+"_gene_structure_img"+t)&&document.getElementById(n+"_gene_structure_img"+t).setAttribute("src",document.getElementsByClassName("dd-option-image")[t].src),sraDict[n].RPKM&&sraDict[n].RPKM[t]&&colour_part_by_id(n+"_svg"+t,sraDict[n].svg_part,sraDict[n].RPKM[t],colouring_mode)}document.getElementById(t).checked=!0,document.getElementById("allCheckbox").checked=!0,"rel"!=colouring_mode&&(document.getElementById("compareGeneVariants").disabled=!1)}else!1===e?(disableCompare(n),allCheckedOptions.splice(allCheckedOptions.indexOf(n),1),document.getElementById(t).checked=!1):!0===e&&disableAllComparison(),0===allCheckedOptions.length&&(document.getElementById("compareGeneVariants").disabled=!0)}function disableCompare(t){for(let e=0;e=0;a--)document.getElementsByClassName("compareDataRow")[a].remove();allCheckedOptions=[],t=document.getElementsByClassName("compareCheckbox");for(let a=0;a\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t${e}\n\t\t\t\t\n\t\t\t
    \n\t\t\t
    ${t}
    \n\t\t\n\t\t`;document.getElementById("toast-container").innerHTML+=a,$(`[data-toast="${n}"]`).toast({autohide:!1}),$(`[data-toast="${n}"]`).toast("show")}}function init(){document.getElementById("locus").value="AT2G24270",document.getElementById("xmlDatabase").value="Araport 11 RNA-seq data",locus_validation(),old_locus=locus,yscale_validation(),rpkm_validation(),adjustFooterSize(),displayVersionNumber(),adjustTableOptionsDropdownSize(),setUpCookies(),$("input[type=radio][name=radio_group]").change((function(){gene_structure_radio_on_change()})),$("#locus").keyup((function(){locus_validation()})),$("#yscale_input").keyup((function(){yscale_validation()})),$("#rpkm_scale_input").keyup((function(){rpkm_validation()})),document.getElementsByClassName("abcRioButtonLightBlue").length>0&&hiddenGoogleSignin(),getGFF(locus),$("#locus").autocomplete({source:function(t,e){const n=t.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(t){t&&t.length>=7?e(t.slice(0,7)):e(t)}))},close:function(t,e){correctAGIIDInput()}});const t=document.getElementById("submissioniframe");t&&t.setAttribute("src",t.getAttribute("data-src")),adjustSubmissionIFrameSize(),readShareLink();document&&"bar.utoronto.ca"===document.location.host&&document.location.href&&document.querySelector('link[rel="canonical"]')&&document.querySelector('link[rel="canonical"]').setAttribute("href",document.location.href)}$(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.15-p20240115";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 t=new XMLHttpRequest,e=base_src;t.responseType="document",t.onreadystatechange=()=>{if(t.readyState===XMLHttpRequest.DONE&&200===t.status){const e=t.responseXML;e&&e.getElementsByTagName("file")?count_bam_entries_in_xml=t.responseXML.getElementsByTagName("file").length:null==e&&console.log("failed at response"),document.getElementById("testing_count").innerHTML=count_bam_entries_in_xml}},t.open("GET",e),t.send()}function loadingScreen(t=!0){if(!1===t){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 t=document.getElementsByClassName("disableOnLoading");for(const e of t)$("#"+e.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 t=document.getElementsByClassName("disableOnLoading");for(const e of t)$("#"+e.id).prop("disabled",!1);addGFF(),uploadingData=!1}}count_bam_num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39/RtiWSqVaLVaRFEEwN27d7d93iiKCIKA27dv8+DBAy5fvpxuazQa1Ov1dHp89uxZuq1ardJqtVw4yYlQ2r4wDDl58mT6eGZmhuvXr/Pu3TuOHj1KJpMhDENevHgBwNjYGFeuXOHVq1eEYUg2mwUgl8sxMzPDqVOnyOfz9PX1pS97/sgkCFAul2m32zx9+pQkSajVaoyOjjI5Ocns7CxRFPHy5UuiKGJkZIT+/n6y2Szj4+OMjY1x48YNF1TaxL5ut9v9+omJiYkNPyVtLo5jkiTZ8NEJWPv4BJBG8GudTockSchkMts+39TUFKurq9y7dw+Aer3O0NAQKysrLob0A7bqmxOh9JO2itlmAfx6wvxZfX19DA0NEYYhBw4cYHFxkdHRURdC+o8MofSHqFQqLC0tUavVAJifn9/0M4mSDKG0axWLRYrFohdC+oW8a1SSZAglSTKEkiQZQkmSDKEkSYZQkiRDKEmSIZQkyRBKkmQIJUkyhJIkGUJJkgyhJEmGUJKkP9mWX8PkN9RLkpwIJUna5fZ1u92ul0GS5EQoSdIe9DfEVWhcl8IjHgAAAABJRU5ErkJggg==";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,iVBORw0KGgoAAAANSUhEUgAAAcIAAAAICAIAAADlfmh0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAMBSURBVGhD7Vi7ceswEGQrVBUMxC40wwKYKVANDpwpVuIqVIx6ealxHxzuA9BPsmfMGQOzgQgs7hZH3R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AD/rwD/qgD/pQD/oAD/mgD/lQD/kAD/iwD/ hgD/gQD/fAD/dwD/cgD/bQD/ZwD/YgD/XQD/WAD/UwD/TgD/SQD/RAD/PwD/OgD/NAD/LwD/KgD/ JQD/IAD/GwD/FgD/EQD/DAD/BwBUljDTAAAA1klEQVQ4jWNg5+Dk4ubh5eMXEBQSFhEVE5eQlJKW kZWTV1BUUlZRVVPX0NTS1tHV0zcwNDI2MTUzt7C0sraxtbN3cHRydnF1c/fw9PL28fXzDwgMCg4J DQuPiIyKjomNi09ITEpOSU1Lz8jMYhi1hDRLGDi5GICWMBBvCSMjIUsYY+MYUS0BApJ8wmhlzUjI EiDAYgkD0CcMwgxUtQRIpDKmZzCiBBcDgwgDlSwBBRdjUjJjahojI2qcMAhT2RJGNEuAYUasJURH PGMyPLiGTz4ZtYQESwCEoDnh8dGTkQAAAABJRU5ErkJggg==",exon_intron_scale="iVBORw0KGgoAAAANSUhEUgAAALQAAAAPBAMAAAC/7vi3AAAAGFBMVEX///9QUFAAAADcFDz/jAAA AP+m3KYAfQCnICW7AAAArklEQVQ4jd3UMQ+CQAwF4OaG66ourpcO/DCGm7v17/vKBUU8SozBGBvy xo9HD6DzB3OicK4WTa7RfIGWgiiH0In6tBK/iMpKhsvyWAfB7NGlJEHQFA+6U5ZVjf2OTtfBI6YF OgIpadkaklGjZtrepIsXL63+U2s8vzHpila+0zsLEQe9ty+kQ7OuFgJ+pseY3nr5cIxtIQt6OkY/ 3lxReHMhF4nm1z+Zv6KP+/PdANuwQcLhhEyQAAAAAElFTkSuQmCC";function generate_colour(t,e,n){t=t.replace(/^\s*#|\s*$/g,""),e=e.replace(/^\s*#|\s*$/g,""),3==t.length&&(t=t.replace(/(.)/g,"$1$1")),3==e.length&&(e=e.replace(/(.)/g,"$1$1"));let a=parseInt(t.substr(0,2),16),o=parseInt(t.substr(2,2),16),s=parseInt(t.substr(4,2),16),l=parseInt(e.substr(0,2),16)-a,i=parseInt(e.substr(2,2),16)-o,r=parseInt(e.substr(4,2),16)-s;return l=(l*n+a).toString(16).split(".")[0],i=(i*n+o).toString(16).split(".")[0],r=(r*n+s).toString(16).split(".")[0],1==l.length&&(l="0"+l),1==i.length&&(i="0"+i),1==r.length&&(r="0"+r),"#"+l+i+r}function round(t,e){return parseFloat(t.toFixed(e))}let colouring_part;function colour_part_by_id(t,e,n,a){colouring_part="all";for(const r of sraList)t.replace("_svg","")==r&&(colouring_part=sraDict[r].svg_part);let o,s,l=n;l=Array.isArray(l)?l[variantPosition]:parseFloat(l),max_abs_scale=document.getElementById("rpkm_scale_input").value,(!max_abs_scale||max_abs_scale<=0)&&(max_abs_scale=1e3),document.getElementById(t)&&(o=document.getElementById(t).getElementsByTagName("path"),s=document.getElementById(t).getElementsByTagName("g"));let i=null;if(o&&s&&(i=Array.prototype.slice.call(o).concat(Array.prototype.slice.call(s))),null!=i){if("abs"==a){const t=255,e=255-parseInt(l/max_abs_scale*255),n=0;if("all"==colouring_part)for(const a of i)a.style.fill="rgb("+t+", "+e+", "+n+")";else for(const a of i)if(a.id==colouring_part)if("g"==a.tagName){const o=a.getElementsByTagName("path");for(const a of o)a.style.fill="rgb("+t+", "+e+", "+n+")"}else a.style.fill="rgb("+t+", "+e+", "+n+")"}else if("rel"==a){let t="";const e=3;let n=0;if("Missing controls data"!=l&&Math.abs(l)>e?n=e:"Missing controls data"!=l&&(n=Math.abs(l)),n/=e,"Missing controls data"==l?t="#D9D9D9":l>0?t=generate_colour("FFFF00","FF0000",n):0==l?t="FFFF00":l<0&&(t=generate_colour("FFFF00","0000FF",n)),"all"==colouring_part)for(const a of i)a.style.fill=t;else for(const a of i)if(a.id==colouring_part)if("g"==a.tagName){const e=a.getElementsByTagName("path");for(const n of e)n.style.fill=t}else a.style.fill=t}document.getElementById(t.replace("_svg","_rpkm")).innerHTML="Missing controls data"==l?l:round(l,2)}else console.log("Paths is null for id = "+t)}let rpkmAverage=1,rpkmMedian=1;function findRPKMValuesAcrossAll(){if(sraDict){const t=Object.keys(sraDict),e=[];let n=0;for(const a of t)if(sraDict[a].RPKM){const t=sraDict[a].RPKM[variantPosition];parseFloat(t)&&(e.push(t),n+=t)}e.length>0&&(rpkmMedian=math.median(e)),rpkmAverage=n/t.length}else displayError("ERROR IN RETRIEVING ALL DATA POINTS WITHIN DATASET")}function switchRPKMMode(t){let e=!1;"rel_radio"===t&&(e=!0),e?(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 t=colouring_mode;for(let e=0;e0?o=n/a:(rpkmMedian&&1===rpkmMedian&&findRPKMValuesAcrossAll(),o=rpkmMedian);let s=0;const l=[];let i="";i=sraDict[t].RPKM&&sraDict[t].RPKM[variantPosition]?sraDict[t].RPKM[variantPosition]:0,0==i&&0==o?exp_info[e].splice(4,1,0):s=Math.log2(i/o),l.push(s),sraDict[t].relativeRPKM=s,exp_info[e].splice(4,1,l),exp_info[e].splice(6,1,o),i>=max_absolute_fpkm&&(max_absolute_fpkm=i),"Missing controls data"!=exp_info[e][4]&&Math.abs(exp_info[e][4])>=max_log_fpkm&&Math.abs(exp_info[e][4])<1e3&&(max_log_fpkm=Math.abs(exp_info[e][4])),"rel"===colouring_mode?exp_info[e][4]||0==exp_info[e][4]||(exp_info[e][4]=-999999):exp_info[e][3][variantPosition]||0==exp_info[e][3][variantPosition]||(exp_info[e][3][variantPosition]=-999999)}else logError("Issue retrieving exp_info for "+t+" within BAM entry point "+e);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(t){null!=document.getElementById("locus")&&(new_locus=document.getElementById("locus").value,new_locus===old_locus?($.xhrPool.abortAll(),variants_radio_options(t)):new_locus!=old_locus&&(getGFF(new_locus),old_locus=new_locus,setTimeout((function(){$.xhrPool.abortAll(),variants_radio_options(t)}),1650)))}function variants_radio_options(t){get_input_values(),$.ajax({url:"./cgi-bin/get_gene_structures.cgi?locus="+locus,dataType:"json",success:function(e){locus_start=e.locus_start,locus_end=e.locus_end,splice_variants=JSON.stringify(e.splice_variants),populate_table(t),populate_efp_modal(t);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 a='",$("#variants_div").append(a),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(t,e,n){displayError("ERROR IN get_gene_structures !"),generateToastNotification(`Error processing gene structures: ${error.message}`,"ERROR"),console.log(`Error processing gene structures: ${error.message}`)}})}function displayError(t){$("#displayError").empty();let e='

    '+t+"

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

    ";console.error("Error in logic:",t),$("#displayError").append(e),$("#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(t){console.error("Error in logic:",t)}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 t=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 e=document.getElementsByClassName("gene_structure_img");for(let n=0;n0)for(let n=0;n0&&(document.getElementById("compareGeneVariants").disabled=!1),e[3]||0==e[3]||(e[3]=-999999);let t="";if(variant_selected&&sraDict[n].RPKM&&sraDict[n].RPKM[variant_selected]){let a=sraDict[n].RPKM[variant_selected].toFixed(2);document.getElementById(e[0].split("_svg")[0]+"_rpkm").innerHTML=a,t=a}else{let n=0;document.getElementById(e[0].split("_svg")[0]+"_rpkm").innerHTML=n,t=n}colour_part_by_id(n+"_svg",sraDict[n].svg_part,t,colouring_mode)}}function parseIntArray(t){for(let e=0,n=t.length;e1?n[1]:t}else if("Amazon AWS"===sraDict[sraList[e]].bam_type){let t=sraDict[sraList[e]].drive_link,n=t.split("amazonaws.com/");1===n.length&&(n=t.split("araport.cyverse-cdn.tacc.cloud/")),match_drive=n.length>1?n[1]:t}data={status:t,numberofreads:sraDict[sraList[e]].numberofreads,hexcodecolour:sraDict[sraList[e]].hexColourCode,remoteDrive:match_drive,bamType:sraDict[sraList[e]].bam_type,filename:sraDict[sraList[e]].filenameIn,tissue:n,record:a,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(t){let e=99;count_bam_entries_in_xml>0&&(e=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>e&&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}`,t.status&&"success"===t.status&&t.record){let e=t.record||"unknown";if(listOfRecordsDisplayed.includes(e)?(e=findUnusedRecordDisplayName(e,listOfRecordsDisplayed),listOfRecordsDisplayed.push(e)):listOfRecordsDisplayed.push(e),listOfRecordsDisplayed=[],sraDict[e].bp_length=parseFloat(t.end)-parseFloat(t.start),sraDict[e].bp_start=parseFloat(t.start),sraDict[e].bp_end=parseFloat(t.end),sraDict[e].MappedReads=t.reads_mapped_to_locus,totalreadsMapped_dic[e]=t.totalReadsMapped,sraDict[e].locusValue=t.locus,sraDict[e].r=t.r,sraDict[e].dataVisualization=t.rnaseqbase64,locus!=t.locus)throw new Error(`ERROR: ${locus}'s RNA-Seq API request returned with data for some other locus.`);let n=[];if(t.ss_y&&t.sum_y&&t.sum_xy&&t.sum_x&&t.ss_x&&t.end&&t.start){parseInt(t.ss_y);let e=parseInt(t.sum_y),a=parseInt(t.ss_y),o=parseIntArray(t.sum_xy.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),s=parseIntArray(t.sum_x.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),l=(parseIntArray(t.sum_xx.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),parseIntArray(t.ss_x.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),parseIntArray(t.ss_x.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(","))),i=parseInt(t.end)-parseInt(t.start),r=[];for(let t=0;t=3?(document.getElementById(e+"_rnaseq_img").src="data:image/png;base64,"+t.rnaseqbase64,rnaseq_change+=1):(document.getElementById(e+"_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 - "+e+", dataset - "+base_src)):(document.getElementById(`${e}_rnaseq_img`)&&(document.getElementById(`${e}_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 - "+e+", dataset - "+base_src)),document.getElementById(e+"_rpb").innerHTML=parseFloat(n[0]).toFixed(2),sraDict[e].rpb=parseFloat(n[0]).toFixed(2),document.getElementById(e+"_rpkm").innerHTML=t["absolute-fpkm"],updateRPKMAbsoluteMax(t["absolute-fpkm"]),sraDict[e].RPKM=t["absolute-fpkm"],rpkmCount++,document.getElementById(e+"_totalReadsNum").innerHTML="Total reads = "+t.totalReadsMapped,callDumpOutputs)if(dumpOutputs+='\t\telif (record == "'+t.record+'"):\n',"complex"==dumpMethod){for(dumpOutputs+='\t\t\tdumpJSON(200, "'+t.locus+'", '+t.variant+", "+t.chromosome+", "+t.start+", "+t.end+', "'+t.record+'", "'+t.tissue+'", "'+t.rnaseqbase64+'", '+t.reads_mapped_to_locus+", "+t["absolute-fpkm"]+", ["+t.r+"], "+t.totalReadsMapped+", ["+t.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()},error:function(t,e,n){generateToastNotification(`Error getting RNA-Seq map coverage for ${data.record} - ${n.message}`,"ERROR"),console.error("Error getting RNA-Seq map coverage!",t,e,n)}})}}}function findUnusedRecordDisplayName(t="unknown",e=sraList,n=0){if(Array.isArray(e)){let a=t+"_"+n;if(e.includes(a))findUnusedRecordDisplayName(t,e,n+1);else if(!e.includes(a))return a}else findUnusedRecordDisplayName(t,e=[])}function updateRPKMAbsoluteMax(t){let e=parseInt(document.getElementById("rpkm_scale_input").value);1e3===e&&(e=1);let n=parseInt(t);n>e&&(document.getElementById("rpkm_scale_input").value=n)}const svgAgainstData={"ath-10dayOldSeedling":{name:"10 Day Old Seedling",subunit:["all","root","shoot"]},"ath-15dayOldSeedling":{name:"15 Day Old Seedling",subunit:["all","root","shoot"]},"ath-etiolatedSeedling":{name:"Etiolated Seedling",subunit:["etiolatedseedling"]},"ath-Flower":{name:"Flower",subunit:["flower","receptacle"]},"ath-FlowerParts":{name:"Flower Parts",subunit:["all","petals","stamen","sepals","carpels"]},"ath-GerminatingSeed":{name:"Germinating Seed"},"ath-Internode":{name:"Internode"},"ath-leaf":{name:"Leaf",subunit:["leaf"]},"ath-LeafParts":{name:"Leaf Parts",subunit:["all","lamina","petiole","veins"]},"ath-Pollen":{name:"Pollen"},"ath-RootTip":{name:"Root Tip"},"ath-rosettePlusRoot":{name:"Rosette Plus Root",subunit:["all","shoot","root"]},"ath-Seed1-4":{name:"Seed 1-4"},"ath-Seed5-7":{name:"Seed 5-7"},"ath-Seed8+":{name:"Seed 8+"},"ath-SenescentLeaf":{name:"Senescent Leaf"},"ath-ShootApexInflorescense":{name:"Shoot Apex Inflorescense"},"ath-ShootApexVegetative-Transition":{name:"Shoot Apex Vegetative-Transition"},"ath-Silique1-5":{name:"Silique 1-5"},"ath-Silique6-10":{name:"Silique 6-10"},"ath-YoungLeaf1-4":{name:"Young Leaf 1-4"},"ath-EarlyBuddingFlower":{name:"Early Budding Flower",subunit:["all","shoot","buds"]},"ath-EarlyBuddingFlower":{name:"Early Budding Flower",subunit:["all","shoot","buds"]},"ath-FlowerBud":{name:"Flower Bud",subunit:["flowerBud"]},"ath-Stamen":{name:"Stamen",subunit:["all","anthers","filament"]},"ath-StigmaAndOvaries":{name:"Stigma And Ovaries",subunit:["all","Stigma_tissue","Ovary_tissue"]},"ath-WholeSilique":{name:"Whole Silique",subunit:["silique","all","seed"]},"ath-youngSeedling":{name:"Young Seedling",subunit:["all","root","hypocotyl","cotyledon"]},"ath-FlowerDevelopment1":{name:"Late Flower Development (1)",subunit:["flowerDevelopmentPart1"]},"ath-FlowerDevelopment2":{name:"Flower Development 2",subunit:["flowerDevelopmentPart2"]},"ath-FlowerDevelopment3":{name:"Flower Development 3",subunit:["flowerDevelopmentPart3"]},"ath-FlowerDevelopment4":{name:"Flower Development 4",subunit:["flowerDevelopmentPart4"]},"ath-FlowerDevelopment5":{name:"Flower Development 5",subunit:["flowerDevelopmentPart5"]},"ath-FlowerDevelopment6-8":{name:"Flower Development 6-8",subunit:["flowerDevelopmentPart6"]},"ath-FlowerDevelopment9-11":{name:"Flower Development 9-11",subunit:["flowerDevelopmentPart9"]},"ath-FlowerDevelopment12-14":{name:"Flower Development 12-14",subunit:["flowerDevelopmentPart12"]},"ath-FlowerDevelopment15-18":{name:"Flower Development 15-18",subunit:["flowerDevelopmentPart15"]},"ath-FlowerDevelopment19":{name:"Flower Development 19",subunit:["flowerDevelopmentPart19"]},"ath-Other":{name:"Other"}};function checkAgainstSVG(t,e,n=!1){let a=t.split(".")[0],o=n?svgAgainstData[a].name:e;return svgAgainstData[a]&&!n&&(svgAgainstData[a].subunit?svgAgainstData[a].subunit.includes(e)||(svgAgainstData[a].subunit_name?o=svgAgainstData[a].subunit_name:svgAgainstData[a].subunit[0]&&(o=svgAgainstData[a].subunit[0])):"all"!==e&&(o="all")),o}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(t){$("#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;let e='RNA-Seq mapped image',n='
    Title
    Sorting arrow
    RNA-Seq Coverage'+e+'
    rpb
    Default sort arrow
    eFP (RPKM)
    RPKM
    Default sort arrow
    Details
    Default sort arrow
    ';$("#theTable").append(n);let a='
    Title
    RNA-Seq Coverage'+e+'
    rpb
    eFP (RPKM)
    RPKM
    Details
    ';$("#compareTable").append(a),$.ajax({url:base_src,dataType:"xml",success:function(e){$(e).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,$(e).find("file").each((function(){let e=$(this).attr("record_number")||"unknown";if(sraList.includes(e)&&(e=findUnusedRecordDisplayName(e,sraList)),sraList.includes(e)){if(sraCountDic[e]){sraCountDic[e]+=1;let t=e+"("+sraCountDic[e]+")";sraList.push(t),sraDict[t]={}}}else sraCountDic[e]=1,sraList.push(e),sraDict[e]={};let n=$(this).attr("description");sraDict[e].title=n;let a=$(this).attr("info");sraDict[e].description=a;let o=$(this).attr("svgname");sraDict[e].svg=o;let s=$(this).attr("svg_subunit");s=checkAgainstSVG(o,s),sraDict[e].svg_part=s,tissueSRADic[checkAgainstSVG(o,s,!0)]?tissueSRADic[checkAgainstSVG(o,s,!0)].push(e):tissueSRADic[checkAgainstSVG(o,s,!0)]=[e];let l=$(this).attr("url");sraDict[e].url=l;let i=$(this).attr("publication_link");sraDict[e].publicationid=i;let r,d=$(this).attr("total_reads_mapped");null!=d&&""!=d||(d="0"),sraDict[e].numberofreads=d,r=null==$(this).attr("hex_colour")||""==$(this).attr("hex_colour")?"0x64cc65":$(this).attr("hex_colour"),sraDict[e].hexColourCode=r;let c=$(this).attr("filename");null!=c&&""!=c&&null!=c||(c="accepted_hits.bam"),sraDict[e].filenameIn=c;let u=$(this).attr("species");sraDict[e].species=u;let m=[];if(null==$(this).find("controls")[0].innerHTML)for(let t=1;t<$(this).find("controls")[0].childNodes.length;t+2)m.push($(this).find("controls")[0].childNodes[t].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[e].controls=m;let g="";if(m.length>0)for(let t=m.length;t--;)"MEDIAN"!=m[t]?g+=''+m[t]+" ":g+=m[t];sraDict[e].links=g;let p="";if(m.length>0)for(let t=0;t',v="\n\t\n";v+="\t\t\n",y+='\n",y+=`\n\t\t\t\t\t\n\n\t\t\t\t`,y+='",y+='\n",y+='',y+='\n",y+='',y+="",iteration_num++,$("#theTable").append(y);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([e+"_svg",s,m,0,0,0,0]),!0===loadNewDataset?(setTimeout((function(){count_bam_num()}),200),setTimeout((function(){rnaseq_images(t)}),10)):rnaseq_images(t)})),$.tablesorter.addParser({id:"rpb_sorter",is:function(t){return!1},format:function(t){return NaN==t?-99999:null==t?-999999:t==1/0?99999:t==-1/0?-99999:parseFloat(t)},type:"numeric"}),$.tablesorter.addParser({id:"rpkm_sorter",is:function(t){return!1},format:function(t){return NaN==t?-99999:null==t?-999999:t==1/0?99999:t==-1/0?-99999:"Missing controls data"==t?-9999999:parseFloat(t)},type:"numeric"}),$("#theTable").tablesorter({headers:{0:{},1:{sorter:!1},2:{sorter:"rpb_sorter"},3:{},4:{sorter:"rpkm_sorter"},5:{}}}),$("#theTable").trigger("update")},error:function(t,e,n){generateToastNotification(`Error getting data from data file: ${n.message}`,"ERROR"),console.log("Error getting data from data file: "+n.message)}});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);for(let o=0;o',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(t){if(null!=document.getElementById(t))if(document.getElementById(t).innerHTML==moreDetails){document.getElementById(t).setAttribute("hidden",!0);const e=document.getElementById(document.getElementById(t).name);e.textContent=e.getAttribute("name")}else if(document.getElementById(t).innerHTML==lessDetails){const e=t.substring(0,t.length-5);document.getElementById(e).removeAttribute("hidden");const n=document.getElementById(document.getElementById(t).name);n.textContent=truncateDescription(n.getAttribute("name"))}}function truncateDescription(t){if(null!=t||null!=t)return t.length>30?t.substring(0,30)+"...":t}let remainder_efp=0,efp_length=0,eFPSortedSRA=[],efp_RPKM_values=[];function populate_efp_modal(t){toggleResponsiveTable(2),$("#efpModalTable").empty(),efp_table_column="",eFPSortedSRA=[];const e=document.getElementsByClassName("colTitle");for(let n=2;n\n\t\t\t\tAGI-ID:\n\t\t\t\t\t\n\t\t\t\t\t\t${locus}\n\t\t\t\t\t\n\t\t\t

    \n\t\t`),"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(a)+"
    ","Amazon AWS"===f&&(y+=''),e.includes("unknown")&&!i||(y+='"),y+='"+moreDetails.trim()+"",y+='
    \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('
    ');for(let n=0;n<11*~~(eFPSortedSRA.length/11);n+=11)if("null"!=document.getElementById(eFPSortedSRA[n+10]).outerHTML){efp_table_column="";for(let t=0;t<11;t++)efp_table_column+=generateEFPTableItem(eFPSortedSRA[n+t],sraDict[eFPSortedSRA[n+t]].title);efp_table_column+="",$("#eFPtable").append(efp_table_column)}for(let n=0;n<12;n++)if(remainder_efp===n){efp_table_column="";for(let t=remainder_efp;t>0;t--)efp_table_column+=generateEFPTableItem(eFPSortedSRA[efp_length-t],sraDict[eFPSortedSRA[efp_length-t]].title);efp_table_column+="",$("#eFPtable").append(efp_table_column)}toggleResponsiveTable()}function generateEFPTableItem(t,e){return t&&e?`\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t${document.getElementById(t+"_svg").outerHTML}\n\t\t\t\t\t\n\t\t\t\t\t${t} - ${e}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t`:""}function change_rpkm_colour_scale(t){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"==t){const t=document.createElement("img");t.src="data:image/png;base64,"+relative_rpkm_scale,t.style="margin-top: 10px;",svg_colouring_element&&svg_colouring_element.appendChild(t)}else{const t=document.createElement("img");t.src="data:image/png;base64,"+absolute_rpkm_scale,t.style="margin-top: 10px;",t.alt="Absolute RPKM Scale",svg_colouring_element&&svg_colouring_element.appendChild(t)}const e=["colTitle","colRNA","colrpb","coleFP","colRPKM","colDetails"];let n=[];document.getElementsByClassName("fltrow")&&document.getElementsByClassName("fltrow")[0]&&(n=document.getElementsByClassName("fltrow")[0].getElementsByTagName("td"));for(let a=0;a=1&&t[2]<=5||"C"==t[2]||"M"==t[2]||"c"==t[2]||"m"==t[2])&&("G"==t[3]||"g"==t[3])&&t[4]>=0&&t[4]<=9&&t[5]>=0&&t[5]<=9&&t[6]>=0&&t[6]<=9&&t[7]>=0&&t[7]<=9&&t[8]>=0&&t[8]<=9?$("#locus_button").removeAttr("disabled"):$("#locus_button").prop("disabled",!0)}function yscale_validation(){const t=document.getElementById("yscale_input").value;parseInt(t)>0||"Auto"==t||""==t?$("#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 t=findAuthUser();""==users_email&&null==users_email&&null==users_email||users_email!==t?""!=users_email&&users_email!=t&&(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(t){xml_title=void 0,match_title={},title_list=[];let e=1,n=1;if(get_xml_list_output=t,"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 t=0;t\n\t\t\t\t\t\t\t\t\t\t${title_list[t]}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t`;list_modified=!0}),1e3)}databasesAdded=!0},error:function(t,e,n){generateToastNotification(`Error getting user data: ${n.message}`,"ERROR"),console.log(`Error getting user data: ${n.message}`)}})}let datalist=[],datalist_Title={};function create_data_list(t){if(datalist=[],datalist_Title={},t>0)for(let e=0;e{if(e.readyState===XMLHttpRequest.DONE&&200===e.status){let n=e.responseXML;if(n){let e=n.getElementsByTagName("files")[0].attributes.xmltitle.nodeValue;datalist_Title[e]=t[dlCallPosition],dlCallPosition+=1,DatalistXHRCall(t)}}},e.open("GET",n),e.send()}}function validateEmail(t){return/\S+@\S+\.\S+/.test(t)}function findAuthUser(){return global_user&&global_user.email?global_user.email:""}function check_if_Google_login(){const t=findAuthUser();users_email&&t&&users_email===t?!1===databasesAdded&&(document.getElementById("private_dataset_header").style.display="block",get_user_XML_display()):(signOut(),remove_private_database())}function add_user_xml_by_upload(){get_user_XML_display(),setTimeout((function(){const t=findAuthUser();user_exist?user_exist&&(dataset_dictionary[datasetName]?dataset_dictionary[datasetName]&&(users_email===t?(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!=t&&(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in"))):users_email===t?$.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!=t&&(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in"))):users_email===t?$.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!=t&&(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 t=findAuthUser();""!=users_email&&users_email===t?document.getElementById("upload_modal").click():""!=users_email&&users_email!=t?(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 e in public_dataset_dictionary)public_dataset_dictionary.hasOwnProperty(e)&&public_title_list.push(e);let t=0;total_amount_of_datasets=public_title_list.length+title_list.length;for(let e=0;e\n\t\t\t\t\t${public_title_list[e]}\n\t\t\t\t\n\t\t\t\t
    \n\t\t\t`),t+=1;for(let e=0;e\n\t\t\t\t\t${title_list[e]}\n\t\t\t\t\n\t\t\t\t
    \n\t\t\t`),t+=1}let isDeletePublicDisabled=!1;function disableDeletePublic(){for(let t=0;t\n\t\n",a+="\t\t"+e+"\n",a+=table_base,n.each((function(){a+="\t\t\n";const t=$(this).attr("description");a+="\t\t\t"+t+"\n";const e=$(this).attr("info");a+="\t\t\t"+e+"\n";const n=$(this).attr("record_number");a+="\t\t\t"+n+"\n";const o=$(this).attr("name");a+="\t\t\t"+o+"\n";const s=$(this).attr("bam_type");a+="\t\t\t"+s+"\n";let l=$(this).attr("filename");null!=l&&"undefined"!==l&&".bam"!==l||(l="accepted_hits.bam"),a+="\t\t\t"+l+"\n";const i=$(this).attr("publication_link");a+="\t\t\t"+i+"\n";const r=$(this).attr("url");a+="\t\t\t"+r+"\n";let d=$(this).attr("total_reads_mapped");null!=d&&""!=d||(d="0"),a+="\t\t\t"+d+"\n";const c=$(this).attr("read_map_method");a+="\t\t\t"+c+"\n";let u=$(this).attr("species");null!=u&&""!=u||(u="Arabidopsis thaliana"),a+="\t\t\t"+u+"\n";const m=$(this).attr("svgname");a+="\t\t\t"+m+"\n";const g=$(this).attr("svg_subunit");a+="\t\t\t"+g+"\n";let p="";if($(this).find("controls")[0].innerHTML)for(let a=1;a<$(this).find("controls")[0].childNodes.length;a+=2)$(this).find("controls")[0].childNodes[a].firstChild&&(p+=$(this).find("controls")[0].childNodes[a].firstChild.textContent,a<$(this).find("controls")[0].childNodes.length-2&&(p+=", "));a+="\t\t\t"+p+"\n";let _="";if($(this).find("groupwith")[0].innerHTML)for(let a=1;a<$(this).find("groupwith")[0].childNodes.length;a+=2)$(this).find("groupwith")[0].childNodes[a].firstChild&&(_+=$(this).find("groupwith")[0].childNodes[a].firstChild.textContent,a<$(this).find("groupwith")[0].childNodes.length-2&&(_+=", "));a+="\t\t\t"+_+"\n",a+="\t\t\n"})),a+="\t\n",document.getElementById("XMLtoCSVtable").innerHTML+=a},error:function(t,e,n){generateToastNotification(`Error filling data table: ${n.message}`,"ERROR"),console.log(`Error filling data table: ${n.message}`)}})}}function download_XMLtableCSV(){for(let t=0;t\n",t+=downloadIndexTable_base;for(const e of eFPSortedSRA)t+="\t\t\n",t+="\t\t\t"+sraDict[e].title+"\n",t+="\t\t\t"+e+"\n",t+="\t\t\t"+sraDict[e].svg.substr(4,sraDict[e].svg.length-8)+"\n",t+="\t\t\t"+sraDict[e].svg_part+"\n",t+="\t\t\t"+sraDict[e].locusValue+"\n",t+="\t\t\t"+String(sraDict[e].bp_length)+"\n",t+="\t\t\t"+String(sraDict[e].bp_start)+"\n",t+="\t\t\t"+String(sraDict[e].bp_end)+"\n",t+="\t\t\t"+sraDict[e].numberofreads+"\n",t+="\t\t\t"+String(sraDict[e].MappedReads)+"\n",t+="\t\t\t"+sraDict[e].rpb+"\n",t+="\t\t\t"+String(sraDict[e].RPKM[variantPosition].toFixed(2))+"\n",t+="\t\t\t"+String(sraDict[e].controlsString)+"\n",t+="\t\t\n";t+="\t\n",document.getElementById("hiddenDownloadModal_table").innerHTML+=t,$("#hiddenDownloadModal_table").tableToCSV(),document.getElementById("download_icon").classList.remove("progressLoading"),document.getElementById("bodyContainer").classList.remove("progressLoading")}let publicData=!0;function changePublicData(t=!1){publicData=!t&&!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 t in public_dataset_dictionary){if(base_src===public_dataset_dictionary[t]){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(t){if("string"==typeof t){const e=new RegExp("^[A][T][MC0-9][G][0-9]{5}[.][0-9]{1,2}$|^[A][T][MC0-9][G][0-9]{5}$","i");return t.trim().match(e)}return!1}let parse_output,GFF_List=[];function getGFF(t){GFF_List=[],$.ajax({url:`https://bar.utoronto.ca/webservices/bar_araport/gene_structure_by_locus.php?locus=${t}`,dataType:"json",crossDomain:!0,headers:{"Access-Control-Allow-Origin":"*"},failure:function(){console.log("Getting GFFs (getGFF) information failed to retrieve locus information from Araport11")},success:function(t){if(parse_output=t,parse_output.wasSuccessful){let t=parse_output.features[0].subfeatures;for(let e=0;e0)for(let t=0;t0){const t=document.getElementById("locus").value.trim().split("/");t[0]?document.getElementById("locus").value=t[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(t){html2canvas(document.getElementById(t)).then((t=>{$("#appendCanvas").empty(),t.id="downloadDivNum_"+downloadDivNum,document.getElementById("appendCanvas").appendChild(t),document.getElementById("downloadDivNum_"+downloadDivNum).style.width="100%",$("#DownloadImageModal").modal("toggle"),downloadDivNum++}))}function displayNavBAR(t=!1){const e=$("#navbar_menu").is(":visible")||t;document.getElementById("navbar_menu").style.display=e?"none":"block",document.getElementById("main_content").className=e?"col-sm-12":"col-sm-9",document.getElementById("openMenu").style.display=e?"block":"none",document.getElementById("theTable")&&(e?document.getElementById("theTable").classList.add("RNATable"):document.getElementById("theTable").classList.remove("RNATable"))}function adjustFooterSize(){const t=document.getElementById("navbar_menu");t&&(document.getElementById("nm_footer").style.width=t.offsetWidth+"px",t.scrollHeight==t.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")):t.scrollHeight>t.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 t=.7*window.innerHeight;document.getElementById("submissioniframe").height=t+"px"}let usedToggle=!1;function toggleTableCol(t,e){const n=document.getElementsByClassName(t);if(e)for(const a of n)a&&a.removeAttribute("hidden");else if(!e)for(const a of n)a&&a.setAttribute("hidden",!0)}let responsiveRNAWidthAdjusted=!1;function responsiveRNAWidthResize(){const t=document.getElementsByClassName("responsiveRNAWidth");if(window.innerWidth<=575){for(let e=0;e575&&responsiveRNAWidthAdjusted)for(let e=0;e=1100&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!0,!0,!0,!0,!1):3==t||window.innerWidth<830&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!1,!1,!1,!1,!1):4==t||window.innerWidth<900&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!0,!1,!1,!1,!1):5==t||window.innerWidth<990&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!0,!1,!0,!1,!1):(6==t||window.innerWidth<1100&&!usedToggle)&&toggleResponsiveTableOptions(!0,!0,!0,!0,!0,!1,!1))}let ToggledTable=[!0,!0,!0,!0,!0,!0,!1];function RememberToggleOptions(t=!0,e=!0,n=!0,a=!0,o=!0,s=!0,l=!1){ToggledTable=[t,e,n,a,o,s,l]}const colSortList=["colTitle","colrpb","colRPKM","colDetails"];function ResizeArrowRow(){for(const t of colSortList){const e=t+"Row";document.getElementById(e).style.width=document.getElementById(e).parentNode.offsetWidth-2+"px";CheckElementWidth(t+"Arrow",8)}}function CheckElementWidth(t,e){document.getElementById(t).offsetWidth{-1!==navigator.userAgent.indexOf(t)&&o++})),o!=e){n=element,a=!1;break}}}if(n){$("#notChrome").empty();const t=' or through the following Google search results';$("#notChrome").append(t)}BrowserDetected=!0}}function CreateFilteredeFPList(){if($("#filtereFPList").empty(),tissueSRADic){const t=Object.keys(tissueSRADic);for(const e of t){let t='
  • ';t+='',t+='

    '+e+"

    ",t+="
  • ",$("#filtereFPList").append(t)}}else logError("Unable to use tissueSRADic")}function ToggleFilteredeFP(t,e){const n=t.replace("_"," "),a=tissueSRADic[n];if(!0===e)for(let o=0;o1)if("locus"===a[0].split("%20").join(" ").trim()){const n=t.substring(6).split("%20").join(" ").trim();shareLinkInputs.locus=n,document.getElementById("locus").value=n,e=!0}else if("dataset"===a[0].split("%20").join(" ").trim()){const e=t.substring(8).split("%20").join(" ").trim();shareLinkInputs.dataset=e,base_src=e,n=!0}}e&&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(e&&!1===n?"ERROR IN SHARE LINK! Missing dataset":!1===e&&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(t,e=!1){const n=t.split("_")[0];if(e)disableAllComparison();else if(!1===e&&document.getElementById(t)&&document.getElementById(t).checked){allCheckedOptions.push(n);const e={};for(let t=0;t';parseInt(t)===parseInt(variantPosition)?a+=''+document.getElementById(n+"_title").innerHTML+" ... ("+GFF_List[t]+")\n":a+='^^^ ... ('+GFF_List[t]+")\n",a+='RNA-Seq mapped image for:'+n+'
    Gene variant image for:'+n+'\n',a+=''+sraDict[n].r[t].toFixed(2)+"",a+='
    '+document.getElementById(sraDict[n].svg.substr(4).replace(".svg","_svg")).innerHTML+'
    '+sraDict[n].svg.substring(4).replace(".svg","")+"
    \n",a+=''+sraDict[n].RPKM[t].toFixed(2)+"",parseInt(t)===parseInt(variantPosition)?a+='
    '+document.getElementById(n+"_description").innerHTML+'
    '+document.getElementById("igbLink_"+n).innerHTML+'
    '+document.getElementById("extraLinks_"+n).innerHTML+"
    \n":a+='^^^\n',a+="",e[t]=n+"_compareRow"+t,document.getElementById("compareTable").innerHTML+=a,document.getElementById(n+"_rnaseq_img"+t)&&document.getElementById(n+"_rnaseq_img"+t).setAttribute("src",document.getElementById(n+"_rnaseq_img").src),document.getElementById(n+"_gene_structure_img"+t)&&document.getElementById(n+"_gene_structure_img"+t).setAttribute("src",document.getElementsByClassName("dd-option-image")[t].src),sraDict[n].RPKM&&sraDict[n].RPKM[t]&&colour_part_by_id(n+"_svg"+t,sraDict[n].svg_part,sraDict[n].RPKM[t],colouring_mode)}document.getElementById(t).checked=!0,document.getElementById("allCheckbox").checked=!0,"rel"!=colouring_mode&&(document.getElementById("compareGeneVariants").disabled=!1)}else!1===e?(disableCompare(n),allCheckedOptions.splice(allCheckedOptions.indexOf(n),1),document.getElementById(t).checked=!1):!0===e&&disableAllComparison(),0===allCheckedOptions.length&&(document.getElementById("compareGeneVariants").disabled=!0)}function disableCompare(t){for(let e=0;e=0;a--)document.getElementsByClassName("compareDataRow")[a].remove();allCheckedOptions=[],t=document.getElementsByClassName("compareCheckbox");for(let a=0;a\n\t\t\t
    \n\t\t\t\t\n\t\t\t\t${e}\n\t\t\t\t\n\t\t\t
    \n\t\t\t
    ${t}
    \n\t\t\n\t\t`;document.getElementById("toast-container").innerHTML+=a,$(`[data-toast="${n}"]`).toast({autohide:!1}),$(`[data-toast="${n}"]`).toast("show")}}function init(){document.getElementById("locus").value="AT2G24270",document.getElementById("xmlDatabase").value="Araport 11 RNA-seq data",locus_validation(),old_locus=locus,yscale_validation(),rpkm_validation(),adjustFooterSize(),displayVersionNumber(),adjustTableOptionsDropdownSize(),setUpCookies(),$("input[type=radio][name=radio_group]").change((function(){gene_structure_radio_on_change()})),$("#locus").keyup((function(){locus_validation()})),$("#yscale_input").keyup((function(){yscale_validation()})),$("#rpkm_scale_input").keyup((function(){rpkm_validation()})),document.getElementsByClassName("abcRioButtonLightBlue").length>0&&hiddenGoogleSignin(),getGFF(locus),$("#locus").autocomplete({source:function(t,e){const n=t.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(t){t&&t.length>=7?e(t.slice(0,7)):e(t)}))},close:function(t,e){correctAGIIDInput()}});const t=document.getElementById("submissioniframe");t&&t.setAttribute("src",t.getAttribute("data-src")),adjustSubmissionIFrameSize(),readShareLink();document&&"bar.utoronto.ca"===document.location.host&&document.location.href&&document.querySelector('link[rel="canonical"]')&&document.querySelector('link[rel="canonical"]').setAttribute("href",document.location.href)}$(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.json b/package.json index e7adee2..2f69dd6 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "url": "https://bar.utoronto.ca/" } ], - "version": "1.3.14", + "version": "1.3.15", "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.", "devDependencies": {