Skip to content

Commit 168aa5c

Browse files
committed
Merge discvr-25.11 to develop
2 parents 2d3d356 + 4ebea6f commit 168aa5c

File tree

18 files changed

+558
-92
lines changed

18 files changed

+558
-92
lines changed

OpenLdapSync/src/org/labkey/openldapsync/OpenLdapSyncController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public ApiResponse execute(LdapForm form, BindException errors) throws Exception
125125
}
126126
catch (LdapException e)
127127
{
128-
_log.error(e);
128+
_log.error(e.getMessage(), e);
129129
errors.reject(ERROR_MSG, e.getMessage());
130130
return null;
131131
}
@@ -528,7 +528,7 @@ public ApiResponse execute(Object form, BindException errors) throws Exception
528528
}
529529
catch (Exception e)
530530
{
531-
_log.error(e);
531+
_log.error(e.getMessage(), e);
532532
errors.reject(ERROR_MSG, e.getMessage() == null ? "unable to connect to LDAP server" : e.getMessage());
533533
return null;
534534
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CREATE INDEX IDX_haplotypes_name_date ON sequenceanalysis.haplotypes
2+
(
3+
Name ASC,
4+
datedisabled ASC
5+
);
6+
7+
CREATE INDEX IDX_haplotype_sequences_name_haplotype_type ON sequenceanalysis.haplotype_sequences
8+
(
9+
haplotype ASC,
10+
name ASC,
11+
type ASC
12+
);
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
CREATE NONCLUSTERED INDEX IDX_haplotypes_name_date ON sequenceanalysis.haplotypes
2+
(
3+
Name ASC,
4+
datedisabled ASC
5+
);
6+
7+
CREATE NONCLUSTERED INDEX IDX_haplotype_sequences_name_haplotype_type ON sequenceanalysis.haplotype_sequences
8+
(
9+
haplotype ASC,
10+
name ASC,
11+
type ASC
12+
);
13+
14+
CREATE NONCLUSTERED INDEX IDX_alignment_summary_analysis_id_rowid_container_total ON sequenceanalysis.alignment_summary
15+
(
16+
analysis_id ASC,
17+
rowid ASC,
18+
container ASC
19+
)
20+
INCLUDE(total)
21+
22+
CREATE STATISTICS STAT_ref_nt_sequence_rowid_locus_container ON sequenceanalysis.ref_nt_sequences (RowId, locus, container)
23+
WITH AUTO_DROP = OFF
24+
25+
CREATE STATISTICS STAT_ref_nt_sequence_locus_container ON sequenceanalysis.ref_nt_sequences (locus, container)
26+
WITH AUTO_DROP = OFF
27+
28+
CREATE STATISTICS STAT_sequence_analyses_container_readset ON sequenceanalysis.sequence_analyses (Container, readset)
29+
WITH AUTO_DROP = OFF
30+
31+
CREATE STATISTICS STAT_sequence_readsets_rowid_container ON sequenceanalysis.sequence_readsets (RowId, Container)
32+
WITH AUTO_DROP = OFF
33+
34+
CREATE STATISTICS STAT_asj_alignmentid_container_ref_nt_id ON sequenceanalysis.alignment_summary_junction (alignment_id, container, ref_nt_id)
35+
WITH AUTO_DROP = OFF
36+
37+
CREATE STATISTICS STAT_asj_alignmentid_ref_nt_id_status_alignment_id ON sequenceanalysis.alignment_summary_junction (ref_nt_id, status, alignment_id)
38+
WITH AUTO_DROP = OFF
39+

SequenceAnalysis/src/org/labkey/sequenceanalysis/SequenceAnalysisController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,7 +1191,7 @@ public ApiResponse execute(ValidateReadsetImportForm form, BindException errors)
11911191
{
11921192
ExceptionUtil.logExceptionToMothership(getViewContext().getRequest(), e);
11931193
errors.reject(ERROR_MSG, e.getMessage());
1194-
_log.error(e);
1194+
_log.error(e.getMessage(), e);
11951195
return null;
11961196
}
11971197
return new ApiSimpleResponse(resultProperties);
@@ -4818,7 +4818,7 @@ public ApiResponse execute(ImportTracksForm form, BindException errors) throws E
48184818
catch (IOException e)
48194819
{
48204820
errors.reject(ERROR_MSG, e.getMessage());
4821-
_log.error(e);
4821+
_log.error(e.getMessage(), e);
48224822

48234823
return null;
48244824
}
@@ -4834,7 +4834,7 @@ public ApiResponse execute(ImportTracksForm form, BindException errors) throws E
48344834
catch (PipelineValidationException e)
48354835
{
48364836
errors.reject(ERROR_MSG, e.getMessage());
4837-
_log.error(e);
4837+
_log.error(e.getMessage(), e);
48384838

48394839
return null;
48404840
}

SequenceAnalysis/src/org/labkey/sequenceanalysis/SequenceAnalysisModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public String getName()
211211
@Override
212212
public Double getSchemaVersion()
213213
{
214-
return 12.329;
214+
return 12.330;
215215
}
216216

217217
@Override

SequenceAnalysis/src/org/labkey/sequenceanalysis/query/SequenceTriggerHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public String extractAASequence(int refNtId, List<List<Number>> exons, boolean i
136136
}
137137
catch (IOException e)
138138
{
139-
_log.error(e);
139+
_log.error(e.getMessage(), e);
140140
return null;
141141
}
142142
}

