diff --git a/CHANGELOG.md b/CHANGELOG.md index 8180015..795780e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,38 @@ 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.4.0] - 2024-08-08 + +New feature: + +- You can now run the eFP-Seq Browser locally on your machine (internet connection still required)\ + +UI/UX: + +- Added version number to citations +- Minor optimizations to improve readability + +Optimizations: + +- Refactored and optimized code + +Security: + +- Adjustments made to the Google Identity services for FedCM + +Update: + +- Update packages +- Update service workers + +Bug fix: + +- Fixed duplicate element IDs in generate data dialog +- Fixed generate data submit loading default data +- Fixed missing tissue input not highlighting correctly +- Fixed not being able to generate custom data under certain conditions +- Fixed styling issues + ## [1.3.15] - 2024-01-15 UI/UX: diff --git a/cgi-bin/core/custom.js b/cgi-bin/core/custom.js index 6b6daa9..71fdfd4 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.15-p20240710"; +const version = "v1.4.0-p20240808"; // The following variables are purely meant for local development and testing purposes /** If the current environment is a developer environment */ diff --git a/cgi-bin/core/custom.min.js b/cgi-bin/core/custom.min.js index d9c5f78..140cfc3 100644 --- a/cgi-bin/core/custom.min.js +++ b/cgi-bin/core/custom.min.js @@ -1 +1 @@ -const version="v1.3.15-p20240710",isDevEnv=window.location.href.includes("localhost:3030"),BE_URL=isDevEnv?"http://localhost:3040":".";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="";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 dataset_dictionary=base_dataset_dictionary,loadNewDataset=!1,count_bam_entries_in_xml=113;function count_bam_num(){const xhr=new XMLHttpRequest,url=base_src;xhr.responseType="document",xhr.onreadystatechange=()=>{if(xhr.readyState===XMLHttpRequest.DONE&&200===xhr.status){const response=xhr.responseXML;response&&response.getElementsByTagName("file")?count_bam_entries_in_xml=xhr.responseXML.getElementsByTagName("file").length:null==response&&console.log("failed at response"),document.getElementById("testing_count").innerHTML=count_bam_entries_in_xml}},xhr.open("GET",url),xhr.send()}function loadingScreen(terminate=!0){if(!1===terminate){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 toDisableList=document.getElementsByClassName("disableOnLoading");for(const element of toDisableList)$("#"+element.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 toDisableList=document.getElementsByClassName("disableOnLoading");for(const element of toDisableList)$("#"+element.id).prop("disabled",!1);addGFF(),uploadingData=!1}}count_bam_num();const img_loading_base64="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAAAyCAYAAADP/dvoAAAABmJLR0QAwADAAMAanQd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wDDl58mT6eGZmhuvXr/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,iVBORw0KGgoAAAANSUhEUgAAAcIAAAAICAIAAADlfmh0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAMBSURBVGhD7Vi7ceswEGQrVBUMxC40wwKYKVANDpwpVuIqVIx6ealxHxzuA9BPsmfMGQOzgQgs7hZH3RrW8O/20dHR0dHxMrqN7gbneZAxLg/3GAlh13R6r8QhmgYQDtc3/Py2TMOwni2hCtg13/UM7M1x/gh06b6JHwxV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/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(start_color,end_color,percent){start_color=start_color.replace(/^\s*#|\s*$/g,""),end_color=end_color.replace(/^\s*#|\s*$/g,""),3==start_color.length&&(start_color=start_color.replace(/(.)/g,"$1$1")),3==end_color.length&&(end_color=end_color.replace(/(.)/g,"$1$1"));let start_red=parseInt(start_color.substr(0,2),16),start_green=parseInt(start_color.substr(2,2),16),start_blue=parseInt(start_color.substr(4,2),16),diff_red=parseInt(end_color.substr(0,2),16)-start_red,diff_green=parseInt(end_color.substr(2,2),16)-start_green,diff_blue=parseInt(end_color.substr(4,2),16)-start_blue;return diff_red=(diff_red*percent+start_red).toString(16).split(".")[0],diff_green=(diff_green*percent+start_green).toString(16).split(".")[0],diff_blue=(diff_blue*percent+start_blue).toString(16).split(".")[0],1==diff_red.length&&(diff_red="0"+diff_red),1==diff_green.length&&(diff_green="0"+diff_green),1==diff_blue.length&&(diff_blue="0"+diff_blue),"#"+diff_red+diff_green+diff_blue}function round(x,digits){return parseFloat(x.toFixed(digits))}let colouring_part;function colour_part_by_id(id,part,fpkm,mode){colouring_part="all";for(const sra of sraList)id.replace("_svg","")==sra&&(colouring_part=sraDict[sra].svg_part);let paths1,paths2,fpkmUse=fpkm;fpkmUse=Array.isArray(fpkmUse)?fpkmUse[variantPosition]:parseFloat(fpkmUse),max_abs_scale=document.getElementById("rpkm_scale_input").value,(!max_abs_scale||max_abs_scale<=0)&&(max_abs_scale=1e3),document.getElementById(id)&&(paths1=document.getElementById(id).getElementsByTagName("path"),paths2=document.getElementById(id).getElementsByTagName("g"));let paths=null;if(paths1&&paths2&&(paths=Array.prototype.slice.call(paths1).concat(Array.prototype.slice.call(paths2))),null!=paths){if("abs"==mode){const r=255,g=255-parseInt(fpkmUse/max_abs_scale*255),b=0;if("all"==colouring_part)for(const path of paths)path.style.fill="rgb("+r+", "+g+", "+b+")";else for(const path of paths)if(path.id==colouring_part)if("g"==path.tagName){const child_paths=path.getElementsByTagName("path");for(const child of child_paths)child.style.fill="rgb("+r+", "+g+", "+b+")"}else path.style.fill="rgb("+r+", "+g+", "+b+")"}else if("rel"==mode){let hex="";const log_scale_max=3;let log_scaling=0;if("Missing controls data"!=fpkmUse&&Math.abs(fpkmUse)>log_scale_max?log_scaling=log_scale_max:"Missing controls data"!=fpkmUse&&(log_scaling=Math.abs(fpkmUse)),log_scaling/=log_scale_max,"Missing controls data"==fpkmUse?hex="#D9D9D9":fpkmUse>0?hex=generate_colour("FFFF00","FF0000",log_scaling):0==fpkmUse?hex="FFFF00":fpkmUse<0&&(hex=generate_colour("FFFF00","0000FF",log_scaling)),"all"==colouring_part)for(const path of paths)path.style.fill=hex;else for(const path of paths)if(path.id==colouring_part)if("g"==path.tagName){const child_paths=path.getElementsByTagName("path");for(const child of child_paths)child.style.fill=hex}else path.style.fill=hex}document.getElementById(id.replace("_svg","_rpkm")).innerHTML="Missing controls data"==fpkmUse?fpkmUse:round(fpkmUse,2)}else console.log("Paths is null for id = "+id)}let rpkmAverage=1,rpkmMedian=1;function findRPKMValuesAcrossAll(){if(sraDict){const listOfSRA=Object.keys(sraDict),listOfRPKM=[];let rpkmTotal=0;for(const sra of listOfSRA)if(sraDict[sra].RPKM){const currentRPKM=sraDict[sra].RPKM[variantPosition];parseFloat(currentRPKM)&&(listOfRPKM.push(currentRPKM),rpkmTotal+=currentRPKM)}listOfRPKM.length>0&&(rpkmMedian=math.median(listOfRPKM)),rpkmAverage=rpkmTotal/listOfSRA.length}else displayError("ERROR IN RETRIEVING ALL DATA POINTS WITHIN DATASET")}function switchRPKMMode(selectedMode){let rel=!1;"rel_radio"===selectedMode&&(rel=!0),rel?(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 mode=colouring_mode;for(let i=0;i0?ctrl_avg_fpkm=ctrl_fpkm_sum/ctrl_count:(rpkmMedian&&1===rpkmMedian&&findRPKMValuesAcrossAll(),ctrl_avg_fpkm=rpkmMedian);let relativeRPKMValue=0;const relativeRPKM=[];let useRPKM="";useRPKM=sraDict[currentSRA].RPKM&&sraDict[currentSRA].RPKM[variantPosition]?sraDict[currentSRA].RPKM[variantPosition]:0,0==useRPKM&&0==ctrl_avg_fpkm?exp_info[i].splice(4,1,0):relativeRPKMValue=Math.log2(useRPKM/ctrl_avg_fpkm),relativeRPKM.push(relativeRPKMValue),sraDict[currentSRA].relativeRPKM=relativeRPKMValue,exp_info[i].splice(4,1,relativeRPKM),exp_info[i].splice(6,1,ctrl_avg_fpkm),useRPKM>=max_absolute_fpkm&&(max_absolute_fpkm=useRPKM),"Missing controls data"!=exp_info[i][4]&&Math.abs(exp_info[i][4])>=max_log_fpkm&&Math.abs(exp_info[i][4])<1e3&&(max_log_fpkm=Math.abs(exp_info[i][4])),"rel"===colouring_mode?exp_info[i][4]||0==exp_info[i][4]||(exp_info[i][4]=-999999):exp_info[i][3][variantPosition]||0==exp_info[i][3][variantPosition]||(exp_info[i][3][variantPosition]=-999999)}else logError("Issue retrieving exp_info for "+mode+" within BAM entry point "+i);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(status){null!=document.getElementById("locus")&&(new_locus=document.getElementById("locus").value,new_locus===old_locus?($.xhrPool.abortAll(),variants_radio_options(status)):new_locus!=old_locus&&(getGFF(new_locus),old_locus=new_locus,setTimeout((function(){$.xhrPool.abortAll(),variants_radio_options(status)}),1650)))}async function variants_radio_options(status){get_input_values(),fetch(`${BE_URL}/cgi-bin/get_gene_structures.cgi?locus=${locus}`).then((async response=>{const gene_res=await response.json();locus_start=gene_res.locus_start,locus_end=gene_res.locus_end,splice_variants=JSON.stringify(gene_res.splice_variants),populate_table(status),populate_efp_modal(status);const variants_div=document.getElementById("variants_div");if(variants_div?.firstChild)for(;variants_div.firstChild;)variants_div.removeChild(variants_div.firstChild);$("#variant_select").ddslick("destroy");let append_str='",$("#variants_div").append(append_str),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")})).catch((error=>{displayError("ERROR processing and getting gene structures!"),generateToastNotification(`Error processing gene structures: ${error.message}`,"ERROR"),console.error(`Error processing gene structures: ${error.message}`)}))}function displayError(errorMessage){$("#displayError").empty();let append_str='

'+errorMessage+"

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

