1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[388],{17388:function(e,t,i){"use strict";i.r(t),i.d(t,{AtlasTable:function(){return N},BiospecimenTable:function(){return BiospecimenTable},CaseTable:function(){return CaseTable},DEFAULT_EXPLORE_PLOT_OPTIONS:function(){return X},Explore:function(){return em},ExplorePlot:function(){return z},ExploreSummary:function(){return ExploreSummary},ExploreTab:function(){return n},ExploreTabs:function(){return eo},FileFilterControls:function(){return eu},FileTable:function(){return ea},LevelSelect:function(){return $},SimpleScrollPane:function(){return SimpleScrollPane},doesFileIncludeLevel1OrLevel2SequencingData:function(){return doesFileIncludeLevel1OrLevel2SequencingData},generateColumnsForDataSchema:function(){return P.GV},generatePublicationPageTabUrl:function(){return P.YE},getAtlasColumn:function(){return P.xZ},getDefaultSummaryData:function(){return getDefaultSummaryData},getExploreChartOptions:function(){return getExploreChartOptions},getPublicationColumn:function(){return P.EP},getSummaryData:function(){return getSummaryData},makeListColumn:function(){return makeListColumn},sortByBiospecimenId:function(){return P.Re},sortByParentID:function(){return P.nc},sortByParticipantId:function(){return P.d_},truncatedTableCell:function(){return P.jw}});var s,a,n,l,r,o,c=i(75766),d=i(10092),u=i(85893),p=i(96486),h=i.n(p),m=i(95868),g=i(67294),b=i(29323),y=i(68949),v=i(94184),f=i.n(v),C=i(67814),S=i(59417),x=i(35005),D=i(42563),A=i(47150),w=i(83747),F=i(28267);(s=n||(n={})).FILE="file",s.ATLAS="atlas",s.BIOSPECIMEN="biospecimen",s.CASES="cases",s.PUBLICATION="publication",s.PLOTS="plots";let MetaDataLink=e=>(0,u.jsx)("a",{href:"".concat(e.baseUrl,"/metadata/").concat(e.id,".csv"),download:!0,"aria-label":"Download metadata for ".concat(e.id),children:(0,u.jsx)(C.G,{icon:S.q7m})}),j="https://cell-explorer.cbioportal.org",T={"HTAN CHOP":[{slug:"htan-chop-phgg",name:"Pediatric High-Grade Glioma"},{slug:"htan-chop-nbl",name:"High-Risk Neuroblastoma"},{slug:"htan-chop-ball",name:"Infant KMT2Ar B-ALL"}],"HTAN MSK":[{slug:"htan-msk-sclc",name:"Small Cell Lung Cancer"},{slug:"htan-msk-treg",name:"Regulatory T Cells in the TME"},{slug:"crc-metastasis",name:"Progressive Plasticity During CRC Metastasis"}],"HTAN HTAPP":[{slug:"htan-htapp-brca",name:"Breast Cancer Metastatic Microenvironment"}],"HTAN Vanderbilt":[{slug:"htan-vumc-crc",name:"Pre-Malignant Colorectal Programs"}]},AtlasMetadataLinkModal=e=>(0,u.jsx)(D.Z,{show:e.isOpen,onHide:e.onClose,children:e.atlas&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(D.Z.Header,{closeButton:!0,children:(0,u.jsxs)(D.Z.Title,{children:["Download ",(0,u.jsx)("strong",{children:e.atlas.htan_name})," ","Metadata"]})}),(0,u.jsxs)(D.Z.Body,{children:[(0,u.jsxs)("table",{className:"table table-striped",children:[(0,u.jsx)("thead",{children:(0,u.jsxs)("tr",{children:[(0,u.jsx)("th",{className:"text-center",children:"Download"}),(0,u.jsx)("th",{children:"Category"}),(0,u.jsx)("th",{className:"text-right",children:"Num Items"})]})}),(0,u.jsx)("tbody",{children:h().chain(e.atlasMetaData[e.atlas.htan_id]).map(t=>({row:(0,u.jsxs)("tr",{children:[(0,u.jsx)("td",{className:"text-center",children:(0,u.jsx)(MetaDataLink,{id:t.synapseId,baseUrl:e.cloudBaseUrl})}),(0,u.jsx)("td",{children:t.component}),(0,u.jsx)("td",{className:"text-right",children:t.numItems})]}),component:t.component})).sortBy(e=>e.component).map(e=>e.row).value()})]}),(0,u.jsxs)("span",{children:["You can also explore the metadata in"," ",(0,u.jsx)("a",{target:"_blank",href:"https://bq-search.isb-cgc.org/search?datasetId=%22htan%22&projectId=isb-cgc-bq",children:"Google BigQuery"}),"."]})]}),(0,u.jsx)(D.Z.Footer,{children:(0,u.jsx)(x.Z,{variant:"secondary",onClick:e.onClose,children:"Close"})})]})}),ViewerCount=e=>{var t,i;let s=null===(t=e.atlas.viewerCounts)||void 0===t?void 0:t[e.fileViewerName],a=(0,A.UG)([{group:"viewersArr",value:e.fileViewerName},{group:"AtlasName",value:e.atlas.htan_name}]),n=null===(i=e.hrefOverride)||void 0===i?void 0:i[e.atlas.htan_name];return(0,u.jsx)(u.Fragment,{children:(0,u.jsx)(m.Z,{overlay:e.tooltipContent,children:(0,u.jsx)("span",{className:"ml-auto",style:{wordBreak:"normal"},children:s>0&&(0,u.jsx)("a",{href:n||"/explore/phase1?selectedFilters=".concat(a,"&tab=file"),target:"_blank",children:s})})})})};function filteredCount(e,t,i){return t?"".concat((i[e.htan_id]||[]).length,"/"):""}let N=class extends g.Component{get selectedAtlases(){return h().keyBy(this.props.selectedAtlases||[],e=>e.htan_id)}get hasAtlasesSelected(){return(this.props.selectedAtlases||[]).length>0}getData(e,t){return(null==e?void 0:e.map(e=>({...e,isSelected:this.isRowSelected(e),publicationManifests:this.getPublicationManifests(e),viewerCounts:this.getViewerCounts(e,t)})))||[]}getFilesByAtlas(e){return h().groupBy(e,e=>e.atlasid)}getAssaysByAtlas(e){return h().mapValues(e,e=>h()(e).map(e=>
1e.assayName).uniq().compact().value())}getCasesByAtlas(e){return h().groupBy(e,e=>e.atlasid)}getBiospecimensByAtlas(e){return h().groupBy(e,e=>e.atlasid)}getShouldShowFilteredFractions(e){return!h().isEmpty(e)}getColumns(e,t,i,s,a,n,l,r){return[{name:"Atlas Name",selector:e=>{var t,i;return null===(i=e.htan_name)||void 0===i?void 0:null===(t=i.replace("HTAN ",""))||void 0===t?void 0:t.replace(" - "," ")},grow:.6,minWidth:"50",wrap:!0,sortable:!0},{name:"Atlas ID",selector:e=>{var t;return null===(t=e.htan_id)||void 0===t?void 0:t.toUpperCase()},wrap:!0,sortable:!0,omit:!0},{name:"Lead Institution",selector:e=>{var t;return null===(t=e.AtlasMeta)||void 0===t?void 0:t.lead_institutions},grow:1.6,wrap:!0,sortable:!0,omit:!0},{name:"Atlas Description",selector:e=>{var t,i;return null===(i=e.AtlasMeta)||void 0===i?void 0:null===(t=i.title)||void 0===t?void 0:t.rendered},format:e=>e.AtlasMeta&&(0,u.jsx)(F.m9,{atlasMeta:e.AtlasMeta}),grow:2,wrap:!0,sortable:!0},{name:"Publications",grow:.5,selector:"publication",cell:e=>e.publicationManifests.length>0?e.publicationManifests.map(e=>(0,u.jsx)(F.ZI,{publicationManifest:e})):(0,u.jsx)(m.Z,{overlay:"Publication Page Coming Soon",children:(0,u.jsx)("a",{href:"/publications",style:{filter:"grayscale(1)"},children:(0,u.jsx)(C.G,{icon:S.FL8})})})},{name:"Metadata",grow:.1,selector:"htan_id",cell:t=>t.htan_id in(e||{})?(0,u.jsx)("button",{className:"btn btn-sm",onClick:(0,y.action)(()=>{this.metadataModalAtlas=t}),children:(0,u.jsx)(C.G,{icon:S.q7m})}):(0,u.jsx)("span",{children:"None"})},{name:"Cases",selector:e=>Number(e.num_cases),grow:.01,cell:e=>(0,u.jsxs)("span",{className:"ml-auto",children:[filteredCount(e,t,i),e.num_cases]}),sortable:!0,right:!0},{name:"Biospecimens",selector:e=>Number(e.num_biospecimens),grow:.7,right:!0,cell:e=>(0,u.jsxs)("span",{className:"ml-auto",children:[filteredCount(e,t,s),e.num_biospecimens]}),sortable:!0},{name:"Assays",grow:.5,right:!0,selector:e=>(a[e.htan_id]||[]).length,cell:e=>(0,u.jsxs)("span",{className:"ml-auto",children:[filteredCount(e,t,n),(a[e.htan_id]||[]).length]}),sortable:!0,omit:!0},{name:"Files",right:!0,grow:.6,selector:e=>(l[e.htan_id]||[]).length,cell:e=>(0,u.jsxs)("span",{className:"ml-auto",children:[filteredCount(e,t,r),(l[e.htan_id]||[]).length]}),sortable:!0,omit:!0},{name:(0,u.jsx)(u.Fragment,{children:(0,u.jsx)(m.Z,{overlay:"Autominerva: explore autogenerated views for imaging data",children:(0,u.jsx)("span",{className:"ml-auto",children:(0,u.jsx)("img",{width:20,src:"https://user-images.githubusercontent.com/1334004/159789346-b647c772-48fe-4652-8d2b-3eecf6690f1f.png",style:{float:"right"}})})})}),id:"Autominerva",selector:"htan_id",grow:.5,right:!0,minWidth:"50",cell:e=>(0,u.jsx)(ViewerCount,{atlas:e,fileViewerName:F.Iq.autoMinerva,tooltipContent:"Autominerva: explore autogenerated views for imaging data"})},{name:(0,u.jsx)(u.Fragment,{children:(0,u.jsx)(m.Z,{overlay:"Minerva Story: explore curated stories for imaging data",children:(0,u.jsx)("span",{className:"ml-auto",children:(0,u.jsx)("img",{width:20,src:"https://user-images.githubusercontent.com/1334004/156241219-a3062991-ba9d-4201-ad87-3c9c1f0c61d8.png"})})})}),id:"Minerva Story",selector:"htan_id",grow:.1,right:!0,minWidth:"5",cell:e=>(0,u.jsx)(ViewerCount,{atlas:e,fileViewerName:F.Iq.customMinerva,tooltipContent:"Minerva Story",hrefOverride:{"HTAN OHSU":"https://minerva-story-htan-ohsu-demo.surge.sh/"}})},{name:(0,u.jsx)(u.Fragment,{children:(0,u.jsx)(m.Z,{overlay:"CellxGene: explore single cell data",children:(0,u.jsx)("span",{className:"ml-auto",children:(0,u.jsx)("img",{width:20,src:"https://pbs.twimg.com/profile_images/1285714433981812736/-wuBO62N_400x400.jpg"})})})}),id:"CellxGene",selector:"htan_id",grow:.1,right:!0,minWidth:"10",cell:e=>(0,u.jsx)(ViewerCount,{atlas:e,fileViewerName:F.Iq.cellxgene,tooltipContent:"CellxGene: explore single cell data",hrefOverride:{"HTAN Vanderbilt":"https://cellxgene.cziscience.com/collections/a48f5033-3438-4550-8574-cdff3263fdfd","HTAN BU":"https://cellxgene.cziscience.com/d/BFAA0C46-7E34-4FA9-B08C-6DC6013B735A.cxg/"}})},{name:(0,u.jsx)(u.Fragment,{children:(0,u.jsx)(m.Z,{overlay:"ISB-CGC BigQuery: explore single cell data in Google BigQuery",children:(0,u.jsx)("span",{className:"ml-auto",children:(0,u.jsx)("img",{width:20,src:"https://user-images.githubusercontent.com/2837859/179311013-a1d0046c-de21-400c-993e-32372a080be4.png"})})})}),id:"ISB-CGC BigQuery",selector:"htan_id",grow:.1,right:!0,minWidth:"10",cell:e=>(0,u.jsx)(ViewerCount,{atlas:e,fileViewerName:F.Iq.isbcgc,tooltipContent:"ISB-CGC BigQuery: explore single cell data in Google BigQuery"})},{name:(0,u.jsx)(u.Fragment,{children:(0,u.jsx)(m.Z,{overlay:"UCSC Xena: explore single cell and imaging data",children:(0,u.jsx)("span",{className:"ml-auto",children:(0,u.jsx)("img",{width:20,src:"https://xen
1a.ucsc.edu/icons-9ac0cb8372f662ad72d747b981120f73/favicon-48x48.png"})})})}),id:"UCSC Xena",selector:"htan_id",grow:.1,right:!0,minWidth:"10",cell:e=>(0,u.jsx)(ViewerCount,{atlas:e,fileViewerName:F.Iq.ucscXena,tooltipContent:"UCSC Xena: explore single cell and imaging data",hrefOverride:{"HTAN HMS":"https://beta.xenabrowser.net/singlecell/?hub=https://previewsinglecell.xenahubs.net:443&defaultTable=htan","HTAN MSK":"https://beta.xenabrowser.net/singlecell/?hub=https://previewsinglecell.xenahubs.net:443&defaultTable=htan&study=msk_sclc_chan_2021"}})},{name:(0,u.jsx)(u.Fragment,{children:(0,u.jsx)(m.Z,{overlay:(0,u.jsx)(u.Fragment,{children:"cBioPortal: explore multimodal cancer data"}),children:(0,u.jsx)("img",{width:20,src:"https://avatars.githubusercontent.com/u/9876251?s=20&v=4"})})}),id:"cBioPortal: explore multimodal cancer data",selector:"htan_id",grow:.1,right:!0,minWidth:"10",cell:e=>{let t=T[e.htan_name]||[],i="HTAN OHSU"===e.htan_name?"https://www.cbioportal.org/patient?studyId=brca_hta9_htan_2022&caseId=HTA9_1":"HTAN Vanderbilt"===e.htan_name?"https://www.cbioportal.org/study/summary?id=crc_hta11_htan_2021":null;return i?(0,u.jsx)(m.Z,{overlay:"cBioPortal: explore multimodal cancer data",children:(0,u.jsx)("span",{className:"ml-auto",children:(0,u.jsx)("a",{href:i,target:"_blank",children:"1"})})}):t.length>0?(0,u.jsx)(m.Z,{overlay:(0,u.jsxs)(u.Fragment,{children:["Cell Explorer:"," ",t.map(e=>e.name).join(", ")]}),children:(0,u.jsx)("span",{className:"ml-auto",children:(0,u.jsx)("a",{href:1===t.length?"".concat(j,"/collections/").concat(t[0].slug):j,target:"_blank",children:t.length})})}):null}}]}render(){var e,t;let i=this.getFilesByAtlas(this.props.files),s=this.getAssaysByAtlas(i),a=this.getFilesByAtlas(this.props.filteredFiles),n=this.getAssaysByAtlas(a),l=this.getCasesByAtlas(this.props.filteredCases),r=this.getBiospecimensByAtlas(this.props.filteredBiospecimens),o=this.getShouldShowFilteredFractions(this.props.selectedFiltersByAttrName),c=this.getData(this.props.filteredAtlases,a),d=this.getColumns(this.atlasMetaData,o,l,r,s,n,i,a);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(w.Nz,{customControls:(0,u.jsxs)("button",{className:f()("btn btn-primary",this.hasAtlasesSelected?"":"invisible"),disabled:!this.hasAtlasesSelected,onMouseDown:this.onViewFiles,children:[(0,u.jsx)(C.G,{icon:S.q7m})," ","View files for ".concat(null===(e=this.props.selectedAtlases)||void 0===e?void 0:e.length," selected ").concat((null===(t=this.props.selectedAtlases)||void 0===t?void 0:t.length)===1?"atlas":"atlases")]}),columns:d,defaultSortField:"AtlasMeta.lead_institutions",data:c,selectableRows:!0,onSelectedRowsChange:this.onSelect,selectableRowSelected:e=>e.isSelected,striped:!0,noHeader:!0,customStyles:(0,w.Ek)()}),(0,u.jsx)(AtlasMetadataLinkModal,{isOpen:null!==this.metadataModalAtlas,onClose:(0,y.action)(()=>{this.metadataModalAtlas=null}),atlas:this.metadataModalAtlas,atlasMetaData:this.atlasMetaData,cloudBaseUrl:this.props.cloudBaseUrl})]})}constructor(e){super(e),(0,c._)(this,"metadataModalAtlas",null),(0,c._)(this,"atlasMetaData",void 0),(0,c._)(this,"isRowSelected",e=>void 0!==this.selectedAtlases[e.htan_id]),(0,c._)(this,"getPublicationManifests",e=>h()(this.props.publications).filter(t=>!(0,F.Fq)(t)&&t.atlasid===e.htan_id).sortBy([e=>e.YearofPublication,e=>
1e.PMID]).value()),(0,c._)(this,"getViewerCounts",(e,t)=>h()(t[e.htan_id]).map(e=>(0,F.G5)(e)).flatten().countBy().value()),(0,c._)(this,"onSelect",e=>{this.props.onSelectAtlas&&this.props.onSelectAtlas(e.selectedRows)}),(0,c._)(this,"onViewFiles",e=>{e.preventDefault(),this.props.setTab(n.FILE)}),(0,y.makeObservable)(this),this.atlasMetaData=this.props.getAtlasMetaData()}};(0,d.gn)([y.observable],N.prototype,"metadataModalAtlas",void 0),(0,d.gn)([y.action],N.prototype,"onSelect",void 0),(0,d.gn)([y.action],N.prototype,"onViewFiles",void 0),N=(0,d.gn)([b.Pi],N);var I=i(51807),P=i(37915);let L={SourceHTANBiospecimenID:"Source HTAN Biospecimen ID",ParticipantID:"Participant ID",AdjacentBiospecimenIDs:"Adjacent Biospecimen IDs",ProtocolLink:"Protocol Link",SiteDataSource:"Site Data Source",CollectionMedia:"Collection Media",MountingMedium:"Mounting Medium",ProcessingLocation:"Processing Location",HistologyAssessmentBy:"Histology Assessment By",HistologyAssessmentMedium:"Histology Assessment Medium",PreinvasiveMorphology:"Preinvasive Morphology",TumorInfiltratingLymphocytes:"Tumor Infiltrating Lymphocytes",DegreeofDysplasia:"Degree of Dysplasia",DysplasiaFraction:"Dysplasia Fraction",NumberProliferatingCells:"Number Proliferating Cells",PercentEosinophilInfiltration:"Percent Eosinophil Infiltration",PercentGranulocyteInfiltration:"Percent Granulocyte Infiltration",PercentInflamInfiltration:"Percent Inflam Infiltration",PercentLymphocyteInfiltration:"Percent Lymphocyte Infiltration",PercentMonocyteInfiltration:"Percent Monocyte Infiltration",PercentNecrosis:"Percent Necrosis",PercentNeutrophilInfiltration:"Percent Neutrophil Infiltration",PercentNormalCells:"Percent Normal Cells",PercentStromalCells:"Percent Stromal Cells",PercentTumorCells:"Percent Tumor Cells",PercentTumorNuclei:"Percent Tumor Nuclei",FiducialMarker:"Fiducial Marker",SlicingMethod:"Slicing Method",LysisBuffer:"Lysis Buffer",MethodofNucleicAcidIsolation:"Method of Nucleic Acid Isolation",AcquisitionMethodOtherSpecify:"Acquisition Method Other Specify",AnalyteType:"Analyte Type",FixationDuration:"Fixation Duration",HistologicMorphologyCode:"Histologic Morphology Code",IschemicTemperature:"Ischemic Temperature",IschemicTime:"Ischemic Time",PortionWeight:"Portion Weight",PreservationMethod:"Preservation Method",SectionThicknessValue:"Section Thickness Value",SectioningDaysfromIndex:"Sectioning Days from Index",ShippingConditionType:"Shipping Condition Type",SlideChargeType:"Slide Charge Type",SpecimenLaterality:"Specimen Laterality",TotalVolume:"Total Volume",TumorTissueType:"Tumor Tissue Type",BiospecimenDimension1:"Biospecimen Dimension 1",BiospecimenDimension2:"Biospecimen Dimension 2",BiospecimenDimension3:"Biospecimen Dimension 3",DimensionsUnit:"Dimensions Unit",SectionNumberinSequence:"Section Number in Sequence",TotalVolumeUnit:"Total Volume Unit",TopographyCode:"Topography Code",AdditionalTopography:"Additional Topography",synapseId:"Synapse ID",level:"Level",atlasid:"Atlas ID"},BiospecimenTable=e=>{let t=[{name:"HTAN Biospecimen ID",selector:I.XL.BiospecimenID,sortFunction:P.Re,sortable:!0},{name:"Atlas Name",selector:"atlas_name",sortable:!0},(0,P.EP)(e.publicationsByUid),{name:"HTAN Parent ID",selector:"HTANParentID",sortFunction:P.nc,sortable:!0},{name:"Timepoint Label",selector:"TimepointLabel",sortable:!0},{name:"Collection Days from Index",selector:"CollectionDaysfromIndex",sortable:!0},{name:"Biospecimen Type",selector:"BiospecimenType",sortable:!0},{name:"Acquisition Method Type",selector:"AcquisitionMethodType",sortable:!0},{name:"Fixative Type",selector:"FixativeType",sortable:!0},{name:"Storage Method",selector:"StorageMethod",sortable:!0},{name:"Processing Days from Index",selector:"ProcessingDaysfromIndex",sortable:!0},...h()(L).toPairs().map(e=>{let[t,i]=e;return{name:i,selector:t,sortable:!0,omit:!0}}).value()];return(0,u.jsx)(w.Nz,{defaultSortField:I.XL.BiospecimenID,columns:t,data:e.samples,striped:!0,dense:!1,noHeader:!0,pagination:!0,paginationPerPage:50,paginationRowsPerPageOptions:[10,20,50,100,500],customStyles:(0,w.Ek)()})},M=[{name:"HTAN Participant ID",selector:I.XL.ParticipantID,sortable:!0,sortFunction:P.d_},{name:"Atlas Name",selector:"atlas_name",sortable:!0},{name:"Age at Diagnosis (years)",headerTooltip:"Age at the time of diagnosis expressed in number of years since birth.",format:e=>(0,I.xn)(e.AgeatDiagnosis),cell:e=>(0,u.jsx)("span",{className:"ml-auto",children:(0,I.xn)(e.AgeatDiagnosis)}),sortable:!0},{name:"Primary Diagnosis",selector:"PrimaryDiagnosis",sortable:!0},{name:"Site of Resection or Biopsy",selector:"SiteofResectionorBiopsy",sortable:!0},{name:"Tissue or Organ of Origin",selector:"TissueorOrganofOrigin",sortable:!0},{name:"Morphology",selector:"Morphology",sortable:!0},{name:"Last Known Disease Status",selector:"LastKnownDiseaseStatus",sortable:!0},{name:"Progression or Recurrence Type",selector:"ProgressionorRecurrenceType",sortable:!0},{name:"Days to Last Followup",selector:"DaystoLastFollowup",sortable:!0},{name:"Days to Last Known Disease Status",selector:"DaystoLastKnownDiseaseStatus",sortable:!0},{name:"Ethnicity",selector:"Ethnicity",sortable:!0},{name:"Gender",selector:"Gender",sortable:!0},{name:"Race",selector:"Race",sortable:!0},...h()({VitalStatus:"Vital Status",DaystoBirth:"Days To Birth",CountryofResidence:"Country Of Residence",AgeIsObfuscated:"Age Is Obfuscated",YearOfBirth:"Year Of Birth",OccupationDurationYears:"Occupation Duration Years",PrematureAtBirth:"Premature At Birth",WeeksGestationatBirth:"Weeks Gestationat Birth",CauseofDeath:"Cause of Death",CauseofDeathSource:"Cause of Death Source",DaystoDeath:"Days to Death",YearofDeath:"Year of Death",EducationLevel:"EducationLevel",MedicallyUnderservedArea:"Medically Underserved Area",RuralvsUrban:"Rural vs Urban",YearofDiagnosis:"Year Of Diagnosis",PrecancerousConditionType:"Precancerous Condition Type",TumorGrade:"Tumor Grade",ProgressionorRecurrence:"Progression or Recurrence",MethodofDiagnosis:"Method of Diagnosis",PriorMalignancy:"Prior Malignancy",PriorTreatment:"Prior Treatment",MetastasisatDiagnosis:"Metastasis at Diagnosis",MetastasisatDiagnosisSite:"Metastasis at Diagnosis Site",FirstSymptomPriortoDiagnosis:"First Symptom Prior to Diagnosis",DaystoDiagnosis:"Days to Diagnosis",PercentTumorInvasion:"Percent Tumor Invasion",ResidualDisease:"Residual Disease",SynchronousMalignancy:"Synchronous Malignancy",TumorConfinedtoOrganofOrigin:"Tumor Confined to Organ of Origin",TumorFocality:"Tumor Focality",TumorLargestDimensionDiameter:"Tumor Largest Dimension Diameter",BreslowThickness:"Breslow Thickness",VascularInvasionPresent:"Vascular Invasion Present",VascularInvasionType:"Vascular Invasion Type",AnaplasiaPresent:"Anaplasia Present",AnaplasiaPresentType:"Anaplasia Present Type",Laterality:"Laterality",PerineuralInvasionPresent:"Perineural Invasion Present",LymphaticInvasionPresent:"Lymphatic Invasion Present",LymphNodesPositive:"Lymph Nodes Positive",LymphNodesTested:"Lymph Nodes Tested",PeritonealFluidCytologicalStatus:"Peritoneal Fluid Cytological Status",ClassificationofTumor:"Classification of Tumor",BestOverallResponse:"Best Overall Response",MitoticCount:"Mitotic Count",AJCCClinicalM:"AJCC Clinical M",AJCCClinicalN:"AJCC Clinical N",AJCCClinicalStage:"AJCC Clinical Stage",AJCCClinicalT:"AJ
1CC Clinical T",AJCCPathologicM:"AJCC Pathologic M",AJCCPathologicN:"AJCC Pathologic N",AJCCPathologicStage:"AJCC Pathologic Stage",AJCCPathologicT:"AJCC Pathologic T",AJCCStagingSystemEdition:"AJCC Staging System Edition",CogNeuroblastomaRiskGroup:"Cog Neuroblastoma Risk Group",CogRhabdomyosarcomaRiskGroup:"Cog Rhabdomyosarcoma Risk Group",GreatestTumorDimension:"Greatest Tumor Dimension",IGCCCGStage:"IGCCCG Stage",INPCGrade:"INPC Grade",INPCHistologicGroup:"INPC Histologic Group",INRGStage:"INRG Stage",INSSStage:"INSS Stage",IRSGroup:"IRS Group",IRSStage:"IRS Stage",ISSStage:"ISS Stage",LymphNodeInvolvedSite:"Lymph Node Involved Site",MarginDistance:"Margin Distance",MicropapillaryFeatures:"Micropapillary Features",PregnantatDiagnosis:"Pregnant at Diagnosis",SupratentorialLocalization:"Supratentorial Localization",TumorDepth:"Tumor Depth",WHOCNSGrade:"WHOCNS Grade",DaystoProgression:"Days to Progression",DaystoProgressionFree:"Days to Progression Free",DaystoRecurrence:"Days to Recurrence",GeneSymbol:"Gene Symbol",MolecularAnalysisMethod:"Molecular Analysis Method",TestResult:"Test Result",synapseId:"Synapse ID",level:"Level",atlasid:"Atlas ID"}).toPairs().map(e=>{let[t,i]=e;return{name:i,selector:t,sortable:!0,omit:!0}}).value()],CaseTable=e=>{let t=["AFR","AMR","EAS","EUR","SAS"].map(e=>({id:e,selector:e,omit:!0,wrap:!0,sortable:!0,searchable:!1,cell:t=>{let i=Number(t[e]);return 0===i||h().isNaN(i)?void 0:i<.001?i.toExponential(4):i.toFixed(6)},name:"".concat(e," Genomic Ancestry")})),i=[...M.slice(0,2),(0,P.EP)(e.publicationsByUid),...M.slice(2),...t];return(0,u.jsx)(w.Nz,{columns:i,defaultSortField:I.XL.ParticipantID,data:e.cases,striped:!0,dense:!1,noHeader:!0,pagination:!0,paginationPerPage:50,paginationRowsPerPageOptions:[10,20,50,100,500],customStyles:(0,w.Ek)()})};var B=i(42257),k=i.n(B),_=i(8810),O=i(23450),E=i.n(O),R=i(53788),U=i.n(R);E().addPluralRule(/specimen$/i,"specimens");let ExploreSummary=e=>(0,u.jsx)(u.Fragment,{children:(0,u.jsxs)("div",{className:U().summary,children:[(0,u.jsx)("div",{children:(0,u.jsx)("strong",{children:"Summary:"})}),e.summaryData.map(e=>(0,u.jsx)("div",{children:E()(e.displayName,e.values.length,!0)},e.displayName))]})});var G=i(46670),q=i(92758),V=i(6673),H=i(3532),Z=i(14479),W=i(73091),J=i(18059);function getExploreChartOptions(e,t){let i=h().chain(e).flatMap(h().entries).reduce((e,t)=>{let[i,s]=t;return s&&e.push(i),e},[]).uniq().map(e=>({value:e,label:e+":Case",data:{type:"CASE"}})).value(),s=h().chain(t).flatMap(h().entries).reduce((e,t)=>{let[i,s]=t;return null!=s&&e.push(i),e},[]).uniq().map(e=>({value:e,label:e+":Sample",data:{type:"SAMPLE"}})).value();return[...i,...s]}function dependentAxisTickFormat(e){return h().isInteger(Math.log10(e))?e:""}(a=l||(l={})).SAMPLE="SAMPLE",a.CASE="CASE";let X=[{value:"TissueorOrganofOrigin",label:"Organ",table:"diagnosis",data:{type:"CASE"}},{value:"PrimaryDiagnosis",label:"Primary Diagnosis",table:"diagnosis",data:{type:"CASE"}},{value:"Ethnicity",label:"Ethnicity",table:"cases",data:{type:"CASE"}},{value:"Gender",table:"cases",label:"Gender",data:{type:"CASE"}},{value:"Race",table:"cases",label:"Race",data:{type:"CASE"}}],z=(0,b.Pi)(function(e){let{selectedField:t,width:i=800,logScale:s,metricType:a,hideNA:n,query:l}=e,r="ParticipantID"===a.value?"CASE":"SAMPLE",o=(0,G.hN)(()=>({plotData:new(k())({invoke:async()=>{let e=l||(0,F.r$)({field:t.value,table:t.table,filterString:""}),i=await (0,F.Rf)(e);return i.forEach(e=>{e.count=parseInt(e.count)}),h().orderBy(i,"count")}})}));if(!o.plotData.isComplete)return(0,u.jsx)(u.Fragment,{});t.value;let c=o.plotData.result,d=[];c&&c.length&&(d=h().times(Math.ceil(Math.log10(c[c.length-1].count)),e=>10**(e+1)));let p=s?{tickFormat:dependentAxisTickFormat,tickValues:d}:{},m="".concat(t.label," ").concat("SAMPLE"===r?"#Samples ".concat(s?"(log)":""):"#Cases ".concat(s?"(log)":""));return(0,u.jsx)(u.Fragment,{children:(0,u.jsxs)(q.Z,{theme:V.Z.material,width:i,height:30*c.length+100,containerComponent:(0,u.jsx)(H.Z,{responsive:!1}),domainPadding:{x:30,y:100},singleQuadrantDomainPadding:{y:!0,x:!1},padding:{left:0,top:70,right:100},minDomain:{y:.95},scale:{y:s?"log":"linear",x:"linear"},children:[(0,u.jsx)(W.Z,{dependentAxis:!0,label:m,...p,orientation:"top",style:{ticks:{size:10},tickLabels:{fontSize:10},axisLabel:{fontSize:15,padding:40},grid:{stroke:"none"}}}),(0,u.jsx)(J.Z,{horizontal:!0,data:c,x:e=>e.label,labelComponent:(0,u.jsx)(Z.Z,{text:e=>"".concat(e.datum.label," (").concat(e.datum.count,")")}),barWidth:20,y:"count",style:{labels:{fontSize:12},data:{fill:"#11c8d4"}}})]})})});
1var Q=i(35823),Y=i.n(Q);function SimpleScrollPane(e){let t={style:{width:e.width,height:e.height,overflow:"scroll",...e.style}};return e.className&&(t.className=e.className),(0,u.jsx)("div",{...t,children:e.children})}function makeListColumn(e,t){return{name:(0,w.ab)(e),selector:t=>t[e],cell:i=>{let s=i[e],a=s?h().uniq(s.split(",")):[];return 0===a.length?"":1===a.length?a[0]:(0,u.jsx)(m.Z,{overlay:(0,u.jsx)(SimpleScrollPane,{width:150,height:150,style:{background:"white",color:"black",padding:"5px 10px 5px 10px"},children:(0,I.f_)(a,(0,u.jsx)("br",{}))}),children:(0,u.jsxs)("span",{children:[a.length," ",t]})})},wrap:!0,sortable:!0}}var K=i(6852);let $=(o=class extends(r=g.Component){get placeholder(){return this.props.placeholder||"Level"}get selectedOptions(){return(this.props.selectedLevels||[]).map(e=>({value:e,label:(0,u.jsx)("span",{children:e})}))}get options(){var e;return((null===(e=this.props.allLevels)||void 0===e?void 0:e.sort())||[]).map(e=>({value:e,label:(0,u.jsx)("span",{children:e})}))}render(){return(0,u.jsx)("div",{style:{width:this.props.width,justifySelf:"flex-end"},children:(0,u.jsx)(K.ZP,{classNamePrefix:"react-select",isSearchable:!1,isClearable:!1,name:this.props.name,placeholder:this.placeholder,controlShouldRenderValue:!1,isMulti:!0,options:this.options,hideSelectedOptions:!1,closeMenuOnSelect:!1,onChange:this.onChange,value:this.selectedOptions})})}onChange(e){this.props.onLevelToggled&&this.props.onLevelToggled(e.map(e=>e.value))}constructor(e){super(e),(0,y.makeObservable)(this)}},(0,c._)(o,"defaultProps",{name:"dataLevels",width:180}),o);(0,d.gn)([y.action.bound],$.prototype,"onChange",null);var ee=$=(0,d.gn)([b.Pi],$),et=i(47058),ei=i.n(et);let es="Metadata";function escapeSqlValue(e){return e.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}function getDrsUri(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"drs://nci-crdc.datacommons.io/",a=e;return(t||i)&&(a=null==a?void 0:a.replace(s,"")),i&&a&&(a="".concat(s).concat(a)),a}let FilenameWithAccessIcon=e=>{let{file:t}=e,i=t.downloadSource===F.Q5.dbgap;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(C.G,{icon:i?S.byT:S._1N,color:i?"#FF8C00":"#00796B"})," ",(0,I.FV)(t.Filename),"\n"]})},CrdcGcFileList=e=>(0,u.jsx)("pre",{className:"pre-scrollable",children:(0,u.jsx)("code",{children:e.files.map(e=>(0,u.jsx)(FilenameWithAccessIcon,{file:e}))})}),crdcGcManifestInstructions=e=>e?(0,u.jsxs)("div",{children:[(0,u.jsxs)("p",{children:[(0,u.jsx)("strong",{children:"Load Files into SevenBridges CGC:"})," You can import these files into the"," ",(0,u.jsx)("a",{href:"https://docs.cancergenomicscloud.org",target:"_blank",children:"SevenBridges Cancer Genomics Cloud (SB-CGC)"})," ","by downloading the CRDC-GC manifest file below and following the instructions"," ",(0,u.jsx)("a",{href:"https://docs.cancergenomicscloud.org/docs/import-from-a-drs-server#import-from-a-manifest-file",target:"_blank",children:"here"}),"."]}),(0,u.jsxs)("button",{className:"btn btn-light",onClick:()=>Y()(e,"crdc_gc_manifest.csv"),children:[(0,u.jsx)(C.G,{icon:S.q7m})," Download"," ",(0,u.jsx)("code",{children:"crdc_gc_manifest.csv"})]})]}):null,gen3ManifestInstructions=e=>e?(0,u.jsxs)("div",{children:[(0,u.jsx)("p",{}),(0,u.jsxs)("p",{children:[(0,u.jsx)("strong",{children:"Download Files using the Gen3 Client:"})," ",(0,u.jsx)(u.Fragment,{children:(0,u.jsxs)("ol",{children:[(0,u.jsxs)("li",{children:["Install the"," ",(0,u.jsx)("a",{href:"https://gen3.org/resources/user/gen3-client/#1-installation-instructions",target:"_blank",rel:"noopener noreferrer",children:"Gen3 Client"})]}),(0,u.jsxs)("li",{children:["Get your"," ",(0,u.jsx)("a",{href:"https://nci-crdc.datacommons.io/identity",target:"_blank",rel:"noopener noreferrer",children:"NCI Data Commons Framework Services API Key"})]}),(0,u.jsxs)("li",{children:["Configure a Gen3 profile by running:",(0,u.jsx)("pre",{className:"pre-scrollable",children:(0,u.jsx)("code",{children:"gen3-client configure \\\n --profile=htan \\\n --cred=~/.gen3/credentials.json \\\n --apiendpoint=https://nci-crdc.datacommons.io"})})]})]})}),".",(0,u.jsxs)("button",{className:"btn btn-light",onClick:()=>Y()(e,"gen3_manifest.json"),children:[(0,u.jsx)(C.G,{icon:S.q7m})," Download"," ",(0,u.jsx)("code",{children:"gen3_manifest.json"})]})]}),(0,u.jsxs)("p",{children:["Run the following ",(0,u.jsx)("code",{children:"gen3"})," command.",(0,u.jsx)("pre",{className:"pre-scrollable",children:(0,u.jsx)("pre",{style:{backgroundColor:"#f8f9fa",padding:"10px",borderRadius:"5px"},children:(0,u.jsx)("code",{children:"gen3-client download-multiple \\\n --profile=htan \\\n --manifest=gen3_manifest.json \\\n --download_path=my_htan_dir"})})})]})]}):null,CrdcGcInstructions=e=>{let{files:t}=e,i=t.filter(e=>e.downloadSource===F.Q5.dbgap),s=t.filter(e=>e.downloadSource!==F.Q5.dbgap),a=function(e){let t=h()(e).filter(e=>!!(0,F.fs)(e)).map(e=>{var t,i,s,a,n;return[getDrsUri(null===(t=(0,F.fs)(e))||void 0===t?void 0:t.drs_uri,!1,!0),null===(i=(0,F.fs)(e))||void 0===i?void 0:i.name,e.atlas_name,h().uniq(e.biospecimenIds).join(" "),e.assayName,e.level,null===(s=e.DataFileID)||void 0===s?void 0:s.replace(/,/g," ").trim(),null===(a=e.ParentBiospecimenID)||void 0===a?void 0:a.replace(/,/g," ").trim(),null===(n=e.ParentDataFileID)||void 0===n?void 0:n.replace(/,/g," ").trim()]}
1).value();return t.length>0?[["drs_uri","name","atlas_name","biospecimen","assay_name","level","data_file_id","parent_biospecimen_id","parent_data_file_id"],...t].map(e=>e.join(",")).join("\n"):void 0}(t),n=function(e){let t=h()(e).filter(e=>!!(0,F.fs)(e)).map(e=>{var t;return{object_id:getDrsUri(null===(t=(0,F.fs)(e))||void 0===t?void 0:t.drs_uri,!0)}}).value();return t.length>0?JSON.stringify(t,null,2):void 0}(t);return(0,u.jsxs)("div",{children:[(0,u.jsx)("hr",{}),(0,u.jsx)("h4",{children:(0,u.jsx)("strong",{children:"Files Available through NCI CRDC General Commons (CRDC-GC)"})}),i.length>0&&(0,u.jsxs)("div",{children:[(0,u.jsxs)("p",{children:[(0,u.jsx)(C.G,{color:"#FF8C00",icon:S.byT})," Your selection includes controlled-access Level 1 and/or Level 2 sequencing data. To download Level 1/2 sequencing data, you first need to have been granted access to the"," ",(0,u.jsx)("a",{href:"https://www.ncbi.nlm.nih.gov/projects/gap/cgi-bin/study.cgi?study_id=phs002371",target:"_blank",rel:"noopener noreferrer",children:"HTAN dbGaP Study, Accession: phs002371"}),"."]}),(0,u.jsx)(CrdcGcFileList,{files:i})]}),s.length>0&&(0,u.jsxs)("div",{children:[(0,u.jsxs)("p",{children:[(0,u.jsx)(C.G,{color:"#00796B",icon:S._1N})," ","The files listed below are available without additional access requirements."]}),(0,u.jsx)(CrdcGcFileList,{files:s})]}),crdcGcManifestInstructions(a),gen3ManifestInstructions(n)]})},NotDownloadableInstructions=e=>{let t=e.files.some(e=>getImageViewersAssociatedWithFile(e).hasImageViewer);return e.files.length>0?(0,u.jsxs)("div",{children:[(0,u.jsx)("h4",{children:(0,u.jsx)("strong",{children:"Files coming soon"})}),(0,u.jsx)("p",{children:"Your selection includes data that is not downloadable yet:"}),(0,u.jsx)("pre",{className:"pre-scrollable",children:(0,u.jsx)("code",{children:e.files.map(e=>(0,u.jsxs)("div",{children:[(0,u.jsx)(C.G,{icon:S.yr5})," ",(0,I.FV)(e.Filename)]},e.Filename))})}),t?(0,u.jsx)("p",{children:"These files are in preview. You can view metadata or explore them in one of the viewers in the rightmost column while they are prepared for public access."}):(0,u.jsx)("p",{children:"These files are in preview. Metadata is available for review while the files are prepared for public access."})]}):null},SynapseFileList=e=>{let{files:t}=e;return(0,u.jsx)("pre",{className:"pre-scrollable",children:(0,u.jsx)("code",{children:t.map(e=>(0,u.jsxs)("div",{children:[(0,u.jsx)(C.G,{color:"#00796B",icon:S._1N})," ",(0,I.FV)(e.Filename)," (",(0,u.jsx)("a",{href:"https://www.synapse.org/#!Synapse:".concat(e.synapseId),target:"_blank",rel:"noopener noreferrer",children:e.synapseId}),")"]},e.synapseId))})})}
1,SynapseInstructions=e=>{let t=function(e){let t=h().groupBy(e,e=>(0,I.FV)(e.Filename));return e.map(e=>{let i="synapse get ".concat(e.synapseId);return t[(0,I.FV)(e.Filename)].length>1?"".concat(i," --downloadLocation ").concat(e.synapseId):i}).join("\n")}(e.files);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("hr",{}),(0,u.jsx)("h4",{children:(0,u.jsx)("strong",{children:"Files available in Synapse"})}),(0,u.jsxs)("p",{children:["The files listed below are available through"," ",(0,u.jsx)("a",{href:"https://synapse.org",target:"_blank",children:"Synapse"}),"."]}),(0,u.jsx)(SynapseFileList,{files:e.files}),(0,u.jsxs)("p",{children:["You can use the"," ",(0,u.jsx)("a",{href:"https://docs.synapse.org/articles/getting_started_clients.html",target:"_blank",children:"Synapse CLI"})," ","command below to download the selected files."]}),(0,u.jsx)("pre",{className:"pre-scrollable",children:(0,u.jsx)("code",{children:t})}),(0,u.jsxs)("p",{children:["You'll need to"," ",(0,u.jsx)("a",{href:"https://www.synapse.org/#!RegisterAccount:0",target:"_blank",children:"register"})," ","for a Synapse account to be able to use the"," ",(0,u.jsx)("a",{href:"https://docs.synapse.org/articles/getting_started_clients.html",children:"client"}),". More information can be found in the"," ",(0,u.jsx)("a",{href:"https://docs.synapse.org/articles/downloading_data.html",target:"_blank",children:"Synapse documentation"}),". Files can also be downloaded manually through the Synapse web interface by clicking on the file name."]})]})},FileDownloadModal=e=>{let t=e.files.filter(e=>!!(0,F.fs)(e)),i=e.files.filter(e=>e.downloadSource===F.Q5.synapse),s=e.files.filter(e=>{var t;return(null===(t=e.downloadSource)||void 0===t?void 0:t.includes(F.Q5.comingSoon))||e.Component.startsWith("Imaging")&&("Level 1"===e.level||"Level 2"==e.level)&&!(0,F.fs)(e)});return(0,u.jsxs)(D.Z,{show:e.isOpen,onHide:e.onClose,children:[(0,u.jsx)(D.Z.Header,{closeButton:!0,children:(0,u.jsx)(D.Z.Title,{children:"Download Selected Files"})}),(0,u.jsxs)(D.Z.Body,{children:[(0,u.jsx)("p",{children:"Your selection include files that are:"}),(0,u.jsx)("ul",{children:(()=>{let e=[];return t.length>0&&e.push("Available through NCI CRDC General Commons (CRDC-GC)"),i.length>0&&e.push("Available through Synapse"),s.length>0&&e.push("Coming soon (not downloadable yet)"),e})().map((e,t)=>(0,u.jsx)("li",{children:e},t))}),(0,u.jsxs)("p",{children:["Follow the instructions below on how to access data from each of these sources. Further details are avaliable in the"," ",(0,u.jsx)("a",{href:"https://docs.humantumoratlas.org",children:"HTAN Manual"}),"."]}),t.length>0&&(0,u.jsx)(CrdcGcInstructions,{files:t}),i.length>
10&&(0,u.jsx)(SynapseInstructions,{files:i}),s.length>0&&(0,u.jsx)(NotDownloadableInstructions,{files:s})]}),(0,u.jsx)(D.Z.Footer,{children:(0,u.jsx)(x.Z,{variant:"secondary",onClick:e.onClose,children:"Close"})})]})},CellViewerLink=e=>{let t=e.style||{paddingRight:5};return(0,u.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",style:t,children:[e.name," ",(0,u.jsx)(C.G,{icon:S.Xjp})]})};function getChannelMetadataUrl(e){return e&&e.synapseId&&e.version?"https://www.synapse.org/#!Synapse:".concat(e.synapseId,".").concat(e.version):null}function getImageViewersAssociatedWithFile(e){var t,i,s,a;let n,l,r,o;(null===(t=e.viewers)||void 0===t?void 0:t.idc)&&(l=e.viewers.idc.viewer_url,r=e.viewers.idc.s5cmd_manifest_aws,o=e.viewers.idc.s5cmd_manifest_gcp);let c=null===(i=e.viewers)||void 0===i?void 0:i.ucscXena,d=null===(s=e.viewers)||void 0===s?void 0:s.customMinerva,u=null===(a=e.viewers)||void 0===a?void 0:a.autoMinerva,p=u&&u.thumbnail,h=!!d;return{minervaUrl:n=h?d:(n=u&&u.minerva)&&"".concat(n,"#s=0"),thumbnailUrl:p,ucscXenaUrl:c,autogeneratedImageInfo:u,hasCustomStory:h,hasImageViewer:!!n,idcImageUrl:l,idcImageBucketAwsUrl:r,idcImageBucketGcpUrl:o}}let ea=class extends g.Component{getDownloadButton(e,t){return(0,u.jsx)("button",{className:f()("btn",this.hasFilesSelected?"btn-primary":"btn-secondary"),disabled:!this.hasFilesSelected,onMouseDown:this.onDownload,style:t,children:this.hasFilesSelected?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(C.G,{icon:S.q7m})," ","Download ".concat(this.selected.length," selected ").concat(1===this.selected.length?"file":"files")]}):e})}get defaultColumns(){return[{name:"Filename",selector:"Filename",wrap:!0,sortable:!0,grow:1.4,cell:e=>{let t=(0,I.TF)(e.Filename),i=e.downloadSource===F.Q5.synapse?(0,u.jsx)("a",{target:"_blank",href:"https://www.synapse.org/#!Synapse:".concat(e.synapseId),children:t}):(0,u.jsx)("span",{className:F.iq.clickable,onClick:t=>this.onClick(t,e),children:t});return(0,u.jsx)(m.Z,{overlay:(0,u.jsx)("span",{className:ei().filenameTooltipContent,children:(0,I.FV)(e.Filename)}),children:i})}},{name:"Atlas Name",selector:"atlas_name",wrap:!0,sortable:!0},(0,P.EP)(this.props.publicationsByUid),{name:"Biospecimen",selector:e=>h().uniq(e.biospecimenIds).join(", "),cell:e=>{let t=h().uniq(e.biospecimenIds);return 0===t.length?"0 Biospecimens":1===t.length?t[0]:(0,u.jsx)(m.Z,{overlay:(0,u.jsx)(SimpleScrollPane,{width:150,height:150,style:{background:"white",color:"black",padding:"5px 10px 5px 10px"},children:(0,I.f_)(t,(0,u.jsx)("br",{}))}),children:(0,u.jsxs)("span",{children:[t.length," Biospecimens"]})})},wrap:!0,sortable:!0},{name:"Assay",selector:F.My[I.UD.assayName].path,wrap:!0,sortable:!0},{name:"Level",selector:"level",wrap:!0,sortable:!0},{name:"Organ",selector:e=>e.TissueorOrganofOrigin.join(", "),cell:P.jw,wrap:!0,sortable:!0},{name:"Treatment",selector:e=>e.TreatmentType.join(", "),cell:P.jw,wrap:!0,sortable:!0,omit:!0},{name:"Diagnosis",selector:e=>e.PrimaryDiagnosis.join(", "),cell:P.jw,wrap:!0,sortable:!0},{name:"Data Access",selector:"downloadSource",wrap:!0,sortable:!0},{name:es,selector:e=>"Details",cell:e=>(0,u.jsx)("a",{href:"#",onClick:t=>{t.preventDefault(),this.handleViewDetailsClick(e)},children:"View Metadata"}),wrap:!0,sortable:!1,searchable:!1},{name:"View",cell:e=>{var t,i,s;(0,F.yS)(e);let a=null===(t=e.viewers)||void 0===t?void 0:t.cellxgene,n=null===(i=e.viewers)||void 0===i?void 0:i.ucscXena,l=null===(s=e.viewers)||void 0===s?void 0:s.isbcgc,r=getImageViewersAssociatedWithFile(e),o=[];if(a&&o.push((0,u.jsx)(CellViewerLink,{name:"CellxGene",url:a})),n&&o.push((0,u.jsx)(CellViewerLink,{name:"UCSC Xena",url:n})),l&&o.push((0,u.jsx)(CellViewerLink,{name:"BigQuery",url:l})),e.Component.startsWith("Imaging")||e.Component.toLowerCase().includes("visium")){if(r.autogeneratedImageInfo&&r.thumbnailUrl)return(0,u.jsx)("div",{className:ei().dsaContainer,children:(0,u.jsx)(m.Z,{placement:"left",overlay:(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)("div",{style:{textAlign:"center"},children:[r.hasImageViewer&&"View Image in ",r.minervaUrl&&(0,u.jsx)(CellViewerLink,{name:"Minerva",url:r.minervaUrl,style:{color:"white"}}),r.ucscXenaUrl&&(0,u.jsxs)(u.Fragment,{children:[" or ",(0,u.jsx)(CellViewerLink,{name:"UCSC Xena",url:r.ucscXenaUrl,style:{color:"white"}})]}),!r.hasImageViewer&&(0,u.jsx)(CellViewerLink,{name:"Click to view Thumbnail",url:r.thumbnailUrl,style:{color:"white"}})]}),(0,u.jsx)("a",{href:r.minervaUrl,target:"_blank",children:(0,u.jsx)("img",{className:ei().dsaFullImage,src:r.thumbnailUrl})}),"H&E"!==e.assayName&&(0,u.jsxs)("span",{children:["Thumbnail generated
1with"," ",(0,u.jsx)(CellViewerLink,{name:"Miniature",url:"https://github.com/adamjtaylor/miniature",style:{color:"white"}})]}),e.imageChannelMetadata&&(0,u.jsx)("div",{style:{textAlign:"center"},children:(0,u.jsx)(CellViewerLink,{name:"Download Channel Metadata",url:getChannelMetadataUrl(e.imageChannelMetadata)||"",style:{color:"white"}})})]}),children:(0,u.jsxs)("div",{children:[(0,u.jsx)("a",{href:r.minervaUrl||r.thumbnailUrl,target:"_blank",children:(0,u.jsx)("img",{className:F.iq.dsaThumb,src:r.thumbnailUrl})}),(0,u.jsx)("br",{})]})})});if(r.hasImageViewer)return(0,u.jsx)(u.Fragment,{children:r.minervaUrl&&(0,u.jsx)(CellViewerLink,{name:"Minerva",url:r.minervaUrl})})}return o.length>0?o:e.Component.startsWith("ImagingLevel2")?"Image Viewer Not Available":""},selector:e=>(0,F.G5)(e),wrap:!0,sortable:!0}]}get otherColumns(){let e=this.props.entities.reduce((e,t)=>{for(let i of Object.keys(t))e[i]=!0;return e},{}),t={Filename:!0,biospecimen:!0,atlas_name:!0,[F.My[I.UD.assayName].path]:!0,level:!0,diagnosis:!0,primaryParents:!0,downloadSource:!0,viewers:!0,imageChannelMetadata:!0,therapy:!0,publicationIds:!0,TreatmentType:!0,TissueorOrganofOrigin:!0,Gender:!0,Race:!0,Ethnicity:!0,VitalStatus:!0,Component:!0,AtlasMeta:!0,biospecimenIds:!0,cases:!0,demographics:!0,demographicsIds:!0,diagnosisIds:!0,therapyIds:!0},i={[I.XL.ParentDataFileID]:{pluralName:"Files"}},s=Object.keys(e).reduce((e,s)=>(s in t||(s in i?e.push(makeListColumn(s,i[s].pluralName)):e.push({name:(0,w.ab)(s),selector:s,wrap:!0,sortable:!0})),e),[]);return s}get allLevels(){return h().chain(this.props.entities).map(e=>e.level).uniq().value()}get columns(){return h().sortBy([...this.defaultColumns,...this.otherColumns],e=>{switch(e.name){case es:return 1;case"View":return 2;default:return 0}})}get filteredEntities(){return this.props.enableLevelFilter?h().chain(this.props.entities).filter(e=>this.selectedLevels.includes(e.level)).value():this.props.entities}setColumnVisibility(e){this.columnVisibility=e}setSelectedLevels(e){this.selectedLevels=e}handleViewDetailsClick(e){this.viewDetailsFile=e,this.viewDetailsFileMetadata=new(k())({invoke:async()=>{let t=escapeSqlValue(e.DataFileID||""),i=escapeSqlValue(e.synapseId||""),s=e.DataFileID?"DataFileID = '".concat(t,"'"):"synapseId = '".concat(i,"'"),a=await (0,F.Rf)("\n SELECT * FROM files\n WHERE ".concat(s,"\n LIMIT 1\n "));return a[0]},onError:e=>{console.error("Error fetching file metadata:",e)}})}get hasFilesSelected(){return this.selected.length>0}get additionalFields(){var e;if(!this.viewDetailsFile||!(null===(e=this.viewDetailsFileMetadata)||void 0===e?void 0:e.isComplete)||!this.viewDetailsFileMetadata.result)return{};let t=new Set(Object.keys(this.viewDetailsFile)),i=this.viewDetailsFileMetadata.result,s={};for(let[e,a]of Object.entries(i))"AtlasMeta"===e||t.has(e)||(s[e]=a);return s}getDisabledAddColumns(){var e;if(!this.viewDetailsFile||!(null===(e=this.viewDetailsFileMetadata)||void 0===e?void 0:e.isComplete)||!this.viewDetailsFileMetadata.result)return[];let t=new Set(Object.keys(this.viewDetailsFile)),i=this.viewDetailsFileMetadata.result;return Object.keys(i).filter(e=>"AtlasMeta"!==e&&!t.has(e))}get metadataColumnsFromFields(){return Object.entries(this.additionalFields).map(e=>{let[t,i]=e;return"ChannelMetadataFilename"===t?{name:t,selector:t,cell:e=>{let t=getChannelMetadataUrl(e.imageChannelMetadata);return t?(0,u.jsx)(CellViewerLink,{name:i,url:t}):""}}:{name:t,selector:t,cell:e=>Array.isArray(i)?i.join(", "):"object"==typeof i?JSON.stringify(i):String(i)}})}getViewDetailsCustomContent(){var e,t;return(null===(e=this.viewDetailsFileMetadata)||void 0===e?void 0:e.isPending)?(0,u.jsx)("div",{className:F.iq.loadingIndicator,children:(0,u.jsx)(_.Z,{})}):(null===(t=this.viewDetailsFileMetadata)||void 0===t?void 0:t.isError)?(0,u.jsx)("div",{className:"alert alert-danger mt-2 mb-0",children:"Failed to load full metadata."}):void 0}render(){var e;return this.props.entities?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(FileDownloadModal,{files:this.selected,onClose:this.onDownloadModalClose,isOpen:this.isDownloadModalOpen}),(0,u.jsx)(FileDownloadModal,{files:this.clicked?[this.clicked]:[],onClose:this.onLinkOutModalClose,isOpen:this.isLinkOutModalOpen}),(0,u.jsx)(F.Gg,{cellData:this.viewDetailsFile,onClose:this.onViewDetailsModalClose,columnVisibility:this.columnVisibility,onChangeColumnVisibility:this.setColumnVisibility,columns:this.columns.filter(e=>e.name!==es),additionalColumns:this.metadataColumnsFromFields,disabledAddColumns:this.getDisabledAddColumns(),isLoadingAdditionalData:!!(null===(e=this.viewDetailsFileMetadata)||void 0===e?void 0:e.isPending),customContent:this.getViewDetailsCustomContent()}),(0,u.jsx)(w.Nz,{columnVisibility:this.columnVisibility,onChangeColumnVisibility:this.setColumnVisibility,customControls:this.getDownloadButton("Select files to download below"),extraControlsInsideDataTableControls:this.props.enableLevelFilter?(0,u.jsx)(ee,{allLevels:this.allLevels,selectedLevels:this.selectedLevels,onLevelToggled:this.setSelectedLevels}):void 0,paginationServerOptions:{persistSelectedOnPageChange:!1,persistSelectedOnSort:!1},columns:this.columns,additionalSearchFilter:(e,t,i)=>h().some(e.diagnosis,e=>e.ParticipantID.toUpperCase().includes(i)),data:this.filteredEntities,striped:!0,dense:!1,selectableRows:!0,onSelectedRowsChange:this.onSelect,pagination:!0,paginationPerPage:50,paginationRowsPerPageOptions:[10,20,50,100,500],noHeader:!0,subHeader:!1,customStyles:(0,w.Ek)()}),this.getDownloadButton("Select files to download above",{marginTop:-70})]}):null}constructor(e){super(e),(0,c._)(this,"selected",[]),(0,c._)(this,"clicked",void 0),(0,c._)(this,"isDownloadModalOpen",!1),(0,c._)(this,"isLinkOutModalOpen",!1),(0,c._)(this,"viewDetailsFile",void 0),(0,c._)(this,"viewDetailsFileMetadata",void 0),(0,c._)(this,"columnVisibility",{}),(0,c._)(this,"selectedLevels",this.allLevels),(0,c._)(this,"onDownload",e=>{e.preventDefault(),this.isDownloadModalOpen=!0}),(0,c._)(this,"onClick",(e,t)=>{e.preventDefault(),this.clicked=t,this.isLinkOutModalOpen=!0}),(0,c._)(this,"onDownloadModalClose",()=>{this.isDownloadModalOpen=!1}),(0,c._)(this,"onLinkOutModalClose",()=>{this.isLinkOutModalOpen=!1}),(0,c._)(this,"onViewDetailsModalClose",()=>{this.viewDetailsFile=void 0,this.viewDetailsFileMetadata=void 0}),(0,c._)(this,"onSelect",e=>{this.selected=e.selectedRows}),(0,y.makeObservable)(this);let t=h().mapValues(h().keyBy(this.defaultColumns,e=>e.name),e=>!e.omit);this.columnVisibility=t}};function getCounts(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:getEntityCount,a=s(e,t),n=t.length===i.length?a:s(e,i);return{filteredCount:a,unfilteredCount:n}}function getAssayCount(e,t){let i=(0,F.IP)(e);return h()(t).filter(e=>{var t;return(null===(t=e.publicationIds)||void 0===t?void 0:t.includes(i))||!1}).map(e=>
1e.assayName).uniq().value().length}function getEntityCount(e,t){let i=(0,F.IP)(e);return t.filter(e=>{var t;return null===(t=e.publicationIds)||void 0===t?void 0:t.includes(i)}).length}(0,d.gn)([y.observable.ref],ea.prototype,"selected",void 0),(0,d.gn)([y.observable],ea.prototype,"clicked",void 0),(0,d.gn)([y.observable],ea.prototype,"isDownloadModalOpen",void 0),(0,d.gn)([y.observable],ea.prototype,"isLinkOutModalOpen",void 0),(0,d.gn)([y.observable],ea.prototype,"viewDetailsFile",void 0),(0,d.gn)([y.observable.ref],ea.prototype,"viewDetailsFileMetadata",void 0),(0,d.gn)([y.observable],ea.prototype,"columnVisibility",void 0),(0,d.gn)([y.observable],ea.prototype,"selectedLevels",void 0),(0,d.gn)([y.action.bound],ea.prototype,"setColumnVisibility",null),(0,d.gn)([y.action.bound],ea.prototype,"setSelectedLevels",null),(0,d.gn)([y.action],ea.prototype,"onDownload",void 0),(0,d.gn)([y.action],ea.prototype,"onClick",void 0),(0,d.gn)([y.action],ea.prototype,"onDownloadModalClose",void 0),(0,d.gn)([y.action],ea.prototype,"onLinkOutModalClose",void 0),(0,d.gn)([y.action],ea.prototype,"onViewDetailsModalClose",void 0),(0,d.gn)([y.action.bound],ea.prototype,"handleViewDetailsClick",null),ea=(0,d.gn)([b.Pi],ea);let Count=e=>(0,u.jsx)("span",{className:"ml-auto",children:function(e,t){let i=e!==t?"".concat(e,"/"):"";return"".concat(i).concat(t)}(e.filteredCount,e.unfilteredCount)}),PublicationTable=e=>{let getDate=e=>{let t=(0,F.rT)(e),i=null==t?void 0:t.split(/\s/),s="1",a="",n="";return(i&&(s=i.length>2?i[2]:s,a=i.length>1?i[1]:a,n=i[0]),n&&a)?new Date("".concat(s," ").concat(a," ").concat(n)):void 0},getDateTime=e=>{var t;return(null===(t=getDate(e))||void 0===t?void 0:t.getTime())||0},t=[{name:"Title",selector:e=>(0,F.GW)(e),cell:e=>(0,u.jsx)("a",{href:"/publications/".concat((0,F.IP)(e)),className:"py-1",children:(0,F.GW)(e)}),grow:1.5,wrap:!0,sortable:!0},{name:"Atlas",selector:e=>(0,F.x8)(e.AtlasMeta),cell:e=>(0,u.jsx)(F.m9,{atlasMeta:e.AtlasMeta,atlasName:e.AtlasMeta.lead_institutions}),wrap:!0,sortable:!0},{name:"Authors",selector:e=>(0,F.sw)(e).join(", "),cell:e=>{let t=(0,F.sw)(e),i=t;return t.length>5&&(i=t.slice(0,4).concat("et al.")),i.join(", ")},wrap:!0,sortable:!0},{name:"Journal",selector:e=>(0,F.FW)(e),wrap:!0,sortable:!0},{name:"Publication Date",selector:e=>getDateTime(e),cell:e=>{let t=getDate(e);if(!t)return"";{var i,s;let e=Intl.DateTimeFormat("en-US",{year:"numeric",month:"short"}).formatToParts(t),a=null===(i=e.find(e=>"year"===e.type))||void 0===i?void 0:i.value,n=null===(s=e.find(e=>"month"===e.type))||void 0===s?void 0:s.value;return"".concat(a," ").concat(n)}},wrap:!0,sortable:!0},{name:"DOI",selector:e=>(0,F.eZ)(e),cell:e=>{let t=(0,F.eZ)(e);return t?(0,u.jsxs)("a",{href:"https://doi.org/".concat(t),target:"_blank",children:[t," ",(0,u.jsx)(C.G,{icon:S.Xjp})]}):void 0},wrap:!0,sortable:!0,omit:!0},{name:"PubMed",selector:e=>(0,F.pB)(e),cell:e=>{let t=(0,F.pB)(e);return t?(0,u.jsxs)("a",{href:"".concat(e.PMID),target:"_blank",children:[t," ",(0,u.jsx)(C.G,{icon:S.Xjp})]}):void 0},wrap:!1,sortable:!0},{name:"Cited by",selector:e=>e.CitedInNumber,cell:e=>{let t=(0,F.pB)(e);return t?(0,u.jsxs)("a",{href:"https://pubmed.ncbi.nlm.nih.gov/?linkname=pubmed_pubmed_citedin&from_uid=".concat(t),target:"_blank",className:"ml-auto",children:[e.CitedInNumber," ",(0,u.jsx)(C.G,{icon:S.Xjp})]}):void 0},grow:.5,wrap:!1,sortable:!0},{name:"Cases",selector:t=>getEntityCount(t,e.filteredParticipants),cell:t=>{let{filteredCount:i,unfilteredCount:s}=getCounts(t,e.filteredParticipants,e.participants);return(0,u.jsx)(Count,{filteredCount:i,unfilteredCount:s})},grow:.5,wrap:!0,sortable:!0},{name:"Biospecimens",selector:t=>getEntityCount(t,e.filteredBiospecimens),cell:t=>{let{filteredCount:i,unfilteredCount:s}=getCounts(t,e.filteredBiospecimens,e.biospecimens);return(0,u.jsx)(Count,{filteredCount:i,unfilteredCount:s})},grow:.7,wrap:!0,sortable:!0},{name:"Assays",selector:t=>getAssayCount(t,e.filteredFiles),cell:t=>{let{filteredCount:i,unfilteredCount:s}=getCounts(t,e.filteredFiles,e.files,getAssayCount);return(0,u.jsx)(Count,{filteredCount:i,unfilteredCount:s})},grow:.5,wrap:!0,sortable:!0,omit:!0},{name:"UCSC Cell Browser",selector:e=>e.UCSCCellBrowserLink,cell:e=>e.UCSCCellBrowserLink?(0,u.jsx)("a",{href:e.UCSCCellBrowserLink,target:"_blank",children:(0,u.jsx)(C.G,{icon:S.Xjp})}):void 0,wrap:!0,sortable:!0,omit:!0},{name:"Content Type",selector:e=>e.PublicationContentType,cell:e=>{var t;let i=null===(t=e.PublicationContentType)||void 0===t?void 0:t.toLowerCase();return i===F.pT.Prepublication?(0,u.jsx)("span",{className:"text-danger",children:"In Review"}):i===F.pT.Preprint?(0,u.jsx)("span",{children:"Preprint"}):i===F.pT.Published?(0,u.jsx)("span",{children:"Published"}):i===F.pT.Accepted?(0,u.jsx)("span",{children:"Accepted"}):e.PublicationContentType},wrap:!0,sortable:!0,omit:!0}
1],i=h()(e.publications).sortBy(getDateTime).reverse().value();return(0,u.jsx)(w.Nz,{columns:t,data:i,striped:!0,dense:!1,noHeader:!0,pagination:!0,paginationPerPage:50,paginationRowsPerPageOptions:[10,20,50,100,500],customStyles:(0,w.Ek)()})};var en=i(43653),el=i.n(en);let er=[{value:"ParticipantID",label:"Case Count"},{value:"BiospecimenID",label:"Specimen Count"}],eo=(0,b.Pi)(e=>{var t;let[i,s]=(0,g.useState)(!1),[a,l]=(0,g.useState)(!0),[r,o]=(0,g.useState)(!1),[c,d]=(0,g.useState)(er[0]),[p,m]=(0,g.useState)(X.filter(e=>/./.test(e.value)));return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{className:"subnav",children:(0,u.jsxs)("ul",{className:"nav nav-tabs",children:[(0,u.jsx)("li",{className:"nav-item",children:(0,u.jsx)("a",{onClick:()=>e.setTab(n.ATLAS),className:"nav-link ".concat(e.activeTab===n.ATLAS?"active":""),children:"Atlases"})}),(0,u.jsx)("li",{className:"nav-item",children:(0,u.jsx)("a",{onClick:()=>e.setTab(n.PUBLICATION),className:"nav-link ".concat(e.activeTab===n.PUBLICATION?"active":""),children:"Publications"})}),(0,u.jsx)("li",{className:"nav-item",children:(0,u.jsx)("a",{onClick:()=>e.setTab(n.CASES),className:"nav-link ".concat(e.activeTab===n.CASES?"active":""),children:"Cases"})}),(0,u.jsx)("li",{className:"nav-item",children:(0,u.jsx)("a",{onClick:()=>e.setTab(n.BIOSPECIMEN),className:"nav-link ".concat(e.activeTab===n.BIOSPECIMEN?"active":""),children:"Biospecimens"})}),(0,u.jsx)("li",{className:"nav-item",children:(0,u.jsx)("a",{onClick:()=>e.setTab(n.FILE),className:"nav-link ".concat(e.activeTab===n.FILE?"active":""),children:"Files"})}),(0,u.jsx)("li",{className:"nav-item",children:(0,u.jsxs)("a",{onClick:()=>e.setTab(n.PLOTS),className:"nav-link ".concat(e.activeTab===n.PLOTS?"active":""),children:["Plots"," ",(0,u.jsx)("span",{style:{color:"orange"},children:"Beta!"})]})})]})}),e.activeTab===n.FILE&&(0,u.jsx)("div",{className:"tab-content fileTab ".concat(e.activeTab!==n.FILE?"d-none":""),children:(0,u.jsx)(ea,{entities:e.filteredFiles,groupsByPropertyFiltered:e.groupsByPropertyFiltered,patientCount:(null===(t=e.casesFiltered.result)||void 0===t?void 0:t.length)||0,publicationsByUid:e.publicationManifestByUid})}),e.activeTab===n.BIOSPECIMEN&&(0,u.jsx)("div",{className:"tab-content biospecimen ".concat(e.activeTab!==n.BIOSPECIMEN?"d-none":""),children:(0,u.jsx)(BiospecimenTable,{synapseAtlases:e.atlases.result||[],samples:e.samplesFiltered.result||[],publicationsByUid:h().keyBy(e.publications,"publicationId")})}),e.activeTab===n.CASES&&(0,u.jsx)("div",{className:"tab-content cases ".concat(e.activeTab!==n.CASES?"d-none":""),children:(0,u.jsx)(CaseTable,{synapseAtlases:e.filteredSynapseAtlases,cases:e.casesFiltered.result||[],publicationsByUid:h().keyBy(e.publications,"publicationId")})}),e.activeTab===n.PUBLICATION&&(0,u.jsx)("div",{className:"tab-content ".concat(el().publicationTab," ").concat(e.activeTab!==n.PUBLICATION?"d-none":""),children:(0,u.jsx)(PublicationTable,{publications:e.filteredPublications,participants:e.cases.result,filteredParticipants:e.casesFiltered.result,biospecimens:e.samples.result,filteredBiospecimens:e.samplesFiltered.result,files:e.files,filteredFiles:e.filteredFiles})}),e.activeTab===n.ATLAS&&(0,u.jsx)("div",{className:"tab-content ".concat(el().atlasTab," ").concat(e.activeTab!==n.ATLAS?"d-none":""),children:(0,u.jsx)(N,{setTab:e.setTab,publications:e.publications,getAtlasMetaData:e.getAtlasMetaData,selectedAtlases:e.selectedSynapseAtlases,filteredAtlases:e.filteredSynapseAtlasesByNonAtlasFilters,onSelectAtlas:e.onSelectAtlas,filteredCases:e.filteredCasesByNonAtlasFilters.result,filteredBiospecimens:e.filteredSamplesByNonAtlasFilters.result,selectedFiltersByAttrName:e.nonAtlasSelectedFiltersByAttrName,files:e.files,filteredFiles:e.filteredFiles,cloudBaseUrl:e.cloudBaseUrl||""})}),e.activeTab===n.PLOTS&&(0,u.jsxs)("div",{className:"tab-content fileTab ".concat(e.activeTab!==n.PLOTS?"d-none":""),children:[(0,u.jsx)("div",{className:"alert alert-warning",children:"This feature is in beta."}),(0,u.jsx)("form",{className:"d-flex",style:{alignItems:"center"},children:(0,u.jsx)("div",{style:{marginRight:20},children:(0,u.jsxs)("div",{className:"form-check",children:[(0,u.jsx)("input",{className:"form-check-input",type:"checkbox",checked:i,onChange:()=>s(!i)}),(0,u.jsx)("label",{className:"form-check-label",children:"Log Scale"})]})})}),(0,u.jsxs)("div",{className:"d-flex flex-wrap",children:[(0,u.jsxs)("div",{style:{marginRight:20},children:[(0,u.jsx)(z,{logScale:i,width:400,metricType:c,selectedField:{data:{type:"SAMPLE"},label:"Assay",value:"assayName"},hideNA:r,query:(0,F.r4)({filterString:e.filterString})})," "]}),p.map(t=>(0,u.jsxs)("div",{style:{marginRight:20},children:[(0,u.jsx)(z,{logScale:i,width:400,metricType:c,selectedField:t,hideNA:r,query:(0,F.r$)({field:t.value,table:t.table,filterString:e.filterString})})," "]}))]})]})]})});var ec=i(32505),ed=i.n(ec);let eu=(0,b.Pi)(e=>{let t={countHeader:"Files",attributeMap:F.My,attributeNames:[I.UD.AtlasName,I.UD.TissueorOrganofOrigin,I.UD.PrimaryDiagnosis,I.UD.assayName,I.UD.level,I.UD.FileFormat,I.UD.TreatmentType,I.UD.downloadSource],entities:[],setFilter:e.setFilter,selectedFiltersByGroupName:e.selectedFiltersByGroupName,selectedFilters:[],groupsByProperty:e.groupsByProperty,optionMapper:(e,t)=>({value:e.val,label:e.val,count:parseInt(e.count)})},i=(0,A._M)(t),s=(0,A.uU)(t,i);return(0,u.jsxs)(A.rz,{...t,children:[(0,u.jsx)(A.ML,{...s,placeholder:"Atlas",attributes:[I.UD.AtlasName],className:ed().filterCheckboxListContainer}),(0,u.jsx)(A.ML,{...s,attributes:[I.UD.organType,I.UD.TissueorOrganofOrigin],className:ed().filterCheckboxListContainer}),(0,u.jsx)(A.ML,{...s,placeholder:"Disease",attributes:[I.UD.PrimaryDiagnosis],className:ed().filterCheckboxListContainer,width:120}),(0,u.jsx)(A.ML,{...s,placeholder:"Demographics",attributes:[I.UD.Gender,I.UD.Race,I.UD.Ethnicity],className:ed().filterCheckboxListContainer,width:164}),(0,u.jsx)(A.ML,{...s,placeholder:"Treatment",attributes:[I.UD.TreatmentType],className:ed().filterCheckboxListContainer,width:120}),(0,u.jsx)(A.ML,{...s,placeholder:"Assay",attributes:[I.UD.assayName],className:ed().filterCheckboxListContainer}),(0,u.jsx)(A.ML,{...s,placeholder:"File",attributes:[I.UD.level,I.UD.FileFormat],className:ed().filterCheckboxListContainer,width:80}),(0,u.jsx)(A.ML,{...s,placeholder:"Data Access",attributes:[I.UD.downloadSource],className:ed().filterCheckboxListContainer,width:150,options:e=>i(e).sort((e,t)=>
1{let i=[F.Q5.dbgap,F.Q5.crdcGc,F.Q5.synapse,F.Q5.comingSoon];return i.indexOf(e.value)-i.indexOf(t.value)}).map(e=>{let t={[F.Q5.dbgap]:(0,u.jsxs)("span",{children:["CRDC-GC/SB-CGC (dbGaP"," ",(0,u.jsx)(C.G,{color:"#FF8C00",icon:S.byT}),")"]}),[F.Q5.crdcGc]:(0,u.jsxs)("span",{children:["CRDC-GC/SB-CGC (Open Access"," ",(0,u.jsx)(C.G,{color:"#00796B",icon:S._1N}),")"]}),[F.Q5.synapse]:(0,u.jsxs)("span",{children:["Synapse (Open Access"," ",(0,u.jsx)(C.G,{color:"#00796B",icon:S._1N}),")"]}),[F.Q5.comingSoon]:"Coming Soon"};return e.label=t[e.value],e})}),(0,u.jsx)(A.ML,{...s,placeholder:"Viewer",attributes:[I.UD.viewersArr],className:ed().filterCheckboxListContainer,options:e=>i(e).filter(e=>![F.Iq.crdcGc,F.Iq.idc].includes(e.value)).map(e=>{let t={[F.Iq.autoMinerva]:"Autominerva",[F.Iq.customMinerva]:"Minerva Story",[F.Iq.ucscXena]:"UCSC Xena",[F.Iq.cellxgene]:"CellxGene",[F.Iq.isbcgc]:"BigQuery",[F.Iq.crdcGc]:"CRDC-GC",[F.Iq.idc]:"IDC"};return e.label=t[e.value],e})}),e.enableReleaseFilter&&(0,u.jsx)(A.ML,{...s,attributes:[I.UD.releaseVersion],width:120})]})});function getDefaultSummaryData(e,t,i,s,a){let n=[{displayName:"Atlas",attributeName:I.UD.AtlasName},{displayName:"Organ",attributeName:I.UD.organType},{displayName:"Cancer Type",attributeName:I.UD.PrimaryDiagnosis},{displayName:"Case",entities:e},{displayName:"Biospecimen",entities:t},{displayName:"Assay",attributeName:I.UD.assayName},{displayName:"File",entities:i}];return n.map(e=>{let t=getSummaryData(e.attributeName,e.entities,s,a);return e.attributeName===I.UD.organType&&(t=t.filter(e=>e!==F.oG)),{displayName:e.displayName,values:t}})}function getSummaryData(e,t,i){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:(e,t)=>t;return t||(e&&i?h().map(i[e],s):[])}function doesFileIncludeLevel1OrLevel2SequencingData(e){return!e.Component.startsWith("Imaging")&&("Level 1"===e.level||"Level 2"===e.level)}var ep=i(18851),eh=i.n(ep);function groupOptionsByType(e){return h()(e).groupBy("type").value()}function getGroupsByPropertyFiltered(e){return h()(e).mapValues(e=>e.filter(e=>parseInt(e.count.toString())>0)).value()}window.toJS=y.toJS;let em=class extends g.Component{componentDidUpdate(e){var t,i,s,a,n,l;let r=(null===(t=(i=this.props).getSelectedFilters)||void 0===t?void 0:t.call(i))||[],o=(null===(s=e.getSelectedFilters)||void 0===s?void 0:s.call(e))||[];r.length>0&&0===this._selectedFilters.length&&JSON.stringify(r)!==JSON.stringify(o)&&(0,y.runInAction)(()=>{this._selectedFilters=r});let c=null===(a=(n=this.props).getTab)||void 0===a?void 0:a.call(n),d=null===(l=e.getTab)||void 0===l?void 0:l.call(e);c&&c!==d&&this.currentTab!==c&&(0,y.runInAction)(()=>{this.currentTab=c})}get filterString(){let e=(0,y.toJS)(this.selectedFilters);return(0,F.Er)(e,this.unfilteredOptions.result)}getFilterStringForAttribute(e){return function(e,t,i){let s=(0,y.toJS)(e).filter(e=>e.group!==i);return(0,F.Er)(s,t.result)}((0,y.toJS)(this.selectedFilters),this.unfilteredOptions,e)}getOptionsFromFilteredCounts(e){let t=h().keyBy(e,e=>e.val+e.type),i=h().keyBy(this.unfilteredOptions.result,e=>e.val+e.type);return h()(i).mapValues((e,i)=>{if(i in t)return t[i];{let t=h().clone(e);return t.count=0,t}}).values().value()}get atlasMap(){return h().keyBy(this.atlases.result,e=>e.htan_id)}async filterAtlases(e){if(0===e.length)return this.atlases.result||[];{let t=await (0,F.Rf)((0,F.s8)({filterString:e}));return t.forEach(e=>e.AtlasMeta=JSON.parse(e.AtlasMeta.toString())),t}}get publicationsById(){return h().keyBy(this.publications.result,e=>e.publicationId)}toggleShowAllBiospecimens(){this.showAllBiospecimens=!this.showAllBiospecimens}toggleShowAllCases(){this.showAllCases=!this.showAllCases}get selectedFilters(){return this._selectedFilters}set selectedFilters(e){this.props.onFilterChange&&this.props.onFilterChange(e),this._selectedFilters=e}get groupsByPropertyFiltered(){return getGroupsByPropertyFiltered(this.groupsByProperty)}get groupsByPropertyFilteredForSummary(){return getGroupsByPropertyFiltered(this.groupsByPropertyForSummary)}get selectedFiltersByAttrName(){return(0,A.MZ)(this.selectedFilters)}setFilter(e){this.selectedFilters=(0,A.CW)(this.selectedFilters,e)}onSelectAtlas(e){let t=I.UD.AtlasName,i=this.selectedFilters.filter(e=>e.group!==t)||[];i.push(...e.map(e=>({group:t,value:e.htan_name})));let s=(0,A.MZ)(i),a=s[I.UD.AtlasName],n=this.selectedFiltersByAttrName[I.UD.AtlasName];h().isEqual(a,n)||(this.selectedFilters=i)}get selectedAtlases(){let e=this.selectedFiltersByAttrName[I.UD.AtlasName];return h().size(e)>0?h().chain(this.filesFiltered.result).map(e=>e.atlasid).uniq().map(e=>
1this.atlasMap[e]).value():[]}get nonAtlasSelectedFiltersByAttrName(){return h().omit(this.selectedFiltersByAttrName,[I.UD.AtlasName])}get groupsByProperty(){return groupOptionsByType(this.filteredOptions.result)}get groupsByPropertyForSummary(){return groupOptionsByType(this.filteredOptionsForSummary.result)}render(){var e;let t=(e=[this.casesFilteredByNonAtlasFilters,this.casesFiltered,this.cases,this.specimenFilteredByNonAtlasFilters,this.specimenFiltered,this.specimen,this.filteredOptions,this.filteredOptionsForSummary,this.unfilteredOptions,this.publications,this.publicationsFiltered,this.atlases,this.atlasesFiltered,this.atlasesFilteredByNonAtlasFilters,this.filesFiltered,this.files],h()(e).map(e=>e.isComplete).every()),i=(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(eu,{setFilter:this.setFilter,selectedFiltersByGroupName:this.selectedFiltersByAttrName,selectedFilters:this.selectedFilters,entities:this.filesFiltered.result||[],groupsByProperty:this.groupsByProperty,enableReleaseFilter:!!this.props.isReleaseQCEnabled&&this.props.isReleaseQCEnabled()}),(0,u.jsx)(A.wn,{setFilter:this.setFilter,selectedFiltersByGroupName:this.selectedFiltersByAttrName,getFilterDisplayName:F.d1})]});return t?(0,u.jsxs)("div",{className:eh().explore,children:[i,(0,u.jsx)(ExploreSummary,{summaryData:getDefaultSummaryData(this.casesFiltered.result||[],this.specimenFiltered.result||[],this.filesFiltered.result||[],this.groupsByPropertyFilteredForSummary,(e,t)=>e.val)}),(0,u.jsx)(eo,{setTab:e=>{this.currentTab=e},filterString:this.filterString,activeTab:this.currentTab,filteredFiles:this.filesFiltered.result||[],filteredSynapseAtlases:this.atlasesFiltered.result||[],filteredSynapseAtlasesByNonAtlasFilters:this.atlasesFilteredByNonAtlasFilters.result||[],atlases:this.atlases,filteredSamples:this.casesFiltered.result||[],cases:this.cases,casesFiltered:this.casesFiltered,selectedSynapseAtlases:this.selectedAtlases,allSynapseAtlases:this.atlases.result||[],onSelectAtlas:this.onSelectAtlas,samples:this.specimen,samplesFiltered:this.specimenFiltered,filteredCasesByNonAtlasFilters:this.casesFilteredByNonAtlasFilters,filteredSamplesByNonAtlasFilters:this.specimenFilteredByNonAtlasFilters,nonAtlasSelectedFiltersByAttrName:this.nonAtlasSelectedFiltersByAttrName,groupsByPropertyFiltered:this.groupsByPropertyFiltered,showAllBiospecimens:this.showAllBiospecimens,showAllCases:this.showAllCases,toggleShowAllBiospecimens:this.toggleShowAllBiospecimens,toggleShowAllCases:this.toggleShowAllCases,cloudBaseUrl:this.props.cloudBaseUrl,getAtlasMetaData:this.props.getAtlasMetaData,files:this.files.result,filteredPublications:this.publicationsFiltered.result,publications:this.publications.result,publicationManifestByUid:this.publicationsById})]}):(0,u.jsxs)("div",{className:eh().explore,children:[i,(0,u.jsx)("div",{className:F.iq.loadingIndicator,children:(0,u.jsx)(_.Z,{})})]})}constructor(e){var t,i,s,a;super(e),(0,c._)(this,"showAllBiospecimens",!1),(0,c._)(this,"showAllCases",!1),(0,c._)(this,"_selectedFilters",(null===(t=(i=this.props).getSelectedFilters)||void 0===t?void 0:t.call(i))||[]),(0,c._)(this,"currentTab",(null===(s=(a=this.props).getTab)||void 0===s?void 0:s.call(a))||n.ATLAS),(0,c._)(this,"unfilteredOptions",new(k())({invoke:async()=>(0,F.Rf)((0,F.Zq)(F.WS))})),(0,c._)(this,"filteredOptionsForSummary",new(k())({await:()=>[this.unfilteredOptions],invoke:async()=>{if(""===this.filterString)return this.unfilteredOptions.result;{let e=await (0,F.Rf)((0,F.Zq)((0,F.Ug)(this.filterString)));return this.getOptionsFromFilteredCounts(e)}}})),(0,c._)(this,"filteredOptions",new(k())({await:()=>[this.unfilteredOptions],invoke:async()=>{if(""===this.filterString)return this.unfilteredOptions.result;{let e=await (0,F.Rf)((0,F.Zq)({genderFilterString:this.getFilterStringForAttribute(I.UD.Gender),raceFilterString:this.getFilterStringForAttribute(I.UD.Race),primaryDiagnosisFilterString:this.getFilterStringForAttribute(I.UD.PrimaryDiagnosis),ethnicityFilterString:this.getFilterStringForAttribute(I.UD.Ethnicity),tissueOrOrganOfOriginFilterString:this.getFilterStringForAttribute(I.UD.TissueorOrganofOrigin),levelFilterString:this.getFilterStringForAttribute(I.UD.level),assayNameFilterString:this.getFilterStringForAttribute(I.UD.assayName),treatmentTypeFilterString:this.getFilterStringForAttribute(I.UD.TreatmentType),fileFormatFilterString:this.getFilterStringForAttribute(I.UD.FileFormat),viewersFilterString:this.getFilterStringForAttribute(I.UD.viewersArr),organTypeFilterString:this.getFilterStringForAttribute(I.UD.organType),atlasNameFilterString:this.getFilterStringForAttribute(I.UD.AtlasName),downloadSourceFilterString:this.getFilterStringForAttribute(I.UD.downloadSource),releaseVersionFilterString:this.getFilterStringForAttribute(I.UD.releaseVersion)}));return this.getOptionsFromFilteredCounts(e)}}})),(0,c._)(this,"files",new(k())({invoke:async()=>{let e=await (0,F.Rf)(F.c9);return(0,F.HD)(e)}})),(0,c._)(this,"filesFiltered",new(k())({await:()=>[this.files,this.unfilteredOptions],invoke:async()=>
1{if(0===this.filterString.length)return this.files.result||[];{let e=F.c9+this.filterString,t=await (0,F.Rf)(e);return(0,F.HD)(t)}}})),(0,c._)(this,"cases",new(k())({invoke:async()=>{let e=(0,F.Fx)({filterString:""});return await (0,F.Rf)(e)}})),(0,c._)(this,"casesFiltered",new(k())({await:()=>[this.unfilteredOptions],invoke:async()=>{let e=(0,F.Fx)({filterString:this.filterString});return await (0,F.Rf)(e)}})),(0,c._)(this,"casesFilteredByNonAtlasFilters",new(k())({await:()=>[this.unfilteredOptions],invoke:async()=>{let e=(0,F.Fx)({filterString:this.getFilterStringForAttribute(I.UD.AtlasName)});return await (0,F.Rf)(e)}})),(0,c._)(this,"specimen",new(k())({invoke:async()=>{let e=(0,F.$l)({filterString:""});return(0,F.Rf)(e)}})),(0,c._)(this,"specimenFiltered",new(k())({await:()=>[this.unfilteredOptions],invoke:async()=>{let e=(0,F.$l)({filterString:this.filterString});return(0,F.Rf)(e)}})),(0,c._)(this,"specimenFilteredByNonAtlasFilters",new(k())({await:()=>[this.unfilteredOptions],invoke:async()=>{let e=(0,F.$l)({filterString:this.getFilterStringForAttribute(I.UD.AtlasName)});return(0,F.Rf)(e)}})),(0,c._)(this,"atlases",new(k())({invoke:async()=>{let e=await (0,F.Rf)((0,F.s8)({filterString:""}));return e.forEach(e=>e.AtlasMeta=JSON.parse(e.AtlasMeta.toString())),e}})),(0,c._)(this,"atlasesFilteredByNonAtlasFilters",new(k())({await:()=>[this.atlases,this.unfilteredOptions],invoke:async()=>this.filterAtlases(this.getFilterStringForAttribute(I.UD.AtlasName))})),(0,c._)(this,"atlasesFiltered",new(k())({await:()=>[this.atlases,this.unfilteredOptions],invoke:async()=>this.filterAtlases(this.filterString)})),(0,c._)(this,"publications",new(k())({await:()=>[this.cases,this.unfilteredOptions],invoke:async()=>{let e=await (0,F.Rf)("SELECT * FROM publication_manifest");return(0,F.W1)(e)}})),(0,c._)(this,"publicationsFiltered",new(k())({await:()=>[this.cases,this.unfilteredOptions],invoke:async()=>{let e="\n WITH filteredPublications AS (\n SELECT DISTINCT publicationId FROM (\n SELECT arrayJoin(associatedFiles) as fileId, publicationId\n FROM publication_manifest\n WHERE fileId IN (\n SELECT files.DataFileID FROM files \n ".concat(this.filterString,"\n )\n )\n )\n SELECT *\n FROM filteredPublications fp\n LEFT JOIN publication_manifest pm on fp.publicationId = pm.publicationId\n "),t=await (0,F.Rf)(e);return(0,F.W1)(t)}})),(0,y.makeObservable)(this)}};(0,d.gn)([y.observable],em.prototype,"showAllBiospecimens",void 0),(0,d.gn)([y.observable],em.prototype,"showAllCases",void 0),(0,d.gn)([y.observable],em.prototype,"_selectedFilters",void 0),(0,d.gn)([y.observable],em.prototype,"currentTab",void 0),(0,d.gn)([y.action.bound],em.prototype,"toggleShowAllBiospecimens",null),(0,d.gn)([y.action.bound],em.prototype,"toggleShowAllCases",null),(0,d.gn)([y.action.bound],em.prototype,"setFilter",null),(0,d.gn)([y.action.bound],em.prototype,"onSelectAtlas",null),em=(0,d.gn)([b.Pi],em)},37915:function(e,t,i){"use strict";i.d(t,{EP:function(){return getPublicationColumn},GV:function(){return generateColumnsForDataSchema},Re:function(){return sortByBiospecimenId},YE:function(){return generatePublicationPageTabUrl},d_:function(){return sortByParticipantId},jw:function(){return truncatedTableCell},nc:function(){return sortByParentID},xZ:function(){return getAtlasColumn}});var s=i(85893);i(67294);var a=i(96486),n=i.n(a),l=i(95868),r=i(22861),o=i(28267);function generateColumnsForDataSchema(e,t,i,a,o){let c=[];if(t){let d=(0,r.BA)(e,t);c=n().compact(d.map(e=>{let n=t[e];if(!(!n||(null==o?void 0:o.includes(n.label)))){let e=i&&i[n.label]||n.label,t=(a||{})[e],o=(null==t?void 0:t.name)||n.attribute,c=(null==t?void 0:t.headerTooltip)||n.description,d=(0,r.yz)(n)?t=>(0,s.jsx)("span",{className:"ml-auto",children:t[e]}):void 0;return{id:n.attribute,selector:e,cell:d,omit:!n.required,wrap:!0,sortable:!0,...t,name:(0,s.jsx)(l.Z,{overlay:(0,s.jsx)("span",{children:c}),children:(0,s.jsx)("span",{children:o})})}}}))}return c}function getAtlasColumn(e){let t=n().keyBy(e,e=>e.htan_id);return{id:"Atlas Name",name:(0,s.jsx)(l.Z,{overlay:"Name of the Atlas",children:(0,s.jsx)("span",{children:"Atlas Name"})}),selector:e=>t[e.atlasid].htan_name,wrap:!0,sortable:!0}}function getPublicationColumn(e){return{id:"Publications",name:"Publications",selector:"publicationIds",wrap:!0,sortable:!0,searchable:!1,omit:!1,cell:t=>{var i;return null===(i=t.publicationIds)||void 0===i?void 0:i.map(t=>e&&e[t]?(0,s.jsx)(o.ZI,{publicationManifest:e[t]}):"".concat(t," "))}}}function getDefaultHtanIdIteratees(e){return[t=>Number(e(t).split("_")[0].replace("HTA","")),t=>Number(e(t).split("_")[1])]}function defaultNumericalComparison(e,t,i){let s=0;for(let a of i)if(0!=(s=a(e)-a(t)))break;return s}function sortByParticipantId(e,t){let i=getDefaultHtanIdIteratees(e=>e.ParticipantID);return defaultNumericalComparison(e,t,i)}function sortByParentID(e,t){let i=getDefaultHtanIdIteratees(e=>e.ParentID);return defaultNumericalComparison(e,t,i)}function sortByBiospecimenId(e,t){let i=getDefaultHtanIdIteratees(e=>e.BiospecimenID);return i.push(e=>Number(e.BiospecimenID.split("_")[2])),defaultNumericalComparison(e,t,i)}function truncatedTableCell(e){let t=this.selector,i=n().isFunction(t)?t(e):e[t];return i?(0,s.jsx)(o.DZ,{fullText:i,truncateProps:{lines:4}}):null}function generatePublicationPageTabUrl(e,t){t.includes("&")&&(t=n().replace(t.toLowerCase(),RegExp("&","g"),"%26"));let i="/publications/".concat(e,"?tab=").concat(n().replace(t.toLowerCase(),RegExp(" ","g"),"-"));return i}},22861:function(e,t,i){"use strict";i.d(t,{hA:function(){return fetchAndProcessSchemaData},BA:function(){return getUniqDependencyIds},yz:function(){return isNumericalSchemaData}});var s,a,n,l,r=i(96486),o=i.n(r),c=i(83300),d=i.n(c),u=i(81249);
1let p="ncihtan/data-models",h="https://raw.githubusercontent.com",m="main",g="HTAN.model.jsonld",b=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"https://api.github.com/repos";return"".concat(t,"/").concat(e)}();async function getLatestReleaseTag(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b;try{let t=await d()("".concat(e,"/tags")),i=await t.text(),s=JSON.parse(i),a=s.filter(e=>(0,u.valid)(e.name)).sort((e,t)=>(0,u.compare)(t.name,e.name));return a[0]}catch(e){return{name:m}}}function getSchemaUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:g;return"".concat(i,"/").concat(t,"/").concat(e,"/").concat(s)}async function getLatestReleaseSchemaUrl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:b,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:g,a=await getLatestReleaseTag(e);return getSchemaUrl(a.name,t,i,s)}var y=i(23671),v=i.n(y);(s=n||(n={})).Integer="Integer",s.String="String",s.Enum="Enum",(a=l||(l={})).Biospecimen="bts:Biospecimen",a.BulkRNASeqLevel1="bts:BulkRNA-seqLevel1",a.BulkRNASeqLevel2="bts:BulkRNA-seqLevel2",a.BulkRNASeqLevel3="bts:BulkRNA-seqLevel3",a.BulkWESLevel1="bts:BulkWESLevel1",a.BulkWESLevel2="bts:BulkWESLevel2",a.BulkWESLevel3="bts:BulkWESLevel3",a.BulkMethylationSeqLevel1="bts:BulkMethylation-seqLevel1",a.BulkMethylationSeqLevel2="bts:BulkMethylation-seqLevel2",a.BulkMethylationSeqLevel3="bts:BulkMethylation-seqLevel3",a.ClinicalDataTier2="bts:ClinicalDataTier2",a.Imaging="bts:Imaging",a.ImagingLevel1="bts:ImagingLevel1",a.ImagingLevel2="bts:ImagingLevel2",a.ImagingLevel3="bts:ImagingLevel3Segmentation",a.ImagingLevel4="bts:ImagingLevel4",a.MolecularTest="bts:MolecularTest",a.scATACSeqLevel1="bts:ScATAC-seqLevel1",a.scATACSeqLevel2="bts:ScATAC-seqLevel2",a.scATACSeqLevel3="bts:ScATAC-seqLevel3",a.scATACSeqLevel4="bts:ScATAC-seqLevel4",a.scDNASeqLevel1="bts:ScDNA-seqLevel1",a.scDNASeqLevel2="bts:ScDNA-seqLevel2",a.scRNASeqLevel1="bts:ScRNA-seqLevel1",a.scRNASeqLevel2="bts:ScRNA-seqLevel2",a.scRNASeqLevel3="bts:ScRNA-seqLevel3",a.scRNASeqLevel4="bts:ScRNA-seqLevel4",a.scmCSeqLevel1="bts:ScmC-seqLevel1",a.scmCSeqLevel2="bts:ScmC-seqLevel2",a.HICSeqLevel1="bts:HI-C-seqLevel1",a.HICSeqLevel2="bts:HI-C-seqLevel2",a.HICSeqLevel3="bts:HI-C-seqLevel3",a.RPPALevel2="bts:RPPALevel2",a.RPPALevel3="bts:RPPALevel3",a.RPPALevel4="bts:RPPALevel4",a.MassSpectrometryLevel1="bts:MassSpectrometryLevel1",a.MassSpectrometryLevel2="bts:MassSpectrometryLevel2",a.MassSpectrometryLevel3="bts:MassSpectrometryLevel3",a.MassSpectrometryLevel4="bts:MassSpectrometryLevel4",a.MassSpectrometryAuxiliaryFile="bts:MassSpectrometryAuxiliaryFile",a.Demographics="bts:Demographics",a.Diagnosis="bts:Diagnosis",a.Exposure="bts:Exposure",a.FamilyHistory="bts:FamilyHistory",a.FollowUp="bts:FollowUp",a.ParticipantVitalStatusUpdate="bts:ParticipantVitalStatusUpdate",a.Therapy="bts:Therapy",a.AcuteLymphoblasticLeukemiaTier3="bts:AcuteLymphoblasticLeukemiaTier3",a.BrainCancerTier3="bts:BrainCancerTier3",a.BreastCancerTier3="bts:BreastCancerTier3",a.ColorectalCancerTier3="bts:ColorectalCancerTier3",a.LungCancerTier3="bts:LungCancerTier3",a.MelanomaTier3="bts:MelanomaTier3",a.OvarianCancerTier3="bts:OvarianCancerTier3",a.PancreaticCancerTier3="bts:PancreaticCancerTier3",a.ProstateCancerTier3="bts:ProstateCancerTier3",a.SarcomaTier3="bts:SarcomaTier3",a.AgeAtDiagnosis="bts:AgeatDiagnosis",a.YearOfDiagnosis="bts:YearofDiagnosis",a.DaysToLastFollowup="bts:DaystoLastFollowup",a.DaysToLastKnownDiseaseStatus="bts:DaystoLastKnownDiseaseStatus",a.DaysToDiagnosis="bts:DaystoDiagnosis",a.PercentTumorInvasion="bts:PercentTumorInvasion",a.GrossTumorWeight="bts:GrossTumorWeight",a.BreslowThickness="bts:BreslowThickness",a.MitoticCount="bts:MitoticCount",a.MarginDistance="bts:MarginDistance",a.TumorDepth="bts:TumorDepth",a.DaysToBirth="bt
1s:DaystoBirth",a.CollectionDaysfromIndex="bts:CollectionDaysfromIndex",a.ProcessingDaysfromIndex="bts:ProcessingDaysfromIndex",a.DysplasiaFraction="bts:DysplasiaFraction",a.NumberProliferatingCells="bts:NumberProliferatingCells",a.PercentEosinophilInfiltration="bts:PercentEosinophilInfiltration",a.PercentGranulocyteInfiltration="bts:PercentGranulocyteInfiltration",a.PercentInflamInfiltration="bts:PercentInflamInfiltration",a.PercentLymphocyteInfiltration="bts:PercentLymphocyteInfiltration",a.PercentMonocyteInfiltration="bts:PercentMonocyteInfiltration",a.PercentNecrosis="bts:PercentNecrosis",a.PercentNeutrophilInfiltration="bts:PercentNeutrophilInfiltration",a.PercentNormalCells="bts:PercentNormalCells",a.PercentStromalCells="bts:PercentStromalCells",a.PercentTumorCells="bts:PercentTumorCells",a.PercentTumorNuclei="bts:PercentTumorNuclei",a.VisiumSpatialTranscriptomicsRNASeqLevel1="bts:10xVisiumSpatialTranscriptomics-RNA-seqLevel1",a.VisiumSpatialTranscriptomicsRNASeqLevel2="bts:10xVisiumSpatialTranscriptomics-RNA-seqLevel2",a.VisiumSpatialTranscriptomicsRNASeqLevel3="bts:10xVisiumSpatialTranscriptomics-RNA-seqLevel3",a.VisiumSpatialTranscriptomicsRNASeqLevel4="bts:10xVisiumSpatialTranscriptomics-RNA-seqLevel4",a.VisiumSpatialTranscriptomicsAuxiliaryFiles="bts:10xVisiumSpatialTranscriptomics-AuxiliaryFiles",a.NanoStringGeoMxDSPSpatialTranscriptomicsLevel1="bts:NanoStringGeoMxDSPSpatialTranscriptomicsLevel1",a.NanoStringGeoMxDSPSpatialTranscriptomicsLevel2="bts:NanoStringGeoMxDSPSpatialTranscriptomicsLevel2",a.NanoStringGeoMxDSPSpatialTranscriptomicsLevel3="bts:NanoStringGeoMxDSPSpatialTranscriptomicsLevel3",a.NanostringCosMxSMIExperiment="bts:NanostringCosMxSMIExperiment",a.XeniumISSExperiment="bts:10XGenomicsXeniumISSExperiment",a.SlideSeqLevel1="bts:Slide-seqLevel1",a.SlideSeqLevel2="bts:Slide-seqLevel2",a.SlideSeqLevel3="bts:Slide-seqLevel3",a.NanoStringGeoMxDSPROIDCCSegmentAnnotationMetadata="bts:NanoStringGeoMxDSPROIDCCSegmentAnnotationMetadata",a.NanoStringGeoMxDSPROIRCCSegmentAnnotationMetadata="bts:NanoStringGeoMxDSPROIRCCSegmentAnnotationMetadata",a.ElectronMicroscopyLevel1="bts:ElectronMicroscopyLevel1",a.ElectronMicroscopyLevel2="bts:ElectronMicroscopyLevel2",a.ElectronMicroscopyLevel3="bts:ElectronMicroscopyLevel3",a.ElectronMicroscopyLevel4="bts:ElectronMicroscopyLevel4";let f={"bts:AgeatDiagnosis":!0,"bts:YearofDiagnosis":!0,"bts:DaystoLastFollowup":!0,"bts:DaystoLastKnownDiseaseStatus":!0,"bts:DaystoDiagnosis":!0,"bts:PercentTumorInvasion":!0,"bts:GrossTumorWeight":!0,"bts:BreslowThickness":!0,"bts:MitoticCount":!0,"bts:MarginDistance":!0,"bts:TumorDepth":!0,"bts:DaystoBirth":!0,"bts:CollectionDaysfromIndex":!0,"bts:ProcessingDaysfromIndex":!0,"bts:DysplasiaFraction":!0,"bts:NumberProliferatingCells":!0,"bts:PercentEosinophilInfiltration":!0,"bts:PercentGranulocyteInfiltration":!0,"bts:PercentInflamInfiltration":!0,"bts:PercentLymphocyteInfiltration":!0,"bts:PercentMonocyteInfiltration":!0,"bts:PercentNecrosis":!0,"bts:PercentNeutrophilInfiltration":!0,"bts:PercentNormalCells":!0,"bts:PercentStromalCells":!0,"bts:PercentTumorCells":!0,"bts:PercentTumorNuclei":!0},C={"@context":{},"@graph":[],"@id":""};function sortDependenciesByAttribute(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=e.map(e=>t[e]||{id:e,attribute:e});return o().sortBy(i,e=>e.attribute).map(e=>e.id)}function getAllDependencyIds(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=!(arguments.length>2)||void 0===arguments[2]||arguments[2],s=i?e.requiredDependencies:sortDependenciesByAttribute(e.requiredDependencies,t),a=sortDependenciesByAttribute(e.conditionalDependencies,t);return o().uniq([...s,...a])}function getUniqDependencyIds(e,t){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:getAllDependencyIds;return o().isEmpty(t)?[]:o().uniq(o().flatten(e.map(e=>{let s=t[e];return s?i(s,t):[]})))}async function getConditionalIfData(){try{let e=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:m,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:p,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:h,s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"HTAN.dependencies.csv";return getSchemaUrl(e,t,i,s)}(),t=await d()(e),i=await t.text(),s=await v()().fromString(i);return s.reduce((e,t)=>
1(t["Conditional Requirements"]&&(e[t.Attribute]=t["Conditional Requirements"].split(",").map(e=>e.trim().replace(/^\['|'\]$/g,""))),e),{})}catch(e){throw console.error("Error fetching or processing CSV:",e),e}}async function fetchAndProcessSchemaData(e){let t=e||await getLatestReleaseSchemaUrl(),i=function(e){let t=e&&e["@graph"]||[],i=e&&e["@context"]||{};return t.length>0?t.map(function(e){let t=normalizeEntity(e["rdfs:subClassOf"]).map(e=>e["@id"]),s=e["@id"].split(":"),a="".concat(i[s[0]]).concat(s[1]),n=normalizeEntity(e["@type"]).map(e=>e),l=normalizeEntity(e["sms:requiresDependency"]).map(e=>e["@id"]),r=normalizeEntity(e["schema:rangeIncludes"]).map(e=>e["@id"]),o=normalizeEntity(e["sms:requiresComponent"]).map(e=>e["@id"]),c=normalizeEntity(e["schema:domainIncludes"]).map(e=>e["@id"]);return{id:e["@id"],type:n,description:e["rdfs:comment"]||"",label:e["rdfs:label"],parentIds:t,attribute:e["sms:displayName"]||"",required:(null==e?void 0:e["sms:required"])==="sms:true",requiredDependencies:l,conditionalDependencies:[],exclusiveConditionalDependencies:[],conditionalIfValues:[],validationRules:e["sms:validationRules"]||[],validValues:r,domainIncludes:c,requiresComponent:o,source:a}}):[]}(await fetchSchemaData(t)),s=o().keyBy(i,e=>e.id),a=await getConditionalIfData();return function(e,t){let i=function(e){let t={};return e.forEach(e=>e.requiredDependencies.forEach(i=>{t[i]=t[i]||[],t[i].push(e.id)})),t}(e);e.forEach(e=>(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return o().compact(e.parentIds.map(e=>t[e]))})(e,t).forEach(s=>{s.requiredDependencies.includes(e.id)||(s.conditionalDependencies=s.conditionalDependencies||[],s.conditionalDependencies.push(e.id),!function(e,t,i,s){let a=s[e.id];return!o().isEmpty(a)&&(function(e,t,i){let s=[],a=[...e],n=new Set;for(;a.length>0;){let e=a.pop();if(e&&!n.has(e)){var l;let r=o().uniq([...i[e]||[],...(null===(l=t[e])||void 0===l?void 0:l.parentIds)||[]]);o().isEmpty(r)||(s.push(...r),a.push(...r)),n.add(e)}}return s})(a,i,s).includes(t.id)}(e,s,t,i)&&(s.exclusiveConditionalDependencies=s.exclusiveConditionalDependencies||[],s.exclusiveConditionalDependencies.push(e.id)))}))}(i,s),function(e,t){e.forEach(e=>{e.conditionalIfValues=t[e.attribute]||[]})}(i,a),s["bts:BulkDNALevel1"]=s["bts:BulkWESLevel1"],s["bts:BulkDNALevel2"]=s["bts:BulkWESLevel2"],s["bts:BulkDNALevel3"]=s["bts:BulkWESLevel3"],s["bts:ImagingLevel3"]=s["bts:ImagingLevel3Segmentation"],s}async function fetchSchemaData(e){if(!e)return C;try{let t=await d()(e),i=await t.text();return JSON.parse(i)}catch(e){return C}}function isNumericalSchemaData(e){return f[e.id]||!1}function normalizeEntity(e){return e?Array.isArray(e)?e:Array(e):[]}},18851:function(e){e.exports={explore:"explore_explore__saJXm"}},53788:function(e){e.exports={summary:"exploreSummary_summary__10uzp"}},43653:function(e){e.exports={atlasTab:"exploreTabs_atlasTab__AVwvC",publicationTab:"exploreTabs_publicationTab__4vRzL"}},32505:function(e){e.exports={filterCheckboxListContainer:"fileFilterControls_filterCheckboxListContainer__d2pTO"}},47058:function(e){e.exports={dsaFullImage:"fileTable_dsaFullImage__RLeVt",dsaContainer:"fileTable_dsaContainer__7EXUX",filenameTooltipContent:"fileTable_filenameTooltipContent__LCRYQ"}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.