Studies/resources/module.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,11 @@
22
<clientDependencies>
33
<dependency path="LDK.context"/>
44
</clientDependencies>
5+
<properties>
6+
<propertyDescriptor name="demographicsDefaultView">
7+
<description>This view is used as the default on the demographics table</description>
8+
<canSetPerContainer>true</canSetPerContainer>
9+
<label>Demographics Default View</label>
10+
</propertyDescriptor>
11+
</properties>
512
</module>

Studies/resources/views/manageStudy.html

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,57 @@
1313

1414
const parentDiv = $('#' + webpart.wrapperDivId)
1515
parentDiv.append('<div id="' + webpart.wrapperDivId + '-studyCohorts"></div>')
16+
parentDiv.append('<div id="' + webpart.wrapperDivId + '-demographics"></div>')
1617
parentDiv.append('<div id="' + webpart.wrapperDivId + '-anchorEvents"></div>')
1718
parentDiv.append('<div id="' + webpart.wrapperDivId + '-expectedTimepoints"></div>')
1819

1920
LDK.Utils.getBasicQWP({
2021
frame: 'portal',
2122
title: 'Cohorts',
22-
name: 'query',
23+
name: 'query-studies',
2324
schemaName: 'studies',
2425
queryName: 'studyCohorts',
2526
filterArray: [LABKEY.Filter.create('studyId',studyId, LABKEY.Filter.Types.EQUAL)],
2627
maxRows: 20,
2728
renderTo: webpart.wrapperDivId + '-studyCohorts'
2829
}).render();
2930

