Skip to content

Commit aa67d2c

Browse files
committed
Merge discvr-26.3 to develop
2 parents 42480c2 + 6117efe commit aa67d2c

File tree

26 files changed

+270
-105
lines changed

26 files changed

+270
-105
lines changed

GenotypeAssays/resources/views/sbtReview.html

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,9 @@
159159
//sort: '-percent',
160160
containerPath: Laboratory.Utils.getQueryContainerPath(),
161161
removeableFilters: [
162-
LABKEY.Filter.create('percent_from_locus', 0.25, LABKEY.Filter.Types.GTE)
162+
LABKEY.Filter.create('percent_from_locus', 0.25, LABKEY.Filter.Types.GTE),
163+
LABKEY.Filter.create('analysis_id', analysisId, LABKEY.Filter.Types.EQUALS)
163164
],
164-
parameters: {
165-
AnalysisId: analysisId
166-
},
167165
scope: this,
168166
success: this.onDataRegionLoad
169167
})
@@ -180,12 +178,10 @@
180178
containerPath: Laboratory.Utils.getQueryContainerPath(),
181179
removeableFilters: [
182180
LABKEY.Filter.create('percent_from_locus', 0.25, LABKEY.Filter.Types.GTE),
183-
LABKEY.Filter.create('total_reads', 5, LABKEY.Filter.Types.GT),
184-
LABKEY.Filter.create('totalLineages', 1, LABKEY.Filter.Types.EQUAL)
181+
LABKEY.Filter.create('total_reads_from_locus', 5, LABKEY.Filter.Types.GT),
182+
LABKEY.Filter.create('totalLineages', 1, LABKEY.Filter.Types.EQUAL),
183+
LABKEY.Filter.create('analysis_id', analysisId, LABKEY.Filter.Types.EQUAL)
185184
],
186-
parameters: {
187-
AnalysisId: analysisId
188-
},
189185
scope: this,
190186
success: this.onDataRegionLoad
191187
})
@@ -195,7 +191,7 @@
195191
title: 'Haplotype Matches',
196192
items: [{
197193
xtype: 'genotypeassays-haplotypepanel',
198-
analysisId: [analysisId]
194+
analysisIds: [analysisId]
199195
}]
200196
},{
201197
xtype: 'ldk-querypanel',

GenotypeAssays/resources/web/genotypeassays/buttons.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ GenotypeAssays.buttons = new function(){
2828

2929
var newForm = Ext4.DomHelper.append(document.getElementsByTagName('body')[0],
3030
'<form method="POST" action="' + LABKEY.ActionURL.buildURL("genotypeassays", "bulkHaplotype", null) + '">' +
31-
'<input type="hidden" name="analysisId" value="' + Ext4.htmlEncode(checked[0]) + '" />' +
31+
'<input type="hidden" name="analysisIds" value="' + Ext4.htmlEncode(checked.join(';')) + '" />' +
3232
'</form>');
3333
newForm.submit();
3434
}

GenotypeAssays/resources/web/genotypeassays/panel/HaplotypePanel.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Ext4.define('GenotypeAssays.panel.HaplotypePanel', {
22
extend: 'Ext.panel.Panel',
33
alias: 'widget.genotypeassays-haplotypepanel',
4-
analysisId: null,
4+
analysisIds: null,
55
showCheckBoxes: false,
66

77
initComponent: function(){
@@ -461,13 +461,11 @@ Ext4.define('GenotypeAssays.panel.HaplotypePanel', {
461461
schemaName: 'sequenceanalysis',
462462
queryName: 'alignment_summary_by_lineage',
463463
columns: 'analysis_id,analysis_id/readset,analysis_id/readset/subjectId,lineages,loci,total,total_reads,percent,total_reads_from_locus,percent_from_locus',
464-
parameters: {
465-
AnalysisId: this.analysisId
466-
},
467464
apiVersion: 13.2,
468465
scope: this,
469466
filterArray: [
470-
LABKEY.Filter.create('percent_from_locus', minPct || 0, LABKEY.Filter.Types.GTE)
467+
LABKEY.Filter.create('percent_from_locus', minPct || 0, LABKEY.Filter.Types.GTE),
468+
LABKEY.Filter.create('analysis_id', this.analysisIds, LABKEY.Filter.Types.IN)
471469
],
472470
failure: LDK.Utils.getErrorCallback(),
473471
success: function(results){
@@ -501,13 +499,13 @@ Ext4.define('GenotypeAssays.panel.HaplotypePanel', {
501499
schemaName: 'sequenceanalysis',
502500
queryName: 'alignment_summary_grouped',
503501
columns: 'analysis_id,lineages,loci,alleles,total_reads,percent,total_reads_from_locus,percent_from_locus',
502+
filterArray: [
503+
LABKEY.Filter.create('analysis_id', this.analysisIds, LABKEY.Filter.Types.IN)
504+
],
504505
// This is designed to remove the view-level sorts:
505506
sort: 'analysis_id',
506507
apiVersion: 13.2,
507508
scope: this,
508-
parameters: {
509-
AnalysisId: this.analysisId
510-
},
511509
failure: LDK.Utils.getErrorCallback(),
512510
success: function(results){
513511
this.lineageToAlleleMap = {};

GenotypeAssays/resources/web/genotypeassays/window/PublishResultsWindow.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,8 @@ Ext4.define('GenotypeAssays.window.PublishResultsWindow', {
1111
return;
1212
}
1313

14-
const analysisId = dr.getParameters()?.AnalysisId;
15-
if (!analysisId) {
16-
Ext4.Msg.alert('Error', 'Error: unable to find analysisId. This should not occur.');
17-
LDK.Assert.assertNotEmpty('Unable to find AnalysisId parameter from the DataRegion in PublishResultsWindow');
18-
19-
return;
20-
}
21-
2214
Ext4.create('GenotypeAssays.window.PublishResultsWindow', {
2315
dataRegionName: dataRegionName,
24-
analysisId: analysisId,
2516
actionName: 'cacheAnalyses'
2617
}).show();
2718
}
@@ -116,7 +107,6 @@ Ext4.define('GenotypeAssays.window.PublishResultsWindow', {
116107
scope: this,
117108
jsonData: {
118109
alleleNames: alleleNames,
119-
analysisId: this.analysisId,
120110
json: Ext4.encode(this.json),
121111
protocolId: protocol
122112
},

GenotypeAssays/src/org/labkey/genotypeassays/GenotypeAssaysController.java

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@
2424
import org.labkey.api.action.MutatingApiAction;
2525
import org.labkey.api.action.SpringActionController;
2626
import org.labkey.api.data.DbSchema;
27+
import org.labkey.api.data.DbSchemaType;
2728
import org.labkey.api.data.SqlExecutor;
2829
import org.labkey.api.data.TableInfo;
2930
import org.labkey.api.exp.api.ExpProtocol;
3031
import org.labkey.api.exp.api.ExperimentService;
3132
import org.labkey.api.security.RequiresPermission;
3233
import org.labkey.api.security.permissions.ReadPermission;
3334
import org.labkey.api.security.permissions.UpdatePermission;
35+
import org.labkey.api.util.HtmlString;
3436
import org.labkey.api.util.Pair;
3537
import org.labkey.api.util.URLHelper;
3638
import org.labkey.api.view.HtmlView;
@@ -53,7 +55,7 @@ public GenotypeAssaysController()
5355
}
5456

5557
@RequiresPermission(ReadPermission.class)
56-
public class MigrateLegacySSPAction extends ConfirmAction<Object>
58+
public static class MigrateLegacySSPAction extends ConfirmAction<Object>
5759
{
5860
@Override
5961
public void validateCommand(Object form, Errors errors)
@@ -64,19 +66,19 @@ public void validateCommand(Object form, Errors errors)
6466
@Override
6567
public ModelAndView getConfirmView(Object form, BindException errors) throws Exception
6668
{
67-
DbSchema schema = DbSchema.get("SSP_Assay");
69+
DbSchema schema = DbSchema.get("SSP_Assay", DbSchemaType.Module);
6870
if (schema == null)
69-
return new HtmlView("Either the legacy SSP module has not been installed, or it has already been removed");
71+
return new HtmlView(HtmlString.of("Either the legacy SSP module has not been installed, or it has already been removed"));
7072
else
71-
return new HtmlView("This allows an admin to copy any primers stored in the original SSP Assay module into the new genotyping module. Any data has already been copied. Do you want to continue?");
73+
return new HtmlView(HtmlString.of("This allows an admin to copy any primers stored in the original SSP Assay module into the new genotyping module. Any data has already been copied. Do you want to continue?"));
7274
}
7375

7476
@Override
7577
public boolean handlePost(Object form, BindException errors) throws Exception
7678
{
7779
try
7880
{
79-
DbSchema schema = DbSchema.get("SSP_Assay");
81+
DbSchema schema = DbSchema.get("SSP_Assay", DbSchemaType.Module);
8082
if (schema == null)
8183
return true; //module not installed
8284

@@ -113,7 +115,7 @@ public URLHelper getSuccessURL(Object form)
113115
}
114116

115117
@RequiresPermission(UpdatePermission.class)
116-
public class CacheAnalysesAction extends MutatingApiAction<CacheAnalysesForm>
118+
public static class CacheAnalysesAction extends MutatingApiAction<CacheAnalysesForm>
117119
{
118120
@Override
119121
public ApiResponse execute(CacheAnalysesForm form, BindException errors)
@@ -133,7 +135,7 @@ public ApiResponse execute(CacheAnalysesForm form, BindException errors)
133135
}
134136

135137
String[] alleleNames = Arrays.stream(form.getAlleleNames()).map(StringEscapeUtils::unescapeHtml4).toArray(String[]::new);
136-
Pair<List<Long>, List<Long>> ret = GenotypeAssaysManager.get().cacheAnalyses(getViewContext(), form.getAnalysisId(), protocol, alleleNames);
138+
Pair<List<Long>, List<Long>> ret = GenotypeAssaysManager.get().cacheAnalyses(getViewContext(), protocol, alleleNames);
137139
resultProperties.put("runsCreated", ret.first);
138140
resultProperties.put("runsDeleted", ret.second);
139141
}
@@ -159,7 +161,6 @@ public static class CacheAnalysesForm
159161
{
160162
private String[] _alleleNames;
161163
private String _json;
162-
private int _analysisId;
163164
private int _protocolId;
164165

165166
public String[] getAlleleNames()
@@ -191,20 +192,10 @@ public void setJson(String json)
191192
{
192193
_json = json;
193194
}
194-
195-
public int getAnalysisId()
196-
{
197-
return _analysisId;
198-
}
199-
200-
public void setAnalysisId(int analysisId)
201-
{
202-
_analysisId = analysisId;
203-
}
204195
}
205196

206197
@RequiresPermission(UpdatePermission.class)
207-
public class CacheHaplotypesAction extends MutatingApiAction<CacheAnalysesForm>
198+
public static class CacheHaplotypesAction extends MutatingApiAction<CacheAnalysesForm>
208199
{
209200
@Override
210201
public ApiResponse execute(CacheAnalysesForm form, BindException errors)

GenotypeAssays/src/org/labkey/genotypeassays/GenotypeAssaysManager.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public static GenotypeAssaysManager get()
9090
return _instance;
9191
}
9292

93-
public Pair<List<Long>, List<Long>> cacheAnalyses(final ViewContext ctx, final int analysisId, final ExpProtocol protocol, String[] pks) throws IllegalArgumentException
93+
public Pair<List<Long>, List<Long>> cacheAnalyses(final ViewContext ctx, final ExpProtocol protocol, String[] pks) throws IllegalArgumentException
9494
{
9595
final User u = ctx.getUser();
9696
final List<Long> runsCreated = new ArrayList<>();
@@ -125,7 +125,6 @@ public Pair<List<Long>, List<Long>> cacheAnalyses(final ViewContext ctx, final i
125125

126126
AtomicInteger records = new AtomicInteger();
127127
TableSelector tsAlignments = new TableSelector(tableAlignments, cols.values(), new SimpleFilter(FieldKey.fromString("key"), Arrays.asList(pks), CompareType.IN), null);
128-
tsAlignments.setNamedParameters(Map.of("AnalysisId", analysisId));
129128

130129
tsAlignments.forEach(new Selector.ForEachBlock<ResultSet>()
131130
{

SivStudies/resources/queries/study/demographics/Expanded Vaccine Detail.qview.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<column name="interventions/allInterventions"/>
1515
<column name="interventions/firstInterventionDPI"/>
1616
<column name="pvlInfo/numPVL"/>
17+
<column name="pvlInfo/lastPvlWPI"/>
1718
</columns>
1819
<sorts>
1920
<sort column="Id" descending="false"/>

SivStudies/src/org/labkey/sivstudies/etl/PerformManualIdrStepsTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ public void setContainerUser(ContainerUser containerUser)
294294

295295
private void updateJS46() throws PipelineJobException
296296
{
297-
updateTreatmentRecords("JS46", new SimpleFilter(FieldKey.fromString("treatment"), "SIV - Unknown"), Map.of("treatment", "SIVmac239", "route", "IV"));
297+
updateTreatmentRecords("JS46", new SimpleFilter(FieldKey.fromString("treatment"), "SIV - Unknown"), Map.of("treatment", "SIVmac239", "route", "Rectal", "amount", 1500, "amount_units", "TCID50"));
298298
}
299299

300300
private void updateTreatmentRecords(String cohortName, SimpleFilter treatmentFilter, final Map<String, Object> additionalProps) throws PipelineJobException

SivStudies/src/org/labkey/sivstudies/query/SivStudiesCustomizer.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,11 @@ public TableInfo getLookupTableInfo()
464464
qd.setSql("SELECT\n" +
465465
"min(tr.date) as artInitiation,\n" +
466466
"CONVERT(TIMESTAMPDIFF('SQL_TSI_DAY', CAST(min(tr.date) AS DATE), CAST(c." + dateColName + " AS DATE)), INTEGER) as daysPostArtInitiation,\n" +
467+
"CONVERT(TIMESTAMPDIFF('SQL_TSI_DAY', CAST(min(tr.date) AS DATE), CAST(c." + dateColName + " AS DATE)) / 7, INTEGER) as weeksPostArtInitiation,\n" +
467468
"CONVERT(age_in_months(CAST(min(tr.date) AS DATE), CAST(c." + dateColName + " AS DATE)), FLOAT) as monthsPostArtInitiation,\n" +
468469
"max(tr.enddate) as artRelease,\n" +
469470
"CONVERT(CASE WHEN max(tr.enddate) IS NULL THEN NULL ELSE TIMESTAMPDIFF('SQL_TSI_DAY', CAST(max(tr.enddate) AS DATE), CAST(c." + dateColName + " AS DATE)) END, INTEGER) as daysPostArtRelease,\n" +
471+
"CONVERT(CASE WHEN max(tr.enddate) IS NULL THEN NULL ELSE TIMESTAMPDIFF('SQL_TSI_DAY', CAST(max(tr.enddate) AS DATE), CAST(c." + dateColName + " AS DATE)) END / 7, INTEGER) as weeksPostArtRelease,\n" +
470472
"CONVERT(CASE WHEN max(tr.enddate) IS NULL THEN NULL ELSE age_in_months(CAST(max(tr.enddate) AS DATE), CAST(c." + dateColName + " AS DATE)) END, FLOAT) as monthsPostArtRelease,\n" +
471473
"CAST(CASE WHEN CAST(min(tr.date) AS DATE) <= CAST(c." + dateCol.getFieldKey().toString() + " AS DATE) AND CAST(max(coalesce(tr.enddate, now())) AS DATE) >= CAST(c." + dateCol.getFieldKey().toString() + " AS DATE) THEN 'Y' ELSE null END as VARCHAR) as onArt,\n" +
472474
"GROUP_CONCAT(DISTINCT tr.treatment) AS artTreatment,\n" +
@@ -499,9 +501,11 @@ public TableInfo getLookupTableInfo()
499501
((BaseColumnInfo)ti.getColumn("artRelease")).setLabel("ART Release");
500502

501503
((BaseColumnInfo)ti.getColumn("daysPostArtInitiation")).setLabel("Days Post-ART Initiation");
504+
((BaseColumnInfo)ti.getColumn("weeksPostArtInitiation")).setLabel("Weeks Post-ART Initiation");
502505
((BaseColumnInfo)ti.getColumn("monthsPostArtInitiation")).setLabel("Months Post-ART Initiation");
503506

504507
((BaseColumnInfo)ti.getColumn("daysPostArtRelease")).setLabel("Days Post-ART Release");
508+
((BaseColumnInfo)ti.getColumn("weeksPostArtRelease")).setLabel("Weeks Post-ART Release");
505509
((BaseColumnInfo)ti.getColumn("monthsPostArtRelease")).setLabel("Months Post-ART Release");
506510

507511
((BaseColumnInfo)ti.getColumn("artTreatment")).setLabel("ART Treatment(s)");

mGAP/src/org/labkey/mgap/mGAPModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public void doStartupAfterSpringConfig(ModuleContext moduleContext)
110110

111111
ContentSecurityPolicyFilter.registerAllowedSources(this.getClass().getName(), Directive.Connection, "https://code.jquery.com", "https://*.fontawesome.com");
112112
ContentSecurityPolicyFilter.registerAllowedSources(this.getClass().getName(), Directive.Style, "https://code.jquery.com", "https://www.gstatic.com");
113-
ContentSecurityPolicyFilter.registerAllowedSources(this.getClass().getName(), Directive.Font, "https://*.fontawesome.com");
113+
ContentSecurityPolicyFilter.registerAllowedSources(this.getClass().getName(), Directive.Font, "https://*.fontawesome.com", "https://fonts.googleapis.com");
114114
ContentSecurityPolicyFilter.registerAllowedSources(this.getClass().getName(), Directive.Connection, "https://oss.maxcdn.com");
115115

116116
new PipelineStartup();

0 commit comments

Comments
 (0)