Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add MHC data dashboard and validation queries #1160

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<query xmlns="http://labkey.org/data/xml/query">
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="" tableDbType="TABLE">
<tableTitle>Cached Genotyping Results Discordant With Data</tableTitle>
<columns>
<column columnName="totalTestsCached">
<columnTitle>Total Tests (Cached)</columnTitle>
</column>
<column columnName="resultCached">
<columnTitle>Result (Cached)</columnTitle>
</column>
<column columnName="scoreCached">
<columnTitle>Score (Cached)</columnTitle>
</column>
<column columnName="totalTestsSource">
<columnTitle>Total Tests (Source)</columnTitle>
</column>
<column columnName="resultSource">
<columnTitle>Result (Source)</columnTitle>
</column>
<column columnName="scoreSource">
<columnTitle>Score (Source)</columnTitle>
</column>
</columns>
</table>
</tables>
</metadata>
</query>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
SELECT
COALESCE(t1.subjectId, t2.marker) as subjectId,
COALESCE(t1.marker, t2.marker) as marker,
COALESCE(t1.assaytype, t2.assaytype) as assaytype,

t1.totalTests as totalTestsCached,
t1.result as resultCached,
t1.score as scoreCached,

t2.totalTests as totalTestsSource,
t2.result as resultSource,
t2.score as scoreSource

FROM geneticscore.mhc_data t1
FULL JOIN geneticscore.mhc_data_source t2 ON (t1.subjectId = t2.subjectId AND t1.marker = t2.marker AND t1.assaytype = t2.assaytype)

WHERE
NOT ISEQUAL(t1.totalTests, t2.totalTests) OR
NOT ISEQUAL(t1.result, t2.result)
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<query xmlns="http://labkey.org/data/xml/query">
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="" tableDbType="TABLE">
<tableTitle>Subjects Discordant Between Genotyping Results and Readsets</tableTitle>
<columns>
<column columnName="readsetSubjectId">
<columnTitle>Readset Subject Id</columnTitle>
</column>
<column columnName="folder">
<columnTitle>Genotype Folder</columnTitle>
<!-- <isHidden>true</isHidden>-->
</column>
<column columnName="container">
<columnTitle>Analysis Folder</columnTitle>
<isHidden>true</isHidden>
</column>
</columns>
</table>
</tables>
</metadata>
</query>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SELECT
a.rowId,
a.subjectId,
a.analysisId.readset.subjectId as readsetSubjectId,
a.analysisId,
a.folder,
a.analysisId.container

FROM assay.GenotypeAssay.Genotype.Data a
WHERE a.run.assayType = 'SBT' AND a.analysisId.readset.subjectId != a.subjectId
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<query xmlns="http://labkey.org/data/xml/query">
<metadata>
<tables xmlns="http://labkey.org/data/xml">
<table tableName="" tableDbType="TABLE">
<tableTitle>Subjects Discordant Between Genotyping Results and Readsets</tableTitle>
<columns>

</columns>
</table>
</tables>
</metadata>
</query>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
SELECT
a.subjectId,
a.readsetSubjectId,
a.analysisId,
a.folder

FROM geneticscore.discordantSubjectIds a
GROUP BY a.subjectId, a.readsetSubjectId, a.analysisId, a.folder
114 changes: 114 additions & 0 deletions GeneticsCore/resources/views/mhcDataDashboard.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
<script type="text/javascript" nonce="<%=scriptNonce%>">