";console.error("Error in logic:",errorMessage),$("#displayError").append(append_str),$("#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(errorMessage){console.error("Error in logic:",errorMessage)}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 variant_img=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 all_gene_structure_imgs=document.getElementsByClassName("gene_structure_img");for(let i=0;i0)for(let i=0;i0&&(document.getElementById("compareGeneVariants").disabled=!1),expInfo[3]||0==expInfo[3]||(expInfo[3]=-999999);let useRPKM="";if(variant_selected&&sraDict[currentSRA].RPKM&&sraDict[currentSRA].RPKM[variant_selected]){let rpkmValue=sraDict[currentSRA].RPKM[variant_selected].toFixed(2);document.getElementById(expInfo[0].split("_svg")[0]+"_rpkm").innerHTML=rpkmValue,useRPKM=rpkmValue}else{let rpkmValue=0;document.getElementById(expInfo[0].split("_svg")[0]+"_rpkm").innerHTML=rpkmValue,useRPKM=rpkmValue}colour_part_by_id(currentSRA+"_svg",sraDict[currentSRA].svg_part,useRPKM,colouring_mode)}}function parseIntArray(arr){for(let i=0,len=arr.length;i1?driveLinkSplit[1]:linkString}else if("Amazon AWS"===sraDict[sraList[i]].bam_type){let linkString=sraDict[sraList[i]].drive_link,driveLinkSplit=linkString.split("amazonaws.com/");1===driveLinkSplit.length&&(driveLinkSplit=linkString.split("araport.cyverse-cdn.tacc.cloud/")),match_drive=driveLinkSplit.length>1?driveLinkSplit[1]:linkString}data={status:status,numberofreads:sraDict[sraList[i]].numberofreads,hexcodecolour:sraDict[sraList[i]].hexColourCode,remoteDrive:match_drive,bamType:sraDict[sraList[i]].bam_type,filename:sraDict[sraList[i]].filenameIn,tissue:tissueWebservice,record:sraRecordNumber,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(response_rnaseq){let stopLoadingScreen=99;count_bam_entries_in_xml>0&&(stopLoadingScreen=parseInt((count_bam_entries_in_xml-1)/count_bam_entries_in_xml*100)),rnaseq_success++;let date_obj3=new Date;if(rnaseq_success_current_time=date_obj3.getTime(),progress_percent=rnaseq_change/count_bam_entries_in_xml*100,$("div#progress").width(progress_percent+"%"),progress_percent>stopLoadingScreen&&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}`,response_rnaseq.status&&"success"===response_rnaseq.status&&response_rnaseq.record){let responseRecord=response_rnaseq.record||"unknown";if(listOfRecordsDisplayed.includes(responseRecord)?(responseRecord=findUnusedRecordDisplayName(responseRecord,listOfRecordsDisplayed),listOfRecordsDisplayed.push(responseRecord)):listOfRecordsDisplayed.push(responseRecord),listOfRecordsDisplayed=[],sraDict[responseRecord].bp_length=parseFloat(response_rnaseq.end)-parseFloat(response_rnaseq.start),sraDict[responseRecord].bp_start=parseFloat(response_rnaseq.start),sraDict[responseRecord].bp_end=parseFloat(response_rnaseq.end),sraDict[responseRecord].MappedReads=response_rnaseq.reads_mapped_to_locus,totalreadsMapped_dic[responseRecord]=response_rnaseq.totalReadsMapped,sraDict[responseRecord].locusValue=response_rnaseq.locus,sraDict[responseRecord].r=response_rnaseq.r,sraDict[responseRecord].dataVisualization=response_rnaseq.rnaseqbase64,locus!=response_rnaseq.locus)throw new Error(`ERROR: ${locus}'s RNA-Seq API request returned with data for some other locus.`);let r=[];if(response_rnaseq.ss_y&&response_rnaseq.sum_y&&response_rnaseq.sum_xy&&response_rnaseq.sum_x&&response_rnaseq.ss_x&&response_rnaseq.end&&response_rnaseq.start){parseInt(response_rnaseq.ss_y);let sum_y=parseInt(response_rnaseq.sum_y),ssy=parseInt(response_rnaseq.ss_y),sum_xy=parseIntArray(response_rnaseq.sum_xy.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),sum_x=parseIntArray(response_rnaseq.sum_x.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),ssx=(parseIntArray(response_rnaseq.sum_xx.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),parseIntArray(response_rnaseq.ss_x.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),parseIntArray(response_rnaseq.ss_x.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(","))),n=parseInt(response_rnaseq.end)-parseInt(response_rnaseq.start),sp=[];for(let i=0;i=3?(document.getElementById(responseRecord+"_rnaseq_img").src="data:image/png;base64,"+response_rnaseq.rnaseqbase64,rnaseq_change+=1):(document.getElementById(responseRecord+"_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 - "+responseRecord+", dataset - "+base_src)):(document.getElementById(`${responseRecord}_rnaseq_img`)&&(document.getElementById(`${responseRecord}_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 - "+responseRecord+", dataset - "+base_src)),document.getElementById(responseRecord+"_rpb").innerHTML=parseFloat(r[0]).toFixed(2),sraDict[responseRecord].rpb=parseFloat(r[0]).toFixed(2),document.getElementById(responseRecord+"_rpkm").innerHTML=response_rnaseq["absolute-fpkm"],updateRPKMAbsoluteMax(response_rnaseq["absolute-fpkm"]),sraDict[responseRecord].RPKM=response_rnaseq["absolute-fpkm"],rpkmCount++,document.getElementById(responseRecord+"_totalReadsNum").innerHTML="Total reads = "+response_rnaseq.totalReadsMapped,callDumpOutputs)if(dumpOutputs+='\t\telif (record == "'+response_rnaseq.record+'"):\n',"complex"==dumpMethod){for(dumpOutputs+='\t\t\tdumpJSON(200, "'+response_rnaseq.locus+'", '+response_rnaseq.variant+", "+response_rnaseq.chromosome+", "+response_rnaseq.start+", "+response_rnaseq.end+', "'+response_rnaseq.record+'", "'+response_rnaseq.tissue+'", "'+response_rnaseq.rnaseqbase64+'", '+response_rnaseq.reads_mapped_to_locus+", "+response_rnaseq["absolute-fpkm"]+", ["+response_rnaseq.r+"], "+response_rnaseq.totalReadsMapped+", ["+response_rnaseq.exp_arr+"], [",r=0;rLoad 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(xhr,status,error){generateToastNotification(`Error getting RNA-Seq map coverage for ${data.record} - ${error.message}`,"ERROR"),console.error("Error getting RNA-Seq map coverage!",xhr,status,error)}})}}}function findUnusedRecordDisplayName(recordID="unknown",listCheckAgainst=sraList,it=0){if(Array.isArray(listCheckAgainst)){let newName=recordID+"_"+it;if(listCheckAgainst.includes(newName))findUnusedRecordDisplayName(recordID,listCheckAgainst,it+1);else if(!listCheckAgainst.includes(newName))return newName}else findUnusedRecordDisplayName(recordID,listCheckAgainst=[])}function updateRPKMAbsoluteMax(RPKMCheckAgainst){let currentRPKMAbsMax=parseInt(document.getElementById("rpkm_scale_input").value);1e3===currentRPKMAbsMax&&(currentRPKMAbsMax=1);let newRPKMValue=parseInt(RPKMCheckAgainst);newRPKMValue>currentRPKMAbsMax&&(document.getElementById("rpkm_scale_input").value=newRPKMValue)}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(svg,subunit,returnName=!1){let svgName=svg.split(".")[0],toReturn=returnName?svgAgainstData[svgName].name:subunit;return svgAgainstData[svgName]&&!returnName&&(svgAgainstData[svgName].subunit?svgAgainstData[svgName].subunit.includes(subunit)||(svgAgainstData[svgName].subunit_name?toReturn=svgAgainstData[svgName].subunit_name:svgAgainstData[svgName].subunit[0]&&(toReturn=svgAgainstData[svgName].subunit[0])):"all"!==subunit&&(toReturn="all")),toReturn}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(status){$("#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 img_created='RNA-Seq mapped image',tableHeader='
Title
Sorting arrow
RNA-Seq Coverage'+img_created+'
rpb
Default sort arrow
eFP (RPKM)
RPKM
Default sort arrow
Details
Default sort arrow
';$("#theTable").append(tableHeader);let compareHeader='
Title
RNA-Seq Coverage'+img_created+'
rpb
eFP (RPKM)
RPKM
Details
';$("#compareTable").append(compareHeader),$.ajax({url:base_src,dataType:"xml",success:function(xml_res){$(xml_res).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,$(xml_res).find("file").each((function(){let experimentno=$(this).attr("record_number")||"unknown";if(sraList.includes(experimentno)&&(experimentno=findUnusedRecordDisplayName(experimentno,sraList)),sraList.includes(experimentno)){if(sraCountDic[experimentno]){sraCountDic[experimentno]+=1;let tempExperimentNo=experimentno+"("+sraCountDic[experimentno]+")";sraList.push(tempExperimentNo),sraDict[tempExperimentNo]={}}}else sraCountDic[experimentno]=1,sraList.push(experimentno),sraDict[experimentno]={};let title=$(this).attr("description");sraDict[experimentno].title=title;let description=$(this).attr("info");sraDict[experimentno].description=description;let svg=$(this).attr("svgname");sraDict[experimentno].svg=svg;let svg_part=$(this).attr("svg_subunit");svg_part=checkAgainstSVG(svg,svg_part),sraDict[experimentno].svg_part=svg_part,tissueSRADic[checkAgainstSVG(svg,svg_part,!0)]?tissueSRADic[checkAgainstSVG(svg,svg_part,!0)].push(experimentno):tissueSRADic[checkAgainstSVG(svg,svg_part,!0)]=[experimentno];let url=$(this).attr("url");sraDict[experimentno].url=url;let publicationid=$(this).attr("publication_link");sraDict[experimentno].publicationid=publicationid;let hexColourCode,numberofreads=$(this).attr("total_reads_mapped");null!=numberofreads&&""!=numberofreads||(numberofreads="0"),sraDict[experimentno].numberofreads=numberofreads,hexColourCode=null==$(this).attr("hex_colour")||""==$(this).attr("hex_colour")?"0x64cc65":$(this).attr("hex_colour"),sraDict[experimentno].hexColourCode=hexColourCode;let filenameIn=$(this).attr("filename");null!=filenameIn&&""!=filenameIn&&null!=filenameIn||(filenameIn="accepted_hits.bam"),sraDict[experimentno].filenameIn=filenameIn;let species=$(this).attr("species");sraDict[experimentno].species=species;let controls=[];if(null==$(this).find("controls")[0].innerHTML)for(let i=1;i<$(this).find("controls")[0].childNodes.length;i+2)controls.push($(this).find("controls")[0].childNodes[i].firstChild.textContent);else null!=$(this).find("controls")[0].innerHTML&&(controls=$(this).find("controls")[0].innerHTML.replace(//g,"").replace(/<\/bam_exp>/g,",").replace(/\n/g," ").replace(/ /g,"").split(","));sraDict[experimentno].controls=controls;let links="";if(controls.length>0)for(let i=controls.length;i--;)"MEDIAN"!=controls[i]?links+=''+controls[i]+" ":links+=controls[i];sraDict[experimentno].links=links;let controlsString="";if(controls.length>0)for(let y=0;y',table_dl_str="\n\t\n";table_dl_str+="\t\t\n",append_str+='\n",append_str+=`\n\t\t\t\t\t\n\n\t\t\t\t`,append_str+='",append_str+='\n",append_str+='',append_str+='\n",append_str+='',append_str+="",iteration_num++,$("#theTable").append(append_str);let compareColumn=document.getElementsByClassName("fltrow")[0].childNodes[6];(compareColumn&&void 0===compareColumn.classList[0]||"undefined"===compareColumn.classList[0])&&(compareColumn.classList=["colCompare"],compareColumn.innerHTML=''),exp_info.push([experimentno+"_svg",svg_part,controls,0,0,0,0]),!0===loadNewDataset?(setTimeout((function(){count_bam_num()}),200),setTimeout((function(){rnaseq_images(status)}),10)):rnaseq_images(status)})),$.tablesorter.addParser({id:"rpb_sorter",is:function(s){return!1},format:function(s){return NaN==s?-99999:null==s?-999999:s==1/0?99999:s==-1/0?-99999:parseFloat(s)},type:"numeric"}),$.tablesorter.addParser({id:"rpkm_sorter",is:function(s){return!1},format:function(s){return NaN==s?-99999:null==s?-999999:s==1/0?99999:s==-1/0?-99999:"Missing controls data"==s?-9999999:parseFloat(s)},type:"numeric"}),$("#theTable").tablesorter({headers:{0:{},1:{sorter:!1},2:{sorter:"rpb_sorter"},3:{},4:{sorter:"rpkm_sorter"},5:{}}}),$("#theTable").trigger("update")},error:function(xhr,status,error){generateToastNotification(`Error getting data from data file: ${error.message}`,"ERROR"),console.log("Error getting data from data file: "+error.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 j=0;j',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(details_id){if(null!=document.getElementById(details_id))if(document.getElementById(details_id).innerHTML==moreDetails){document.getElementById(details_id).setAttribute("hidden",!0);const innerDescription=document.getElementById(document.getElementById(details_id).name);innerDescription.textContent=innerDescription.getAttribute("name")}else if(document.getElementById(details_id).innerHTML==lessDetails){const ogID=details_id.substring(0,details_id.length-5);document.getElementById(ogID).removeAttribute("hidden");const innerDescription=document.getElementById(document.getElementById(details_id).name);innerDescription.textContent=truncateDescription(innerDescription.getAttribute("name"))}}function truncateDescription(stringInput){if(null!=stringInput||null!=stringInput)return stringInput.length>30?stringInput.substring(0,30)+"...":stringInput}let remainder_efp=0,efp_length=0,eFPSortedSRA=[],efp_RPKM_values=[];function populate_efp_modal(status){toggleResponsiveTable(2),$("#efpModalTable").empty(),efp_table_column="",eFPSortedSRA=[];const allSRASorted=document.getElementsByClassName("colTitle");for(let s=2;s\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+"
'+title+"\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(svg.substring(4).replace(".svg","_svg")).innerHTML+'
'+svg.substring(4).replace(".svg","")+"
-9999
'+truncateDescription(description)+"
","Amazon AWS"===bam_type&&(append_str+=''),experimentno.includes("unknown")&&!publicationid||(append_str+='"),append_str+='"+moreDetails.trim()+"",append_str+='
\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 i=0;i<11*~~(eFPSortedSRA.length/11);i+=11)if("null"!=document.getElementById(eFPSortedSRA[i+10]).outerHTML){efp_table_column="";for(let r=0;r<11;r++)efp_table_column+=generateEFPTableItem(eFPSortedSRA[i+r],sraDict[eFPSortedSRA[i+r]].title);efp_table_column+="",$("#eFPtable").append(efp_table_column)}for(let r=0;r<12;r++)if(remainder_efp===r){efp_table_column="";for(let c=remainder_efp;c>0;c--)efp_table_column+=generateEFPTableItem(eFPSortedSRA[efp_length-c],sraDict[eFPSortedSRA[efp_length-c]].title);efp_table_column+="",$("#eFPtable").append(efp_table_column)}toggleResponsiveTable()}function generateEFPTableItem(id,title){return id&&title?`\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t${document.getElementById(id+"_svg").outerHTML}\n\t\t\t\t\t\n\t\t\t\t\t${id} - ${title}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t`:""}function change_rpkm_colour_scale(colouring_mode){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"==colouring_mode){const img_created=document.createElement("img");img_created.src="data:image/png;base64,"+relative_rpkm_scale,img_created.style="margin-top: 10px;",svg_colouring_element&&svg_colouring_element.appendChild(img_created)}else{const img_created=document.createElement("img");img_created.src="data:image/png;base64,"+absolute_rpkm_scale,img_created.style="margin-top: 10px;",img_created.alt="Absolute RPKM Scale",svg_colouring_element&&svg_colouring_element.appendChild(img_created)}const columnList=["colTitle","colRNA","colrpb","coleFP","colRPKM","colDetails"];let tds=[];document.getElementsByClassName("fltrow")&&document.getElementsByClassName("fltrow")[0]&&(tds=document.getElementsByClassName("fltrow")[0].getElementsByTagName("td"));for(let i=0;i=1&&loc[2]<=5||"C"==loc[2]||"M"==loc[2]||"c"==loc[2]||"m"==loc[2])&&("G"==loc[3]||"g"==loc[3])&&loc[4]>=0&&loc[4]<=9&&loc[5]>=0&&loc[5]<=9&&loc[6]>=0&&loc[6]<=9&&loc[7]>=0&&loc[7]<=9&&loc[8]>=0&&loc[8]<=9?$("#locus_button").removeAttr("disabled"):$("#locus_button").prop("disabled",!0)}function yscale_validation(){const yscale=document.getElementById("yscale_input").value;parseInt(yscale)>0||"Auto"==yscale||""==yscale?$("#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)}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 AuthUser=findAuthUser();""==users_email&&null==users_email&&null==users_email||users_email!==AuthUser?""!=users_email&&users_email!=AuthUser&&(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(get_xml_list_return){xml_title=void 0,match_title={},title_list=[];let unnamed_title_num=1,private_version_num=1;if(get_xml_list_output=get_xml_list_return,"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 i=0;i\n\t\t\t\t\t\t\t\t\t\t${title_list[c]}\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(xhr,status,error){generateToastNotification(`Error getting user data: ${error.message}`,"ERROR"),console.log(`Error getting user data: ${error.message}`)}})}let datalist=[],datalist_Title={};function create_data_list(size){if(datalist=[],datalist_Title={},size>0)for(let i=0;i{if(xhr.readyState===XMLHttpRequest.DONE&&200===xhr.status){let response=xhr.responseXML;if(response){let responseTitle=response.getElementsByTagName("files")[0].attributes.xmltitle.nodeValue;datalist_Title[responseTitle]=datalistData[dlCallPosition],dlCallPosition+=1,DatalistXHRCall(datalistData)}}},xhr.open("GET",url),xhr.send()}}function validateEmail(email){return/\S+@\S+\.\S+/.test(email)}function findAuthUser(){return global_user&&global_user.email?global_user.email:""}function check_if_Google_login(){const AuthUser=findAuthUser();users_email&&AuthUser&&users_email===AuthUser?!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 AuthUser=findAuthUser();user_exist?user_exist&&(dataset_dictionary[datasetName]?dataset_dictionary[datasetName]&&(users_email===AuthUser?(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!=AuthUser&&(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in"))):users_email===AuthUser?$.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!=AuthUser&&(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in"))):users_email===AuthUser?$.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!=AuthUser&&(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 AuthUser=findAuthUser();""!=users_email&&users_email===AuthUser?document.getElementById("upload_modal").click():""!=users_email&&users_email!=AuthUser?(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in")):""==users_email&&document.getElementById("upload_logX").click()}let public_title_list=[],total_amount_of_datasets=0;function delete_fill(){$("#delete_fill").empty(),$("#publicDatabaseDownload").empty(),public_title_list=[];for(let public_title in base_dataset_dictionary)base_dataset_dictionary.hasOwnProperty(public_title)&&public_title_list.push(public_title);let deleteBoxNum=0;total_amount_of_datasets=public_title_list.length+title_list.length;for(let i=0;i\n\t\t\t\t\t${public_title_list[i]}\n\t\t\t\t\n\t\t\t\t
\n\t\t\t`),deleteBoxNum+=1;for(let i=0;i\n\t\t\t\t\t${title_list[i]}\n\t\t\t\t\n\t\t\t\t
\n\t\t\t`),deleteBoxNum+=1}let isDeletePublicDisabled=!1;function disableDeletePublic(){for(let i=0;i\n\t\n",table_add+="\t\t"+fileTitle+"\n",table_add+=table_base,$title.each((function(){table_add+="\t\t\n";const title=$(this).attr("description");table_add+="\t\t\t"+title+"\n";const desc=$(this).attr("info");table_add+="\t\t\t"+desc+"\n";const record_number=$(this).attr("record_number");table_add+="\t\t\t"+record_number+"\n";const bam_link=$(this).attr("name");table_add+="\t\t\t"+bam_link+"\n";const bam_type=$(this).attr("bam_type");table_add+="\t\t\t"+bam_type+"\n";let bam_filename=$(this).attr("filename");null!=bam_filename&&"undefined"!==bam_filename&&".bam"!==bam_filename||(bam_filename="accepted_hits.bam"),table_add+="\t\t\t"+bam_filename+"\n";const publication_link=$(this).attr("publication_link");table_add+="\t\t\t"+publication_link+"\n";const publication_url=$(this).attr("url");table_add+="\t\t\t"+publication_url+"\n";let total_reads_mapped=$(this).attr("total_reads_mapped");null!=total_reads_mapped&&""!=total_reads_mapped||(total_reads_mapped="0"),table_add+="\t\t\t"+total_reads_mapped+"\n";const read_map_method=$(this).attr("read_map_method");table_add+="\t\t\t"+read_map_method+"\n";let species=$(this).attr("species");null!=species&&""!=species||(species="Arabidopsis thaliana"),table_add+="\t\t\t"+species+"\n";const svgname=$(this).attr("svgname");table_add+="\t\t\t"+svgname+"\n";const svg_subunit=$(this).attr("svg_subunit");table_add+="\t\t\t"+svg_subunit+"\n";let controlsXMLString="";if($(this).find("controls")[0].innerHTML)for(let j=1;j<$(this).find("controls")[0].childNodes.length;j+=2)$(this).find("controls")[0].childNodes[j].firstChild&&(controlsXMLString+=$(this).find("controls")[0].childNodes[j].firstChild.textContent,j<$(this).find("controls")[0].childNodes.length-2&&(controlsXMLString+=", "));table_add+="\t\t\t"+controlsXMLString+"\n";let RcontrolsXMLString="";if($(this).find("groupwith")[0].innerHTML)for(let j=1;j<$(this).find("groupwith")[0].childNodes.length;j+=2)$(this).find("groupwith")[0].childNodes[j].firstChild&&(RcontrolsXMLString+=$(this).find("groupwith")[0].childNodes[j].firstChild.textContent,j<$(this).find("groupwith")[0].childNodes.length-2&&(RcontrolsXMLString+=", "));table_add+="\t\t\t"+RcontrolsXMLString+"\n",table_add+="\t\t\n"})),table_add+="\t\n",document.getElementById("XMLtoCSVtable").innerHTML+=table_add},error:function(xhr,status,error){generateToastNotification(`Error filling data table: ${error.message}`,"ERROR"),console.log(`Error filling data table: ${error.message}`)}})}}function download_XMLtableCSV(){for(let i=0;i\n",downloadIndexTable_str+=downloadIndexTable_base;for(const sra of eFPSortedSRA)downloadIndexTable_str+="\t\t\n",downloadIndexTable_str+="\t\t\t"+sraDict[sra].title+"\n",downloadIndexTable_str+="\t\t\t"+sra+"\n",downloadIndexTable_str+="\t\t\t"+sraDict[sra].svg.substr(4,sraDict[sra].svg.length-8)+"\n",downloadIndexTable_str+="\t\t\t"+sraDict[sra].svg_part+"\n",downloadIndexTable_str+="\t\t\t"+sraDict[sra].locusValue+"\n",downloadIndexTable_str+="\t\t\t"+String(sraDict[sra].bp_length)+"\n",downloadIndexTable_str+="\t\t\t"+String(sraDict[sra].bp_start)+"\n",downloadIndexTable_str+="\t\t\t"+String(sraDict[sra].bp_end)+"\n",downloadIndexTable_str+="\t\t\t"+sraDict[sra].numberofreads+"\n",downloadIndexTable_str+="\t\t\t"+String(sraDict[sra].MappedReads)+"\n",downloadIndexTable_str+="\t\t\t"+sraDict[sra].rpb+"\n",downloadIndexTable_str+="\t\t\t"+String(sraDict[sra].RPKM[variantPosition].toFixed(2))+"\n",downloadIndexTable_str+="\t\t\t"+String(sraDict[sra].controlsString)+"\n",downloadIndexTable_str+="\t\t\n";downloadIndexTable_str+="\t\n",document.getElementById("hiddenDownloadModal_table").innerHTML+=downloadIndexTable_str,$("#hiddenDownloadModal_table").tableToCSV(),document.getElementById("download_icon").classList.remove("progressLoading"),document.getElementById("bodyContainer").classList.remove("progressLoading")}let publicData=!0;function changePublicData(forceFalse=!1){publicData=!forceFalse&&!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 property in base_dataset_dictionary){if(base_src===base_dataset_dictionary[property]){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(locusToVerify){if("string"==typeof locusToVerify){const regexPattern=new RegExp("^[A][T][MC0-9][G][0-9]{5}[.][0-9]{1,2}$|^[A][T][MC0-9][G][0-9]{5}$","i");return locusToVerify.trim().match(regexPattern)}return!1}let parse_output,GFF_List=[];function getGFF(locusID){GFF_List=[],$.ajax({url:`https://bar.utoronto.ca/webservices/bar_araport/gene_structure_by_locus.php?locus=${locusID}`,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(gene_res){if(parse_output=gene_res,parse_output.wasSuccessful){let parsed_features=parse_output.features[0].subfeatures;for(let i=0;i0)for(let i=0;i0){const locusID=document.getElementById("locus").value.trim().split("/");locusID[0]?document.getElementById("locus").value=locusID[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(id){html2canvas(document.getElementById(id)).then((canvas=>{$("#appendCanvas").empty(),canvas.id="downloadDivNum_"+downloadDivNum,document.getElementById("appendCanvas").appendChild(canvas),document.getElementById("downloadDivNum_"+downloadDivNum).style.width="100%",$("#DownloadImageModal").modal("toggle"),downloadDivNum++}))}function displayNavBAR(hideNavbar=!1){const displayNav=$("#navbar_menu").is(":visible")||hideNavbar;document.getElementById("navbar_menu").style.display=displayNav?"none":"block",document.getElementById("main_content").className=displayNav?"col-sm-12":"col-sm-9",document.getElementById("openMenu").style.display=displayNav?"block":"none",document.getElementById("theTable")&&(displayNav?document.getElementById("theTable").classList.add("RNATable"):document.getElementById("theTable").classList.remove("RNATable"))}function adjustFooterSize(){const navbar=document.getElementById("navbar_menu");navbar&&(document.getElementById("nm_footer").style.width=navbar.offsetWidth+"px",navbar.scrollHeight==navbar.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")):navbar.scrollHeight>navbar.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 iFrameSize=.7*window.innerHeight;document.getElementById("submissioniframe").height=iFrameSize+"px"}let usedToggle=!1;function toggleTableCol(colClass,enable){const column=document.getElementsByClassName(colClass);if(enable)for(const element of column)element&&element.removeAttribute("hidden");else if(!enable)for(const element of column)element&&element.setAttribute("hidden",!0)}let responsiveRNAWidthAdjusted=!1;function responsiveRNAWidthResize(){const responsive=document.getElementsByClassName("responsiveRNAWidth");if(window.innerWidth<=575){for(let i=0;i575&&responsiveRNAWidthAdjusted)for(let i=0;i=1100&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!0,!0,!0,!0,!1):3==forceToggle||window.innerWidth<830&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!1,!1,!1,!1,!1):4==forceToggle||window.innerWidth<900&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!0,!1,!1,!1,!1):5==forceToggle||window.innerWidth<990&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!0,!1,!0,!1,!1):(6==forceToggle||window.innerWidth<1100&&!usedToggle)&&toggleResponsiveTableOptions(!0,!0,!0,!0,!0,!1,!1))}let ToggledTable=[!0,!0,!0,!0,!0,!0,!1];function RememberToggleOptions(title=!0,rna=!0,rpb=!0,efp=!0,rpkm=!0,details=!0,compare=!1){ToggledTable=[title,rna,rpb,efp,rpkm,details,compare]}const colSortList=["colTitle","colrpb","colRPKM","colDetails"];function ResizeArrowRow(){for(const col of colSortList){const colRow=col+"Row";document.getElementById(colRow).style.width=document.getElementById(colRow).parentNode.offsetWidth-2+"px";CheckElementWidth(col+"Arrow",8)}}function CheckElementWidth(arrowID,widthCheckFor){document.getElementById(arrowID).offsetWidth{-1!==navigator.userAgent.indexOf(agent)&&passLength++})),passLength!=failLength){detectBrowser=element,notDetectedBrowser=!1;break}}}if(detectBrowser){$("#notChrome").empty();const append_str=' or through the following Google search results';$("#notChrome").append(append_str)}BrowserDetected=!0}}function CreateFilteredeFPList(){if($("#filtereFPList").empty(),tissueSRADic){const allTissuesDisplayed=Object.keys(tissueSRADic);for(const tissue of allTissuesDisplayed){let append_str='
  • ';append_str+='',append_str+='

    '+tissue+"

    ",append_str+="
  • ",$("#filtereFPList").append(append_str)}}else logError("Unable to use tissueSRADic")}function ToggleFilteredeFP(whichToToggle,OnOrOff){const whichSVG=whichToToggle.replace("_"," "),whichSRA=tissueSRADic[whichSVG];if(!0===OnOrOff)for(let i=0;i1)if("locus"===queryInputs[0].split("%20").join(" ").trim()){const qIValue=input.substring(6).split("%20").join(" ").trim();shareLinkInputs.locus=qIValue,document.getElementById("locus").value=qIValue,locusInput=!0}else if("dataset"===queryInputs[0].split("%20").join(" ").trim()){const qIValue=input.substring(8).split("%20").join(" ").trim();shareLinkInputs.dataset=qIValue,base_src=qIValue,datasetInput=!0}}locusInput&&datasetInput?(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(locusInput&&!1===datasetInput?"ERROR IN SHARE LINK! Missing dataset":!1===locusInput&&datasetInput?"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(whatID,disableAll=!1){const whatSRA=whatID.split("_")[0];if(disableAll)disableAllComparison();else if(!1===disableAll&&document.getElementById(whatID)&&document.getElementById(whatID).checked){allCheckedOptions.push(whatSRA);const iterationProcess={};for(let i=0;i';parseInt(i)===parseInt(variantPosition)?append_str+=''+document.getElementById(whatSRA+"_title").innerHTML+" ... ("+GFF_List[i]+")\n":append_str+='^^^ ... ('+GFF_List[i]+")\n",append_str+='RNA-Seq mapped image for:'+whatSRA+'
    Gene variant image for:'+whatSRA+'\n',append_str+=''+sraDict[whatSRA].r[i].toFixed(2)+"",append_str+='
    '+document.getElementById(sraDict[whatSRA].svg.substr(4).replace(".svg","_svg")).innerHTML+'
    '+sraDict[whatSRA].svg.substring(4).replace(".svg","")+"
    \n",append_str+=''+sraDict[whatSRA].RPKM[i].toFixed(2)+"",parseInt(i)===parseInt(variantPosition)?append_str+='
    '+document.getElementById(whatSRA+"_description").innerHTML+'
    '+document.getElementById("igbLink_"+whatSRA).innerHTML+'
    '+document.getElementById("extraLinks_"+whatSRA).innerHTML+"
    \n":append_str+='^^^\n',append_str+="",iterationProcess[i]=whatSRA+"_compareRow"+i,document.getElementById("compareTable").innerHTML+=append_str,document.getElementById(whatSRA+"_rnaseq_img"+i)&&document.getElementById(whatSRA+"_rnaseq_img"+i).setAttribute("src",document.getElementById(whatSRA+"_rnaseq_img").src),document.getElementById(whatSRA+"_gene_structure_img"+i)&&document.getElementById(whatSRA+"_gene_structure_img"+i).setAttribute("src",document.getElementsByClassName("dd-option-image")[i].src),sraDict[whatSRA].RPKM&&sraDict[whatSRA].RPKM[i]&&colour_part_by_id(whatSRA+"_svg"+i,sraDict[whatSRA].svg_part,sraDict[whatSRA].RPKM[i],colouring_mode)}document.getElementById(whatID).checked=!0,document.getElementById("allCheckbox").checked=!0,"rel"!=colouring_mode&&(document.getElementById("compareGeneVariants").disabled=!1)}else!1===disableAll?(disableCompare(whatSRA),allCheckedOptions.splice(allCheckedOptions.indexOf(whatSRA),1),document.getElementById(whatID).checked=!1):!0===disableAll&&disableAllComparison(),0===allCheckedOptions.length&&(document.getElementById("compareGeneVariants").disabled=!0)}function disableCompare(whatSRA){for(let i=0;i=0;c--)document.getElementsByClassName("compareDataRow")[c].remove();allCheckedOptions=[],compareDataRows=document.getElementsByClassName("compareCheckbox");for(let c=0;c
    The eFP-Seq Browser's current version number is: ${version}`;document.getElementById(elementId).innerHTML+=versionText}function displayVersionNumber(){appendVersionNumber("citationText"),appendVersionNumber("feedbackText")}let toastCounter=0;function generateToastNotification(message,header="Notification"){if(message){let dataAttributeValue=`toast-${toastCounter}`;const toast=`\n\t\t\n\t\t`;document.getElementById("toast-container").innerHTML+=toast,$(`[data-toast="${dataAttributeValue}"]`).toast({autohide:!1}),$(`[data-toast="${dataAttributeValue}"]`).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(request,response){const last=request.term.split(/,\s*/).pop();$.ajax({type:"GET",url:"https://bar.utoronto.ca/webservices/eFP-Seq_Browser/idautocomplete.cgi?species=Arabidopsis_thaliana&term="+last,dataType:"json"}).done((function(data){data&&data.length>=7?response(data.slice(0,7)):response(data)}))},close:function(e,ui){correctAGIIDInput()}});const subiFrame=document.getElementById("submissioniframe");subiFrame&&subiFrame.setAttribute("src",subiFrame.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.4.0-p20240808",isDevEnv=window.location.href.includes("localhost:3030"),BE_URL=isDevEnv?"http://localhost:3040":".";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="";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 dataset_dictionary=base_dataset_dictionary,loadNewDataset=!1,count_bam_entries_in_xml=113;function count_bam_num(){const xhr=new XMLHttpRequest,url=base_src;xhr.responseType="document",xhr.onreadystatechange=()=>{if(xhr.readyState===XMLHttpRequest.DONE&&200===xhr.status){const response=xhr.responseXML;response&&response.getElementsByTagName("file")?count_bam_entries_in_xml=xhr.responseXML.getElementsByTagName("file").length:null==response&&console.log("failed at response"),document.getElementById("testing_count").innerHTML=count_bam_entries_in_xml}},xhr.open("GET",url),xhr.send()}function loadingScreen(terminate=!0){if(!1===terminate){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 toDisableList=document.getElementsByClassName("disableOnLoading");for(const element of toDisableList)$("#"+element.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 toDisableList=document.getElementsByClassName("disableOnLoading");for(const element of toDisableList)$("#"+element.id).prop("disabled",!1);addGFF(),uploadingData=!1}}count_bam_num();const img_loading_base64="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcIAAAAyCAYAAADP/dvoAAAABmJLR0QAwADAAMAanQdUAAAACXBIWXMAAA7CAAAOwgEVKEqAAAAAB3RJTUUH4AoRDzYeAMpyUgAABGJJREFUeNrt3TFoE3scwPGvjxtOzKAQMEOECBkyROhQsWOEChURBFtssdJFB9Gl4OJkwaEtRRAUdLAUqYJgwamIEFAwUoS43RCw0AwpOjhkuCHDQd5Qes9q+7A+7cP2+1na5K53cH/Kl19yIfu63W4XSZL2qL+8BJIkQyhJ0h4VfPvExMSEV0WStGt92zknQkmSE+GPFFOSpN00CToRSpJkCCVJhlCSJEMoSZIhlCTJEEqSZAglSTKEkiQZQkmSDKEkSYZQkiRDKEmSIZQkyRBKe8HDhw/5/Pnzbzn2/v3709/Hx8d/23kkGULpp01PT9NoNH7LsTudDgBJktBut0mSxAsu/Q8CL4G0fUmSEEURcRxTLpc5ePBguu3Lly9EUUQ2m6VcLm/4u0ajQRzH9PT0/PNPGARcu3aNXC6X7lMqlVheXv5u3/Xt69NjJpOht7fXBZEMobRz2u02Z8+eJY5jCoUCtVqN58+fU6lUePLkCXfu3KGnp4d6vU5vby9zc3PA2peCzs7OUiqVvjvm8ePHWVlZoVAocPr0aQYHB6nX6zSbTSqVSnqMkZGRdHp88+YNw8PDzM/PuyiSIZR2zv3798lms7x9+xZYex/x5s2bLC0tce7cOYaHhwmCgHa7zaFDh5ibm6PZ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Y/ 3lxReHMhF4nm1z+Zv6KP+/PdANuwQcLhhEyQAAAAAElFTkSuQmCC";function generate_colour(start_color,end_color,percent){start_color=start_color.replace(/^\s*#|\s*$/g,""),end_color=end_color.replace(/^\s*#|\s*$/g,""),3==start_color.length&&(start_color=start_color.replace(/(.)/g,"$1$1")),3==end_color.length&&(end_color=end_color.replace(/(.)/g,"$1$1"));let start_red=parseInt(start_color.substr(0,2),16),start_green=parseInt(start_color.substr(2,2),16),start_blue=parseInt(start_color.substr(4,2),16),diff_red=parseInt(end_color.substr(0,2),16)-start_red,diff_green=parseInt(end_color.substr(2,2),16)-start_green,diff_blue=parseInt(end_color.substr(4,2),16)-start_blue;return diff_red=(diff_red*percent+start_red).toString(16).split(".")[0],diff_green=(diff_green*percent+start_green).toString(16).split(".")[0],diff_blue=(diff_blue*percent+start_blue).toString(16).split(".")[0],1==diff_red.length&&(diff_red="0"+diff_red),1==diff_green.length&&(diff_green="0"+diff_green),1==diff_blue.length&&(diff_blue="0"+diff_blue),"#"+diff_red+diff_green+diff_blue}function round(x,digits){return parseFloat(x.toFixed(digits))}let colouring_part;function colour_part_by_id(id,part,fpkm,mode){colouring_part="all";for(const sra of sraList)id.replace("_svg","")==sra&&(colouring_part=sraDict[sra].svg_part);let paths1,paths2,fpkmUse=fpkm;fpkmUse=Array.isArray(fpkmUse)?fpkmUse[variantPosition]:parseFloat(fpkmUse),max_abs_scale=document.getElementById("rpkm_scale_input").value,(!max_abs_scale||max_abs_scale<=0)&&(max_abs_scale=1e3),document.getElementById(id)&&(paths1=document.getElementById(id).getElementsByTagName("path"),paths2=document.getElementById(id).getElementsByTagName("g"));let paths=null;if(paths1&&paths2&&(paths=Array.prototype.slice.call(paths1).concat(Array.prototype.slice.call(paths2))),null!=paths){if("abs"==mode){const r=255,g=255-parseInt(fpkmUse/max_abs_scale*255),b=0;if("all"==colouring_part)for(const path of paths)path.style.fill="rgb("+r+", "+g+", "+b+")";else for(const path of paths)if(path.id==colouring_part)if("g"==path.tagName){const child_paths=path.getElementsByTagName("path");for(const child of child_paths)child.style.fill="rgb("+r+", "+g+", "+b+")"}else path.style.fill="rgb("+r+", "+g+", "+b+")"}else if("rel"==mode){let hex="";const log_scale_max=3;let log_scaling=0;if("Missing controls data"!=fpkmUse&&Math.abs(fpkmUse)>log_scale_max?log_scaling=log_scale_max:"Missing controls data"!=fpkmUse&&(log_scaling=Math.abs(fpkmUse)),log_scaling/=log_scale_max,"Missing controls data"==fpkmUse?hex="#D9D9D9":fpkmUse>0?hex=generate_colour("FFFF00","FF0000",log_scaling):0==fpkmUse?hex="FFFF00":fpkmUse<0&&(hex=generate_colour("FFFF00","0000FF",log_scaling)),"all"==colouring_part)for(const path of paths)path.style.fill=hex;else for(const path of paths)if(path.id==colouring_part)if("g"==path.tagName){const child_paths=path.getElementsByTagName("path");for(const child of child_paths)child.style.fill=hex}else path.style.fill=hex}document.getElementById(id.replace("_svg","_rpkm")).innerHTML="Missing controls data"==fpkmUse?fpkmUse:round(fpkmUse,2)}else console.log("Paths is null for id = "+id)}let rpkmAverage=1,rpkmMedian=1;function findRPKMValuesAcrossAll(){if(sraDict){const listOfSRA=Object.keys(sraDict),listOfRPKM=[];let rpkmTotal=0;for(const sra of listOfSRA)if(sraDict[sra].RPKM){const currentRPKM=sraDict[sra].RPKM[variantPosition];parseFloat(currentRPKM)&&(listOfRPKM.push(currentRPKM),rpkmTotal+=currentRPKM)}listOfRPKM.length>0&&(rpkmMedian=math.median(listOfRPKM)),rpkmAverage=rpkmTotal/listOfSRA.length}else displayError("ERROR IN RETRIEVING ALL DATA POINTS WITHIN DATASET")}function switchRPKMMode(selectedMode){let rel=!1;"rel_radio"===selectedMode&&(rel=!0),rel?(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 mode=colouring_mode;for(let i=0;i0?ctrl_avg_fpkm=ctrl_fpkm_sum/ctrl_count:(rpkmMedian&&1===rpkmMedian&&findRPKMValuesAcrossAll(),ctrl_avg_fpkm=rpkmMedian);let relativeRPKMValue=0;const relativeRPKM=[];let useRPKM="";useRPKM=sraDict[currentSRA].RPKM&&sraDict[currentSRA].RPKM[variantPosition]?sraDict[currentSRA].RPKM[variantPosition]:0,0==useRPKM&&0==ctrl_avg_fpkm?exp_info[i].splice(4,1,0):relativeRPKMValue=Math.log2(useRPKM/ctrl_avg_fpkm),relativeRPKM.push(relativeRPKMValue),sraDict[currentSRA].relativeRPKM=relativeRPKMValue,exp_info[i].splice(4,1,relativeRPKM),exp_info[i].splice(6,1,ctrl_avg_fpkm),useRPKM>=max_absolute_fpkm&&(max_absolute_fpkm=useRPKM),"Missing controls data"!=exp_info[i][4]&&Math.abs(exp_info[i][4])>=max_log_fpkm&&Math.abs(exp_info[i][4])<1e3&&(max_log_fpkm=Math.abs(exp_info[i][4])),"rel"===colouring_mode?exp_info[i][4]||0==exp_info[i][4]||(exp_info[i][4]=-999999):exp_info[i][3][variantPosition]||0==exp_info[i][3][variantPosition]||(exp_info[i][3][variantPosition]=-999999)}else logError("Issue retrieving exp_info for "+mode+" within BAM entry point "+i);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(status){null!=document.getElementById("locus")&&(new_locus=document.getElementById("locus").value,new_locus===old_locus?($.xhrPool.abortAll(),variants_radio_options(status)):new_locus!=old_locus&&(getGFF(new_locus),old_locus=new_locus,setTimeout((function(){$.xhrPool.abortAll(),variants_radio_options(status)}),1650)))}async function variants_radio_options(status){get_input_values(),fetch(`${BE_URL}/cgi-bin/get_gene_structures.cgi?locus=${locus}`).then((async response=>{const gene_res=await response.json();locus_start=gene_res.locus_start,locus_end=gene_res.locus_end,splice_variants=JSON.stringify(gene_res.splice_variants),populate_table(status),populate_efp_modal(status);const variants_div=document.getElementById("variants_div");if(variants_div?.firstChild)for(;variants_div.firstChild;)variants_div.removeChild(variants_div.firstChild);$("#variant_select").ddslick("destroy");let append_str='",$("#variants_div").append(append_str),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")})).catch((error=>{displayError("ERROR processing and getting gene structures!"),generateToastNotification(`Error processing gene structures: ${error.message}`,"ERROR"),console.error(`Error processing gene structures: ${error.message}`)}))}function displayError(errorMessage){$("#displayError").empty();let append_str='

    '+errorMessage+"

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

    ";console.error("Error in logic:",errorMessage),$("#displayError").append(append_str),$("#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(errorMessage){console.error("Error in logic:",errorMessage)}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 variant_img=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 all_gene_structure_imgs=document.getElementsByClassName("gene_structure_img");for(let i=0;i0)for(let i=0;i0&&(document.getElementById("compareGeneVariants").disabled=!1),expInfo[3]||0==expInfo[3]||(expInfo[3]=-999999);let useRPKM="";if(variant_selected&&sraDict[currentSRA].RPKM&&sraDict[currentSRA].RPKM[variant_selected]){let rpkmValue=sraDict[currentSRA].RPKM[variant_selected].toFixed(2);document.getElementById(expInfo[0].split("_svg")[0]+"_rpkm").innerHTML=rpkmValue,useRPKM=rpkmValue}else{let rpkmValue=0;document.getElementById(expInfo[0].split("_svg")[0]+"_rpkm").innerHTML=rpkmValue,useRPKM=rpkmValue}colour_part_by_id(currentSRA+"_svg",sraDict[currentSRA].svg_part,useRPKM,colouring_mode)}}function parseIntArray(arr){for(let i=0,len=arr.length;i1?driveLinkSplit[1]:linkString}else if("Amazon AWS"===sraDict[sraList[i]].bam_type){let linkString=sraDict[sraList[i]].drive_link,driveLinkSplit=linkString.split("amazonaws.com/");1===driveLinkSplit.length&&(driveLinkSplit=linkString.split("araport.cyverse-cdn.tacc.cloud/")),match_drive=driveLinkSplit.length>1?driveLinkSplit[1]:linkString}data={status:status,numberofreads:sraDict[sraList[i]].numberofreads,hexcodecolour:sraDict[sraList[i]].hexColourCode,remoteDrive:match_drive,bamType:sraDict[sraList[i]].bam_type,filename:sraDict[sraList[i]].filenameIn,tissue:tissueWebservice,record:sraRecordNumber,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(response_rnaseq){let stopLoadingScreen=99;count_bam_entries_in_xml>0&&(stopLoadingScreen=parseInt((count_bam_entries_in_xml-1)/count_bam_entries_in_xml*100)),rnaseq_success++;let date_obj3=new Date;if(rnaseq_success_current_time=date_obj3.getTime(),progress_percent=rnaseq_change/count_bam_entries_in_xml*100,$("div#progress").width(progress_percent+"%"),progress_percent>stopLoadingScreen&&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}`,response_rnaseq.status&&"success"===response_rnaseq.status&&response_rnaseq.record){let responseRecord=response_rnaseq.record||"unknown";if(listOfRecordsDisplayed.includes(responseRecord)?(responseRecord=findUnusedRecordDisplayName(responseRecord,listOfRecordsDisplayed),listOfRecordsDisplayed.push(responseRecord)):listOfRecordsDisplayed.push(responseRecord),listOfRecordsDisplayed=[],sraDict[responseRecord].bp_length=parseFloat(response_rnaseq.end)-parseFloat(response_rnaseq.start),sraDict[responseRecord].bp_start=parseFloat(response_rnaseq.start),sraDict[responseRecord].bp_end=parseFloat(response_rnaseq.end),sraDict[responseRecord].MappedReads=response_rnaseq.reads_mapped_to_locus,totalreadsMapped_dic[responseRecord]=response_rnaseq.totalReadsMapped,sraDict[responseRecord].locusValue=response_rnaseq.locus,sraDict[responseRecord].r=response_rnaseq.r,sraDict[responseRecord].dataVisualization=response_rnaseq.rnaseqbase64,locus!=response_rnaseq.locus)throw new Error(`ERROR: ${locus}'s RNA-Seq API request returned with data for some other locus.`);let r=[];if(response_rnaseq.ss_y&&response_rnaseq.sum_y&&response_rnaseq.sum_xy&&response_rnaseq.sum_x&&response_rnaseq.ss_x&&response_rnaseq.end&&response_rnaseq.start){parseInt(response_rnaseq.ss_y);let sum_y=parseInt(response_rnaseq.sum_y),ssy=parseInt(response_rnaseq.ss_y),sum_xy=parseIntArray(response_rnaseq.sum_xy.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),sum_x=parseIntArray(response_rnaseq.sum_x.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),ssx=(parseIntArray(response_rnaseq.sum_xx.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),parseIntArray(response_rnaseq.ss_x.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(",")),parseIntArray(response_rnaseq.ss_x.replace(/\[/g,"").replace(/\]/g,"").replace(/"/g,"").split(","))),n=parseInt(response_rnaseq.end)-parseInt(response_rnaseq.start),sp=[];for(let i=0;i=3?(document.getElementById(responseRecord+"_rnaseq_img").src="data:image/png;base64,"+response_rnaseq.rnaseqbase64,rnaseq_change+=1):(document.getElementById(responseRecord+"_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 - "+responseRecord+", dataset - "+base_src)):(document.getElementById(`${responseRecord}_rnaseq_img`)&&(document.getElementById(`${responseRecord}_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 - "+responseRecord+", dataset - "+base_src)),document.getElementById(responseRecord+"_rpb").innerHTML=parseFloat(r[0]).toFixed(2),sraDict[responseRecord].rpb=parseFloat(r[0]).toFixed(2),document.getElementById(responseRecord+"_rpkm").innerHTML=response_rnaseq["absolute-fpkm"],updateRPKMAbsoluteMax(response_rnaseq["absolute-fpkm"]),sraDict[responseRecord].RPKM=response_rnaseq["absolute-fpkm"],rpkmCount++,document.getElementById(responseRecord+"_totalReadsNum").innerHTML="Total reads = "+response_rnaseq.totalReadsMapped,callDumpOutputs)if(dumpOutputs+='\t\telif (record == "'+response_rnaseq.record+'"):\n',"complex"==dumpMethod){for(dumpOutputs+='\t\t\tdumpJSON(200, "'+response_rnaseq.locus+'", '+response_rnaseq.variant+", "+response_rnaseq.chromosome+", "+response_rnaseq.start+", "+response_rnaseq.end+', "'+response_rnaseq.record+'", "'+response_rnaseq.tissue+'", "'+response_rnaseq.rnaseqbase64+'", '+response_rnaseq.reads_mapped_to_locus+", "+response_rnaseq["absolute-fpkm"]+", ["+response_rnaseq.r+"], "+response_rnaseq.totalReadsMapped+", ["+response_rnaseq.exp_arr+"], [",r=0;rLoad 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(xhr,status,error){generateToastNotification(`Error getting RNA-Seq map coverage for ${data.record} - ${error.message}`,"ERROR"),console.error("Error getting RNA-Seq map coverage!",xhr,status,error)}})}}}function findUnusedRecordDisplayName(recordID="unknown",listCheckAgainst=sraList,it=0){if(Array.isArray(listCheckAgainst)){let newName=recordID+"_"+it;if(listCheckAgainst.includes(newName))findUnusedRecordDisplayName(recordID,listCheckAgainst,it+1);else if(!listCheckAgainst.includes(newName))return newName}else findUnusedRecordDisplayName(recordID,listCheckAgainst=[])}function updateRPKMAbsoluteMax(RPKMCheckAgainst){let currentRPKMAbsMax=parseInt(document.getElementById("rpkm_scale_input").value);1e3===currentRPKMAbsMax&&(currentRPKMAbsMax=1);let newRPKMValue=parseInt(RPKMCheckAgainst);newRPKMValue>currentRPKMAbsMax&&(document.getElementById("rpkm_scale_input").value=newRPKMValue)}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(svg,subunit,returnName=!1){let svgName=svg.split(".")[0],toReturn=returnName?svgAgainstData[svgName].name:subunit;return svgAgainstData[svgName]&&!returnName&&(svgAgainstData[svgName].subunit?svgAgainstData[svgName].subunit.includes(subunit)||(svgAgainstData[svgName].subunit_name?toReturn=svgAgainstData[svgName].subunit_name:svgAgainstData[svgName].subunit[0]&&(toReturn=svgAgainstData[svgName].subunit[0])):"all"!==subunit&&(toReturn="all")),toReturn}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(status){$("#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 img_created='RNA-Seq mapped image',tableHeader='
    Title
    Sorting arrow
    RNA-Seq Coverage'+img_created+'
    rpb
    Default sort arrow
    eFP (RPKM)
    RPKM
    Default sort arrow
    Details
    Default sort arrow
    ';$("#theTable").append(tableHeader);let compareHeader='
    Title
    RNA-Seq Coverage'+img_created+'
    rpb
    eFP (RPKM)
    RPKM
    Details
    ';$("#compareTable").append(compareHeader),$.ajax({url:base_src,dataType:"xml",success:function(xml_res){$(xml_res).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,$(xml_res).find("file").each((function(){let experimentno=$(this).attr("record_number")||"unknown";if(sraList.includes(experimentno)&&(experimentno=findUnusedRecordDisplayName(experimentno,sraList)),sraList.includes(experimentno)){if(sraCountDic[experimentno]){sraCountDic[experimentno]+=1;let tempExperimentNo=experimentno+"("+sraCountDic[experimentno]+")";sraList.push(tempExperimentNo),sraDict[tempExperimentNo]={}}}else sraCountDic[experimentno]=1,sraList.push(experimentno),sraDict[experimentno]={};let title=$(this).attr("description");sraDict[experimentno].title=title;let description=$(this).attr("info");sraDict[experimentno].description=description;let svg=$(this).attr("svgname");sraDict[experimentno].svg=svg;let svg_part=$(this).attr("svg_subunit");svg_part=checkAgainstSVG(svg,svg_part),sraDict[experimentno].svg_part=svg_part,tissueSRADic[checkAgainstSVG(svg,svg_part,!0)]?tissueSRADic[checkAgainstSVG(svg,svg_part,!0)].push(experimentno):tissueSRADic[checkAgainstSVG(svg,svg_part,!0)]=[experimentno];let url=$(this).attr("url");sraDict[experimentno].url=url;let publicationid=$(this).attr("publication_link");sraDict[experimentno].publicationid=publicationid;let hexColourCode,numberofreads=$(this).attr("total_reads_mapped");null!=numberofreads&&""!=numberofreads||(numberofreads="0"),sraDict[experimentno].numberofreads=numberofreads,hexColourCode=null==$(this).attr("hex_colour")||""==$(this).attr("hex_colour")?"0x64cc65":$(this).attr("hex_colour"),sraDict[experimentno].hexColourCode=hexColourCode;let filenameIn=$(this).attr("filename");null!=filenameIn&&""!=filenameIn&&null!=filenameIn||(filenameIn="accepted_hits.bam"),sraDict[experimentno].filenameIn=filenameIn;let species=$(this).attr("species");sraDict[experimentno].species=species;let controls=[];if(null==$(this).find("controls")[0].innerHTML)for(let i=1;i<$(this).find("controls")[0].childNodes.length;i+2)controls.push($(this).find("controls")[0].childNodes[i].firstChild.textContent);else null!=$(this).find("controls")[0].innerHTML&&(controls=$(this).find("controls")[0].innerHTML.replace(//g,"").replace(/<\/bam_exp>/g,",").replace(/\n/g," ").replace(/ /g,"").split(","));sraDict[experimentno].controls=controls;let links="";if(controls.length>0)for(let i=controls.length;i--;)"MEDIAN"!=controls[i]?links+=''+controls[i]+" ":links+=controls[i];sraDict[experimentno].links=links;let controlsString="";if(controls.length>0)for(let y=0;y',table_dl_str="\n\t\n";table_dl_str+="\t\t\n",append_str+='\n",append_str+=`\n\t\t\t\t\t\n\n\t\t\t\t`,append_str+='",append_str+='\n",append_str+='',append_str+='\n",append_str+='',append_str+="",iteration_num++,$("#theTable").append(append_str);let compareColumn=document.getElementsByClassName("fltrow")[0].childNodes[6];(compareColumn&&void 0===compareColumn.classList[0]||"undefined"===compareColumn.classList[0])&&(compareColumn.classList=["colCompare"],compareColumn.innerHTML=''),exp_info.push([experimentno+"_svg",svg_part,controls,0,0,0,0]),!0===loadNewDataset?(setTimeout((function(){count_bam_num()}),200),setTimeout((function(){rnaseq_images(status)}),10)):rnaseq_images(status)})),$.tablesorter.addParser({id:"rpb_sorter",is:function(s){return!1},format:function(s){return NaN==s?-99999:null==s?-999999:s==1/0?99999:s==-1/0?-99999:parseFloat(s)},type:"numeric"}),$.tablesorter.addParser({id:"rpkm_sorter",is:function(s){return!1},format:function(s){return NaN==s?-99999:null==s?-999999:s==1/0?99999:s==-1/0?-99999:"Missing controls data"==s?-9999999:parseFloat(s)},type:"numeric"}),$("#theTable").tablesorter({headers:{0:{},1:{sorter:!1},2:{sorter:"rpb_sorter"},3:{},4:{sorter:"rpkm_sorter"},5:{}}}),$("#theTable").trigger("update")},error:function(xhr,status,error){generateToastNotification(`Error getting data from data file: ${error.message}`,"ERROR"),console.log("Error getting data from data file: "+error.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 j=0;j',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(details_id){if(null!=document.getElementById(details_id))if(document.getElementById(details_id).innerHTML==moreDetails){document.getElementById(details_id).setAttribute("hidden",!0);const innerDescription=document.getElementById(document.getElementById(details_id).name);innerDescription.textContent=innerDescription.getAttribute("name")}else if(document.getElementById(details_id).innerHTML==lessDetails){const ogID=details_id.substring(0,details_id.length-5);document.getElementById(ogID).removeAttribute("hidden");const innerDescription=document.getElementById(document.getElementById(details_id).name);innerDescription.textContent=truncateDescription(innerDescription.getAttribute("name"))}}function truncateDescription(stringInput){if(null!=stringInput||null!=stringInput)return stringInput.length>30?stringInput.substring(0,30)+"...":stringInput}let remainder_efp=0,efp_length=0,eFPSortedSRA=[],efp_RPKM_values=[];function populate_efp_modal(status){toggleResponsiveTable(2),$("#efpModalTable").empty(),efp_table_column="",eFPSortedSRA=[];const allSRASorted=document.getElementsByClassName("colTitle");for(let s=2;s\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+"
    '+title+"\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(svg.substring(4).replace(".svg","_svg")).innerHTML+'
    '+svg.substring(4).replace(".svg","")+"
    -9999
    '+truncateDescription(description)+"
    ","Amazon AWS"===bam_type&&(append_str+=''),experimentno.includes("unknown")&&!publicationid||(append_str+='"),append_str+='"+moreDetails.trim()+"",append_str+='
    \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 i=0;i<11*~~(eFPSortedSRA.length/11);i+=11)if("null"!=document.getElementById(eFPSortedSRA[i+10]).outerHTML){efp_table_column="";for(let r=0;r<11;r++)efp_table_column+=generateEFPTableItem(eFPSortedSRA[i+r],sraDict[eFPSortedSRA[i+r]].title);efp_table_column+="",$("#eFPtable").append(efp_table_column)}for(let r=0;r<12;r++)if(remainder_efp===r){efp_table_column="";for(let c=remainder_efp;c>0;c--)efp_table_column+=generateEFPTableItem(eFPSortedSRA[efp_length-c],sraDict[eFPSortedSRA[efp_length-c]].title);efp_table_column+="",$("#eFPtable").append(efp_table_column)}toggleResponsiveTable()}function generateEFPTableItem(id,title){return id&&title?`\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t${document.getElementById(id+"_svg").outerHTML}\n\t\t\t\t\t\n\t\t\t\t\t${id} - ${title}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t`:""}function change_rpkm_colour_scale(colouring_mode){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"==colouring_mode){const img_created=document.createElement("img");img_created.src="data:image/png;base64,"+relative_rpkm_scale,img_created.style="margin-top: 10px;",svg_colouring_element&&svg_colouring_element.appendChild(img_created)}else{const img_created=document.createElement("img");img_created.src="data:image/png;base64,"+absolute_rpkm_scale,img_created.style="margin-top: 10px;",img_created.alt="Absolute RPKM Scale",svg_colouring_element&&svg_colouring_element.appendChild(img_created)}const columnList=["colTitle","colRNA","colrpb","coleFP","colRPKM","colDetails"];let tds=[];document.getElementsByClassName("fltrow")&&document.getElementsByClassName("fltrow")[0]&&(tds=document.getElementsByClassName("fltrow")[0].getElementsByTagName("td"));for(let i=0;i=1&&loc[2]<=5||"C"==loc[2]||"M"==loc[2]||"c"==loc[2]||"m"==loc[2])&&("G"==loc[3]||"g"==loc[3])&&loc[4]>=0&&loc[4]<=9&&loc[5]>=0&&loc[5]<=9&&loc[6]>=0&&loc[6]<=9&&loc[7]>=0&&loc[7]<=9&&loc[8]>=0&&loc[8]<=9?$("#locus_button").removeAttr("disabled"):$("#locus_button").prop("disabled",!0)}function yscale_validation(){const yscale=document.getElementById("yscale_input").value;parseInt(yscale)>0||"Auto"==yscale||""==yscale?$("#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)}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 AuthUser=findAuthUser();""==users_email&&null==users_email&&null==users_email||users_email!==AuthUser?""!=users_email&&users_email!=AuthUser&&(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(get_xml_list_return){xml_title=void 0,match_title={},title_list=[];let unnamed_title_num=1,private_version_num=1;if(get_xml_list_output=get_xml_list_return,"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 i=0;i\n\t\t\t\t\t\t\t\t\t\t${title_list[c]}\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(xhr,status,error){generateToastNotification(`Error getting user data: ${error.message}`,"ERROR"),console.log(`Error getting user data: ${error.message}`)}})}let datalist=[],datalist_Title={};function create_data_list(size){if(datalist=[],datalist_Title={},size>0)for(let i=0;i{if(xhr.readyState===XMLHttpRequest.DONE&&200===xhr.status){let response=xhr.responseXML;if(response){let responseTitle=response.getElementsByTagName("files")[0].attributes.xmltitle.nodeValue;datalist_Title[responseTitle]=datalistData[dlCallPosition],dlCallPosition+=1,DatalistXHRCall(datalistData)}}},xhr.open("GET",url),xhr.send()}}function validateEmail(email){return/\S+@\S+\.\S+/.test(email)}function findAuthUser(){return global_user&&global_user.email?global_user.email:""}function check_if_Google_login(){const AuthUser=findAuthUser();users_email&&AuthUser&&users_email===AuthUser?!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 AuthUser=findAuthUser();user_exist?user_exist&&(dataset_dictionary[datasetName]?dataset_dictionary[datasetName]&&(users_email===AuthUser?(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!=AuthUser&&(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in"))):users_email===AuthUser?$.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!=AuthUser&&(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in"))):users_email===AuthUser?$.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!=AuthUser&&(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 AuthUser=findAuthUser();""!=users_email&&users_email===AuthUser?document.getElementById("upload_modal").click():""!=users_email&&users_email!=AuthUser?(signOut(),alert("Error occurred with your account, you have now been logged out. Please log back in")):""==users_email&&document.getElementById("upload_logX").click()}let public_title_list=[],total_amount_of_datasets=0;function delete_fill(){$("#delete_fill").empty(),$("#publicDatabaseDownload").empty(),public_title_list=[];for(let public_title in base_dataset_dictionary)base_dataset_dictionary.hasOwnProperty(public_title)&&public_title_list.push(public_title);let deleteBoxNum=0;total_amount_of_datasets=public_title_list.length+title_list.length;for(let i=0;i\n\t\t\t\t\t${public_title_list[i]}\n\t\t\t\t\n\t\t\t\t
    \n\t\t\t`),deleteBoxNum+=1;for(let i=0;i\n\t\t\t\t\t${title_list[i]}\n\t\t\t\t\n\t\t\t\t
    \n\t\t\t`),deleteBoxNum+=1}let isDeletePublicDisabled=!1;function disableDeletePublic(){for(let i=0;i\n\t\n",table_add+="\t\t"+fileTitle+"\n",table_add+=table_base,$title.each((function(){table_add+="\t\t\n";const title=$(this).attr("description");table_add+="\t\t\t"+title+"\n";const desc=$(this).attr("info");table_add+="\t\t\t"+desc+"\n";const record_number=$(this).attr("record_number");table_add+="\t\t\t"+record_number+"\n";const bam_link=$(this).attr("name");table_add+="\t\t\t"+bam_link+"\n";const bam_type=$(this).attr("bam_type");table_add+="\t\t\t"+bam_type+"\n";let bam_filename=$(this).attr("filename");null!=bam_filename&&"undefined"!==bam_filename&&".bam"!==bam_filename||(bam_filename="accepted_hits.bam"),table_add+="\t\t\t"+bam_filename+"\n";const publication_link=$(this).attr("publication_link");table_add+="\t\t\t"+publication_link+"\n";const publication_url=$(this).attr("url");table_add+="\t\t\t"+publication_url+"\n";let total_reads_mapped=$(this).attr("total_reads_mapped");null!=total_reads_mapped&&""!=total_reads_mapped||(total_reads_mapped="0"),table_add+="\t\t\t"+total_reads_mapped+"\n";const read_map_method=$(this).attr("read_map_method");table_add+="\t\t\t"+read_map_method+"\n";let species=$(this).attr("species");null!=species&&""!=species||(species="Arabidopsis thaliana"),table_add+="\t\t\t"+species+"\n";const svgname=$(this).attr("svgname");table_add+="\t\t\t"+svgname+"\n";const svg_subunit=$(this).attr("svg_subunit");table_add+="\t\t\t"+svg_subunit+"\n";let controlsXMLString="";if($(this).find("controls")[0].innerHTML)for(let j=1;j<$(this).find("controls")[0].childNodes.length;j+=2)$(this).find("controls")[0].childNodes[j].firstChild&&(controlsXMLString+=$(this).find("controls")[0].childNodes[j].firstChild.textContent,j<$(this).find("controls")[0].childNodes.length-2&&(controlsXMLString+=", "));table_add+="\t\t\t"+controlsXMLString+"\n";let RcontrolsXMLString="";if($(this).find("groupwith")[0].innerHTML)for(let j=1;j<$(this).find("groupwith")[0].childNodes.length;j+=2)$(this).find("groupwith")[0].childNodes[j].firstChild&&(RcontrolsXMLString+=$(this).find("groupwith")[0].childNodes[j].firstChild.textContent,j<$(this).find("groupwith")[0].childNodes.length-2&&(RcontrolsXMLString+=", "));table_add+="\t\t\t"+RcontrolsXMLString+"\n",table_add+="\t\t\n"})),table_add+="\t\n",document.getElementById("XMLtoCSVtable").innerHTML+=table_add},error:function(xhr,status,error){generateToastNotification(`Error filling data table: ${error.message}`,"ERROR"),console.log(`Error filling data table: ${error.message}`)}})}}function download_XMLtableCSV(){for(let i=0;i\n",downloadIndexTable_str+=downloadIndexTable_base;for(const sra of eFPSortedSRA)downloadIndexTable_str+="\t\t\n",downloadIndexTable_str+="\t\t\t"+sraDict[sra].title+"\n",downloadIndexTable_str+="\t\t\t"+sra+"\n",downloadIndexTable_str+="\t\t\t"+sraDict[sra].svg.substr(4,sraDict[sra].svg.length-8)+"\n",downloadIndexTable_str+="\t\t\t"+sraDict[sra].svg_part+"\n",downloadIndexTable_str+="\t\t\t"+sraDict[sra].locusValue+"\n",downloadIndexTable_str+="\t\t\t"+String(sraDict[sra].bp_length)+"\n",downloadIndexTable_str+="\t\t\t"+String(sraDict[sra].bp_start)+"\n",downloadIndexTable_str+="\t\t\t"+String(sraDict[sra].bp_end)+"\n",downloadIndexTable_str+="\t\t\t"+sraDict[sra].numberofreads+"\n",downloadIndexTable_str+="\t\t\t"+String(sraDict[sra].MappedReads)+"\n",downloadIndexTable_str+="\t\t\t"+sraDict[sra].rpb+"\n",downloadIndexTable_str+="\t\t\t"+String(sraDict[sra].RPKM[variantPosition].toFixed(2))+"\n",downloadIndexTable_str+="\t\t\t"+String(sraDict[sra].controlsString)+"\n",downloadIndexTable_str+="\t\t\n";downloadIndexTable_str+="\t\n",document.getElementById("hiddenDownloadModal_table").innerHTML+=downloadIndexTable_str,$("#hiddenDownloadModal_table").tableToCSV(),document.getElementById("download_icon").classList.remove("progressLoading"),document.getElementById("bodyContainer").classList.remove("progressLoading")}let publicData=!0;function changePublicData(forceFalse=!1){publicData=!forceFalse&&!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 property in base_dataset_dictionary){if(base_src===base_dataset_dictionary[property]){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(locusToVerify){if("string"==typeof locusToVerify){const regexPattern=new RegExp("^[A][T][MC0-9][G][0-9]{5}[.][0-9]{1,2}$|^[A][T][MC0-9][G][0-9]{5}$","i");return locusToVerify.trim().match(regexPattern)}return!1}let parse_output,GFF_List=[];function getGFF(locusID){GFF_List=[],$.ajax({url:`https://bar.utoronto.ca/webservices/bar_araport/gene_structure_by_locus.php?locus=${locusID}`,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(gene_res){if(parse_output=gene_res,parse_output.wasSuccessful){let parsed_features=parse_output.features[0].subfeatures;for(let i=0;i0)for(let i=0;i0){const locusID=document.getElementById("locus").value.trim().split("/");locusID[0]?document.getElementById("locus").value=locusID[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(id){html2canvas(document.getElementById(id)).then((canvas=>{$("#appendCanvas").empty(),canvas.id="downloadDivNum_"+downloadDivNum,document.getElementById("appendCanvas").appendChild(canvas),document.getElementById("downloadDivNum_"+downloadDivNum).style.width="100%",$("#DownloadImageModal").modal("toggle"),downloadDivNum++}))}function displayNavBAR(hideNavbar=!1){const displayNav=$("#navbar_menu").is(":visible")||hideNavbar;document.getElementById("navbar_menu").style.display=displayNav?"none":"block",document.getElementById("main_content").className=displayNav?"col-sm-12":"col-sm-9",document.getElementById("openMenu").style.display=displayNav?"block":"none",document.getElementById("theTable")&&(displayNav?document.getElementById("theTable").classList.add("RNATable"):document.getElementById("theTable").classList.remove("RNATable"))}function adjustFooterSize(){const navbar=document.getElementById("navbar_menu");navbar&&(document.getElementById("nm_footer").style.width=navbar.offsetWidth+"px",navbar.scrollHeight==navbar.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")):navbar.scrollHeight>navbar.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 iFrameSize=.7*window.innerHeight;document.getElementById("submissioniframe").height=iFrameSize+"px"}let usedToggle=!1;function toggleTableCol(colClass,enable){const column=document.getElementsByClassName(colClass);if(enable)for(const element of column)element&&element.removeAttribute("hidden");else if(!enable)for(const element of column)element&&element.setAttribute("hidden",!0)}let responsiveRNAWidthAdjusted=!1;function responsiveRNAWidthResize(){const responsive=document.getElementsByClassName("responsiveRNAWidth");if(window.innerWidth<=575){for(let i=0;i575&&responsiveRNAWidthAdjusted)for(let i=0;i=1100&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!0,!0,!0,!0,!1):3==forceToggle||window.innerWidth<830&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!1,!1,!1,!1,!1):4==forceToggle||window.innerWidth<900&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!0,!1,!1,!1,!1):5==forceToggle||window.innerWidth<990&&!usedToggle?toggleResponsiveTableOptions(!0,!0,!0,!1,!0,!1,!1):(6==forceToggle||window.innerWidth<1100&&!usedToggle)&&toggleResponsiveTableOptions(!0,!0,!0,!0,!0,!1,!1))}let ToggledTable=[!0,!0,!0,!0,!0,!0,!1];function RememberToggleOptions(title=!0,rna=!0,rpb=!0,efp=!0,rpkm=!0,details=!0,compare=!1){ToggledTable=[title,rna,rpb,efp,rpkm,details,compare]}const colSortList=["colTitle","colrpb","colRPKM","colDetails"];function ResizeArrowRow(){for(const col of colSortList){const colRow=col+"Row";document.getElementById(colRow).style.width=document.getElementById(colRow).parentNode.offsetWidth-2+"px";CheckElementWidth(col+"Arrow",8)}}function CheckElementWidth(arrowID,widthCheckFor){document.getElementById(arrowID).offsetWidth{-1!==navigator.userAgent.indexOf(agent)&&passLength++})),passLength!=failLength){detectBrowser=element,notDetectedBrowser=!1;break}}}if(detectBrowser){$("#notChrome").empty();const append_str=' or through the following Google search results';$("#notChrome").append(append_str)}BrowserDetected=!0}}function CreateFilteredeFPList(){if($("#filtereFPList").empty(),tissueSRADic){const allTissuesDisplayed=Object.keys(tissueSRADic);for(const tissue of allTissuesDisplayed){let append_str='
  • ';append_str+='',append_str+='

    '+tissue+"

    ",append_str+="
  • ",$("#filtereFPList").append(append_str)}}else logError("Unable to use tissueSRADic")}function ToggleFilteredeFP(whichToToggle,OnOrOff){const whichSVG=whichToToggle.replace("_"," "),whichSRA=tissueSRADic[whichSVG];if(!0===OnOrOff)for(let i=0;i1)if("locus"===queryInputs[0].split("%20").join(" ").trim()){const qIValue=input.substring(6).split("%20").join(" ").trim();shareLinkInputs.locus=qIValue,document.getElementById("locus").value=qIValue,locusInput=!0}else if("dataset"===queryInputs[0].split("%20").join(" ").trim()){const qIValue=input.substring(8).split("%20").join(" ").trim();shareLinkInputs.dataset=qIValue,base_src=qIValue,datasetInput=!0}}locusInput&&datasetInput?(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(locusInput&&!1===datasetInput?"ERROR IN SHARE LINK! Missing dataset":!1===locusInput&&datasetInput?"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(whatID,disableAll=!1){const whatSRA=whatID.split("_")[0];if(disableAll)disableAllComparison();else if(!1===disableAll&&document.getElementById(whatID)&&document.getElementById(whatID).checked){allCheckedOptions.push(whatSRA);const iterationProcess={};for(let i=0;i';parseInt(i)===parseInt(variantPosition)?append_str+=''+document.getElementById(whatSRA+"_title").innerHTML+" ... ("+GFF_List[i]+")\n":append_str+='^^^ ... ('+GFF_List[i]+")\n",append_str+='RNA-Seq mapped image for:'+whatSRA+'
    Gene variant image for:'+whatSRA+'\n',append_str+=''+sraDict[whatSRA].r[i].toFixed(2)+"",append_str+='
    '+document.getElementById(sraDict[whatSRA].svg.substr(4).replace(".svg","_svg")).innerHTML+'
    '+sraDict[whatSRA].svg.substring(4).replace(".svg","")+"
    \n",append_str+=''+sraDict[whatSRA].RPKM[i].toFixed(2)+"",parseInt(i)===parseInt(variantPosition)?append_str+='
    '+document.getElementById(whatSRA+"_description").innerHTML+'
    '+document.getElementById("igbLink_"+whatSRA).innerHTML+'
    '+document.getElementById("extraLinks_"+whatSRA).innerHTML+"
    \n":append_str+='^^^\n',append_str+="",iterationProcess[i]=whatSRA+"_compareRow"+i,document.getElementById("compareTable").innerHTML+=append_str,document.getElementById(whatSRA+"_rnaseq_img"+i)&&document.getElementById(whatSRA+"_rnaseq_img"+i).setAttribute("src",document.getElementById(whatSRA+"_rnaseq_img").src),document.getElementById(whatSRA+"_gene_structure_img"+i)&&document.getElementById(whatSRA+"_gene_structure_img"+i).setAttribute("src",document.getElementsByClassName("dd-option-image")[i].src),sraDict[whatSRA].RPKM&&sraDict[whatSRA].RPKM[i]&&colour_part_by_id(whatSRA+"_svg"+i,sraDict[whatSRA].svg_part,sraDict[whatSRA].RPKM[i],colouring_mode)}document.getElementById(whatID).checked=!0,document.getElementById("allCheckbox").checked=!0,"rel"!=colouring_mode&&(document.getElementById("compareGeneVariants").disabled=!1)}else!1===disableAll?(disableCompare(whatSRA),allCheckedOptions.splice(allCheckedOptions.indexOf(whatSRA),1),document.getElementById(whatID).checked=!1):!0===disableAll&&disableAllComparison(),0===allCheckedOptions.length&&(document.getElementById("compareGeneVariants").disabled=!0)}function disableCompare(whatSRA){for(let i=0;i=0;c--)document.getElementsByClassName("compareDataRow")[c].remove();allCheckedOptions=[],compareDataRows=document.getElementsByClassName("compareCheckbox");for(let c=0;c
    The eFP-Seq Browser's current version number is: ${version}`;document.getElementById(elementId).innerHTML+=versionText}function displayVersionNumber(){appendVersionNumber("citationText"),appendVersionNumber("feedbackText")}let toastCounter=0;function generateToastNotification(message,header="Notification"){if(message){let dataAttributeValue=`toast-${toastCounter}`;const toast=`\n\t\t\n\t\t`;document.getElementById("toast-container").innerHTML+=toast,$(`[data-toast="${dataAttributeValue}"]`).toast({autohide:!1}),$(`[data-toast="${dataAttributeValue}"]`).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(request,response){const last=request.term.split(/,\s*/).pop();$.ajax({type:"GET",url:"https://bar.utoronto.ca/webservices/eFP-Seq_Browser/idautocomplete.cgi?species=Arabidopsis_thaliana&term="+last,dataType:"json"}).done((function(data){data&&data.length>=7?response(data.slice(0,7)):response(data)}))},close:function(e,ui){correctAGIIDInput()}});const subiFrame=document.getElementById("submissioniframe");subiFrame&&subiFrame.setAttribute("src",subiFrame.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-lock.json b/package-lock.json index 075930b..820d5b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "efp-seq_browser", - "version": "1.3.15", + "version": "1.4.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "efp-seq_browser", - "version": "1.3.15", + "version": "1.4.0", "license": "GPL-2.0", "devDependencies": { "concurrently": "^8.2.2", diff --git a/package.json b/package.json index 442d3a8..7fa55f8 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "url": "https://bar.utoronto.ca/" } ], - "version": "1.3.15", + "version": "1.4.0", "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": {