31+
if (LABKEY.getModuleContext('study')?.subject) {
32+
const hasAssignmentDataset = !!LABKEY.getModuleContext('studies')?.hasAssignmentDataset
33+
if (hasAssignmentDataset) {
34+
LABKEY.Query.selectRows({
35+
schemaName: 'studies',
36+
queryName: 'studies',
37+
columns: 'rowId,studyName',
38+
filterArray: [LABKEY.Filter.create('rowId', studyId)],
39+
failure: LDK.Utils.getErrorCallback(),
40+
success: function(results) {
41+
const studyName = results.rows?.[0].studyName;
42+
LDK.Assert.assertNotEmpty('StudyName was empty in manageStudy.view', studyName);
43+
44+
const projectFieldName = 'allProjectsPivot/' + studyName + '::lastStartDate';
45+
const demographicsDefaultView = LABKEY.getModuleProperty('studies', 'demographicsDefaultView')
46+
LDK.Utils.getBasicQWP({
47+
frame: 'portal',
48+
title: LABKEY.moduleContext.study?.subject.nounPlural,
49+
name: 'query-demographics',
50+
schemaName: 'study',
51+
queryName: 'demographics',
52+
viewName: demographicsDefaultView,
53+
filterArray: [LABKEY.Filter.create(projectFieldName, null, LABKEY.Filter.Types.NONBLANK)],
54+
maxRows: 20,
55+
renderTo: webpart.wrapperDivId + '-demographics'
56+
}).render();
57+
},
58+
scope: this
59+
});
60+
}
61+
}
62+
3063
LDK.Utils.getBasicQWP({
3164
frame: 'portal',
3265
title: 'Anchor Events',
33-
name: 'query',
66+
name: 'query-anchorEvents',
3467
schemaName: 'studies',
3568
queryName: 'anchorEvents',
3669
filterArray: [LABKEY.Filter.create('studyId',studyId, LABKEY.Filter.Types.EQUAL)],
@@ -41,7 +74,7 @@
4174
LDK.Utils.getBasicQWP({
4275
frame: 'portal',
4376
title: 'Expected Timepoints',
44-
name: 'query',
77+
name: 'query-expectedTimepoints',
4578
schemaName: 'studies',
4679
queryName: 'expectedTimepoints',
4780
filterArray: [LABKEY.Filter.create('studyId',studyId, LABKEY.Filter.Types.EQUAL)],
@@ -54,6 +87,4 @@
5487

5588
</script>
5689

57-
58-
PLACEHOLDER: Make a page that accepts a studyId and renders useful UI to manage timepoints, run QC, and show data
5990
<br><br>

Studies/src/org/labkey/studies/StudiesModule.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import org.jetbrains.annotations.NotNull;
44
import org.jetbrains.annotations.Nullable;
5+
import org.json.JSONObject;
56
import org.labkey.api.data.Container;
67
import org.labkey.api.laboratory.LaboratoryService;
78
import org.labkey.api.ldk.ExtendedSimpleModule;
@@ -11,9 +12,9 @@
1112
import org.labkey.api.query.QuerySchema;
1213
import org.labkey.api.security.roles.RoleManager;
1314
import org.labkey.api.studies.StudiesService;
14-
import org.labkey.api.util.PageFlowUtil;
15-
import org.labkey.studies.query.StudiesUserSchema;
1615
import org.labkey.api.studies.security.StudiesDataAdminRole;
16+
import org.labkey.api.writer.ContainerUser;
17+
import org.labkey.studies.query.StudiesUserSchema;
1718
import org.labkey.studies.study.StudiesFilterProvider;
1819
import org.labkey.studies.study.StudyEnrollmentEventProvider;
1920

@@ -68,6 +69,16 @@ public Set<String> getSchemaNames()
6869
return Collections.singleton(StudiesSchema.NAME);
6970
}
7071

72+
@Override
73+
public JSONObject getPageContextJson(ContainerUser context)
74+
{
75+
JSONObject json = super.getPageContextJson(context);
76+
77+
json.put("hasAssignmentDataset", StudiesServiceImpl.get().hasAssignmentDataset(context.getContainer()));
78+
79+
return json;
80+
}
81+
7182
@Override
7283
public void registerSchemas()
7384
{

Studies/src/org/labkey/studies/StudiesServiceImpl.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import org.labkey.api.security.User;
2222
import org.labkey.api.studies.StudiesService;
2323
import org.labkey.api.studies.study.EventProvider;
24+
import org.labkey.api.study.Study;
25+
import org.labkey.api.study.StudyService;
2426
import org.labkey.api.util.ConfigurationException;
2527
import org.labkey.api.util.FileUtil;
2628
import org.labkey.api.util.Path;
@@ -173,4 +175,17 @@ public TableCustomizer getStudiesTableCustomizer()
173175
{
174176
return new StudiesTableCustomizer();
175177
}
178+
179+
public static String ASSIGNMENT_DATASET = "assignment";
180+
181+
public boolean hasAssignmentDataset(Container c)
182+
{
183+
Study s = StudyService.get().getStudy(c.isWorkbookOrTab() ? c.getParent() : c);
184+
if (s == null)
185+
{
186+
return false;
187+
}
188+
189+
return s.getDatasetByName(ASSIGNMENT_DATASET) != null;
190+
}
176191
}

0 commit comments

Comments
 (0)