Skip to content

Commit 6ffe2b8

Browse files
committed
Add column to map cDNA to seurat prototype
1 parent 9af6b86 commit 6ffe2b8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

singlecell/src/org/labkey/singlecell/SingleCellTableCustomizer.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,21 @@ private void customizeCdnas(AbstractTableInfo ti)
7878
ti.addColumn(newCol);
7979
}
8080

81+
String prototypeId = "prototypeId";
82+
if (ti.getColumn(prototypeId) == null)
83+
{
84+
SQLFragment sql = new SQLFragment("(SELECT max(o.rowId) as expr FROM " + SingleCellSchema.SEQUENCE_SCHEMA_NAME + "." + SingleCellSchema.TABLE_OUTPUTFILES + " o WHERE o.category = 'Seurat Object Prototype' AND o.readset = " + ExprColumn.STR_TABLE_ALIAS + ".readsetId)");
85+
ExprColumn newCol = new ExprColumn(ti, prototypeId, sql, JdbcType.INTEGER, ti.getColumn("readsetId"));
86+
newCol.setLabel("Seurat Prototype");
87+
88+
UserSchema us = QueryService.get().getUserSchema(ti.getUserSchema().getUser(), (ti.getUserSchema().getContainer().isWorkbook() ? ti.getUserSchema().getContainer().getParent() : ti.getUserSchema().getContainer()), SingleCellSchema.SEQUENCE_SCHEMA_NAME);
89+
newCol.setFk(QueryForeignKey.from(us, null)
90+
.table(SingleCellSchema.TABLE_OUTPUTFILES)
91+
.key("rowid")
92+
.display("name"));
93+
ti.addColumn(newCol);
94+
}
95+
8196
LDKService.get().applyNaturalSort(ti, "plateId");
8297
}
8398

0 commit comments

Comments
 (0)