Skip to content

Commit 1a41612

Browse files
committed
Add field to show if readset has raw reads archived
1 parent eba5e59 commit 1a41612

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<customView xmlns="http://labkey.org/data/xml/queryCustomView" label="SRA Info" canOverride="true">
2+
<columns>
3+
<column name="rowid" />
4+
<column name="name" />
5+
<column name="subjectid" />
6+
<column name="sampledate"/>
7+
<column name="platform" />
8+
<column name="librarytype" />
9+
<column name="application" />
10+
<column name="sampletype" />
11+
<column name="comments" />
12+
13+
<column name="runIds"/>
14+
<column name="jobIds"/>
15+
<column name="created" />
16+
<column name="status" />
17+
<column name="workbook" />
18+
<column name="sraRuns" />
19+
<column name="isArchived" />
20+
<column name="files" />
21+
</columns>
22+
<sorts>
23+
<sort column="rowid" descending="true"/>
24+
</sorts>
25+
</customView>

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,15 @@ public void renderGridCellContents(RenderContext ctx, Writer out) throws IOExcep
262262
ret.addColumn(newCol3);
263263
}
264264

265+
if (ret.getColumn("isArchived") == null)
266+
{
267+
SQLFragment sql = new SQLFragment("CASE WHEN (select count(*) as expr from " + SequenceAnalysisSchema.SCHEMA_NAME + "." + SequenceAnalysisSchema.TABLE_READ_DATA + " rd where rd.readset = " + ExprColumn.STR_TABLE_ALIAS + ".rowid and rd.archived = " + ret.getSqlDialect().getBooleanTRUE() + ") > 0 THEN " + ret.getSqlDialect().getBooleanTRUE() + " ELSE " + ret.getSqlDialect().getBooleanFALSE() + " END");
268+
ExprColumn newCol = new ExprColumn(ret, "isArchived", sql, JdbcType.INTEGER, sourceTable.getColumn("rowid"));
269+
newCol.setURL(DetailsURL.fromString("/query/executeQuery.view?schemaName=sequenceanalysis&query.queryName=readData&query.readset~eq=${rowid}"));
270+
newCol.setLabel("Archived To SRA?");
271+
ret.addColumn(newCol);
272+
}
273+
265274
if (ret.getColumn("totalAlignments") == null)
266275
{
267276
SQLFragment sql = new SQLFragment("(SELECT COUNT(rd.rowid) FROM " + SequenceAnalysisSchema.SCHEMA_NAME + "." + SequenceAnalysisSchema.TABLE_ANALYSES + " rd WHERE rd.readset = " + ExprColumn.STR_TABLE_ALIAS + ".rowid)");

0 commit comments

Comments
 (0)