Ext4.onReady(function (){
var webpart = <%=webpartContext%>;

Ext4.create('Ext.panel.Panel', {
renderTo: webpart.wrapperDivId,
border: false,
items: [{
xtype: 'panel',
border: false,
defaults: {
border: false
},
items: [{
html: 'This page contains links and reports designed to help manage MHC data.'
}]
},{
xtype: 'ldk-navpanel',
style: 'padding-top: 20px;',
border: false,
sections: [{
header: 'Sample/Data QC',
items: [{
name: 'Subjects Discordant Between Genotyping Results and Readsets',
url: LABKEY.ActionURL.buildURL('query', 'executeQuery.view', null, {
schemaName: 'geneticscore',
queryName: 'discordantSubjectIdsGrouped'
})
},{
name: 'Genotyping Results Not Connected to an Analysis',
url: LABKEY.ActionURL.buildURL('query', 'executeQuery.view', null, {
schemaName: 'assay',
queryName: 'GenotypeAssay.Genotype.Data',
'query.analysisId/rowId~isblank': ''
})
},{
name: 'Discordant Cached Results',
url: LABKEY.ActionURL.buildURL('query', 'executeQuery.view', null, {
schemaName: 'geneticscore',
queryName: 'discordantCachedResults'
})
},{
name: 'Analyses Using Non-Passing Readsets',
url: LABKEY.ActionURL.buildURL('query', 'executeQuery.view', null, {
schemaName: 'sequenceanalysis',
queryName: 'sequence_analyses',
'query.readset/status~isnonblank': null
})
}]
},{
header: 'Data and Processing',
items: [{
name: 'All Analyses',
url: LABKEY.ActionURL.buildURL('query', 'executeQuery.view', null, {
schemaName: 'sequenceanalysis',
queryName: 'sequence_analyses',
'query.viewName': 'SBT Information',
'query.readset~nonblank': null,
})
},{
name: 'Analyses without Cached Results',
url: LABKEY.ActionURL.buildURL('query', 'executeQuery.view', null, {
schemaName: 'sequenceanalysis',
queryName: 'sequence_analyses',
'query.viewName': 'SBT Information',
'query.readset~nonblank': null,
'query.readset/status~isblank': null,
'query.numCachedResults~gt': 0,
})
},{
name: 'Readsets Without Alignments',
url: LABKEY.ActionURL.buildURL('query', 'executeQuery.view', null, {
schemaName: 'sequenceanalysis',
queryName: 'sequence_readsets',
'query.totalAlignments~eq': 0,
'query.totalForwardReads~isnonblank': null,
'query.status~isblank': null,
'query.isArchived~eq': 0,
'query.sort': 'name',
'query.maxRows': 250
})
},{
name: 'Cached MHC Typing Results (source data for PRIMe)',
url: LABKEY.ActionURL.buildURL('query', 'executeQuery.view', null, {
schemaName: 'geneticscore',
queryName: 'mhc_data'
})
}]
},{
header: 'Data Archival',
items: [{
name: 'Readsets Not Archived to SRA',
url: LABKEY.ActionURL.buildURL('query', 'executeQuery.view', null, {
schemaName: 'sequenceanalysis',
queryName: 'sequence_readsets',
'query.totalForwardReads~isnonblank': null,
'query.isArchived~eq': 0
}
)
},{
name: 'BAM (not CRAM) Files',
url: LABKEY.ActionURL.buildURL('query', 'executeQuery.view', null, {
schemaName: 'sequenceanalysis',
queryName: 'outputfiles',
'query.dataid/DataFileUrl~contains': '.bam'
}
)
}]
}]
}]
});
});
</script>
8 changes: 8 additions & 0 deletions GeneticsCore/resources/views/mhcDataDashboard.view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<view xmlns="http://labkey.org/data/xml/view" title="MHC Typing Dashboard">
<permissionClasses>
<permissionClass name="org.labkey.api.security.permissions.ReadPermission"/>
</permissionClasses>
<dependencies>

</dependencies>
</view>
6 changes: 6 additions & 0 deletions GeneticsCore/resources/views/mhcDataDashboard.webpart.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<webpart xmlns="http://labkey.org/data/xml/webpart" title="MHC Typing Dashboard">
<view name="mhcDataDashboard"/>
<locations>
<location name="body"/>
</locations>
</webpart>
4 changes: 2 additions & 2 deletions GeneticsCore/src/org/labkey/GeneticsCore/mhc/MhcTaskRef.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ public RecordedActionSet run(@NotNull PipelineJob job) throws PipelineJobExcepti

for (String subject : subjects)
{
processSubject(job, subject);

if (job.isCancelled())
{
throw new CancelledException();
}

processSubject(job, subject);
}

job.getLogger().info("Done!");
Expand Down