Skip to content
Open
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
Expand Up @@ -125,7 +125,7 @@ public ApiResponse execute(LdapForm form, BindException errors) throws Exception
}
catch (LdapException e)
{
_log.error(e);
_log.error(e.getMessage(), e);
errors.reject(ERROR_MSG, e.getMessage());
return null;
}
Expand Down Expand Up @@ -528,7 +528,7 @@ public ApiResponse execute(Object form, BindException errors) throws Exception
}
catch (Exception e)
{
_log.error(e);
_log.error(e.getMessage(), e);
errors.reject(ERROR_MSG, e.getMessage() == null ? "unable to connect to LDAP server" : e.getMessage());
return null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
CREATE INDEX IDX_haplotypes_name_date ON sequenceanalysis.haplotypes
(
Name ASC,
datedisabled ASC
);

CREATE INDEX IDX_haplotype_sequences_name_haplotype_type ON sequenceanalysis.haplotype_sequences
(
haplotype ASC,
name ASC,
type ASC
);
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
CREATE NONCLUSTERED INDEX IDX_haplotypes_name_date ON sequenceanalysis.haplotypes
(
Name ASC,
datedisabled ASC
);

CREATE NONCLUSTERED INDEX IDX_haplotype_sequences_name_haplotype_type ON sequenceanalysis.haplotype_sequences
(
haplotype ASC,
name ASC,
type ASC
);

CREATE NONCLUSTERED INDEX IDX_alignment_summary_analysis_id_rowid_container_total ON sequenceanalysis.alignment_summary
(
analysis_id ASC,
rowid ASC,
container ASC
)
INCLUDE(total)

CREATE STATISTICS STAT_ref_nt_sequence_rowid_locus_container ON sequenceanalysis.ref_nt_sequences (RowId, locus, container)
WITH AUTO_DROP = OFF

CREATE STATISTICS STAT_ref_nt_sequence_locus_container ON sequenceanalysis.ref_nt_sequences (locus, container)
WITH AUTO_DROP = OFF

CREATE STATISTICS STAT_sequence_analyses_container_readset ON sequenceanalysis.sequence_analyses (Container, readset)
WITH AUTO_DROP = OFF

CREATE STATISTICS STAT_sequence_readsets_rowid_container ON sequenceanalysis.sequence_readsets (RowId, Container)
WITH AUTO_DROP = OFF

CREATE STATISTICS STAT_asj_alignmentid_container_ref_nt_id ON sequenceanalysis.alignment_summary_junction (alignment_id, container, ref_nt_id)
WITH AUTO_DROP = OFF

CREATE STATISTICS STAT_asj_alignmentid_ref_nt_id_status_alignment_id ON sequenceanalysis.alignment_summary_junction (ref_nt_id, status, alignment_id)
WITH AUTO_DROP = OFF

Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@ public ApiResponse execute(ValidateReadsetImportForm form, BindException errors)
{
ExceptionUtil.logExceptionToMothership(getViewContext().getRequest(), e);
errors.reject(ERROR_MSG, e.getMessage());
_log.error(e);
_log.error(e.getMessage(), e);
return null;
}
return new ApiSimpleResponse(resultProperties);
Expand Down Expand Up @@ -4818,7 +4818,7 @@ public ApiResponse execute(ImportTracksForm form, BindException errors) throws E
catch (IOException e)
{
errors.reject(ERROR_MSG, e.getMessage());
_log.error(e);
_log.error(e.getMessage(), e);

return null;
}
Expand All @@ -4834,7 +4834,7 @@ public ApiResponse execute(ImportTracksForm form, BindException errors) throws E
catch (PipelineValidationException e)
{
errors.reject(ERROR_MSG, e.getMessage());
_log.error(e);
_log.error(e.getMessage(), e);

return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public String getName()
@Override
public Double getSchemaVersion()
{
return 12.329;
return 12.330;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public String extractAASequence(int refNtId, List<List<Number>> exons, boolean i
}
catch (IOException e)
{
_log.error(e);
_log.error(e.getMessage(), e);
return null;
}
}
Expand Down
7 changes: 7 additions & 0 deletions Studies/resources/module.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,11 @@
<clientDependencies>
<dependency path="LDK.context"/>
</clientDependencies>
<properties>
<propertyDescriptor name="demographicsDefaultView">
<description>This view is used as the default on the demographics table</description>
<canSetPerContainer>true</canSetPerContainer>
<label>Demographics Default View</label>
</propertyDescriptor>
</properties>
</module>
41 changes: 36 additions & 5 deletions Studies/resources/views/manageStudy.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,57 @@

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

LDK.Utils.getBasicQWP({
frame: 'portal',
title: 'Cohorts',
name: 'query',
name: 'query-studies',
schemaName: 'studies',
queryName: 'studyCohorts',
filterArray: [LABKEY.Filter.create('studyId',studyId, LABKEY.Filter.Types.EQUAL)],
maxRows: 20,
renderTo: webpart.wrapperDivId + '-studyCohorts'
}).render();

if (LABKEY.getModuleContext('study')?.subject) {
const hasAssignmentDataset = !!LABKEY.getModuleContext('studies')?.hasAssignmentDataset
if (hasAssignmentDataset) {
LABKEY.Query.selectRows({
schemaName: 'studies',
queryName: 'studies',
columns: 'rowId,studyName',
filterArray: [LABKEY.Filter.create('rowId', studyId)],
failure: LDK.Utils.getErrorCallback(),
success: function(results) {
const studyName = results.rows?.[0].studyName;
LDK.Assert.assertNotEmpty('StudyName was empty in manageStudy.view', studyName);

const projectFieldName = 'allProjectsPivot/' + studyName + '::lastStartDate';
const demographicsDefaultView = LABKEY.getModuleProperty('studies', 'demographicsDefaultView')
LDK.Utils.getBasicQWP({
frame: 'portal',
title: LABKEY.moduleContext.study?.subject.nounPlural,
name: 'query-demographics',
schemaName: 'study',
queryName: 'demographics',
viewName: demographicsDefaultView,
filterArray: [LABKEY.Filter.create(projectFieldName, null, LABKEY.Filter.Types.NONBLANK)],
maxRows: 20,
renderTo: webpart.wrapperDivId + '-demographics'
}).render();
},
scope: this
});
}
}

LDK.Utils.getBasicQWP({
frame: 'portal',
title: 'Anchor Events',
name: 'query',
name: 'query-anchorEvents',
schemaName: 'studies',
queryName: 'anchorEvents',
filterArray: [LABKEY.Filter.create('studyId',studyId, LABKEY.Filter.Types.EQUAL)],
Expand All @@ -41,7 +74,7 @@
LDK.Utils.getBasicQWP({
frame: 'portal',
title: 'Expected Timepoints',
name: 'query',
name: 'query-expectedTimepoints',
schemaName: 'studies',
queryName: 'expectedTimepoints',
filterArray: [LABKEY.Filter.create('studyId',studyId, LABKEY.Filter.Types.EQUAL)],
Expand All @@ -54,6 +87,4 @@

</script>


PLACEHOLDER: Make a page that accepts a studyId and renders useful UI to manage timepoints, run QC, and show data
<br><br>
15 changes: 13 additions & 2 deletions Studies/src/org/labkey/studies/StudiesModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.json.JSONObject;
import org.labkey.api.data.Container;
import org.labkey.api.laboratory.LaboratoryService;
import org.labkey.api.ldk.ExtendedSimpleModule;
Expand All @@ -11,9 +12,9 @@
import org.labkey.api.query.QuerySchema;
import org.labkey.api.security.roles.RoleManager;
import org.labkey.api.studies.StudiesService;
import org.labkey.api.util.PageFlowUtil;
import org.labkey.studies.query.StudiesUserSchema;
import org.labkey.api.studies.security.StudiesDataAdminRole;
import org.labkey.api.writer.ContainerUser;
import org.labkey.studies.query.StudiesUserSchema;
import org.labkey.studies.study.StudiesFilterProvider;
import org.labkey.studies.study.StudyEnrollmentEventProvider;

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

@Override
public JSONObject getPageContextJson(ContainerUser context)
{
JSONObject json = super.getPageContextJson(context);

json.put("hasAssignmentDataset", StudiesServiceImpl.get().hasAssignmentDataset(context.getContainer()));

return json;
}

@Override
public void registerSchemas()
{
Expand Down
15 changes: 15 additions & 0 deletions Studies/src/org/labkey/studies/StudiesServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import org.labkey.api.security.User;
import org.labkey.api.studies.StudiesService;
import org.labkey.api.studies.study.EventProvider;
import org.labkey.api.study.Study;
import org.labkey.api.study.StudyService;
import org.labkey.api.util.ConfigurationException;
import org.labkey.api.util.FileUtil;
import org.labkey.api.util.Path;
Expand Down Expand Up @@ -173,4 +175,17 @@ public TableCustomizer getStudiesTableCustomizer()
{
return new StudiesTableCustomizer();
}

public static String ASSIGNMENT_DATASET = "assignment";

public boolean hasAssignmentDataset(Container c)
{
Study s = StudyService.get().getStudy(c.isWorkbookOrTab() ? c.getParent() : c);
if (s == null)
{
return false;
}

return s.getDatasetByName(ASSIGNMENT_DATASET) != null;
}
}
Loading