@@ -134,7 +134,7 @@ private TableInfo createAnalysesTable(TableInfo sourceTable, ContainerFilter cf)
134134 {
135135 String chr = sourceTable .getSqlDialect ().isPostgreSQL () ? "chr" : "char" ;
136136 SQLFragment sql = new SQLFragment ("(SELECT " ).
137- append (sourceTable .getSqlDialect ().getGroupConcat (new SQLFragment ("rd.category" ), true , true , chr + "(10)" )).
137+ append (sourceTable .getSqlDialect ().getGroupConcat (new SQLFragment ("rd.category" ), true , true , new SQLFragment ( chr + "(10)" ) )).
138138 append (" as expr FROM " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_OUTPUTFILES + " rd WHERE rd.analysis_id = " + ExprColumn .STR_TABLE_ALIAS + ".rowid)" );
139139 ExprColumn newCol = new ExprColumn (ret , "outputFileTypes" , sql , JdbcType .VARCHAR , sourceTable .getColumn ("rowid" ));
140140 newCol .setLabel ("Output File Types" );
@@ -189,7 +189,7 @@ private TableInfo createOutputFiles(TableInfo sourceTable, ContainerFilter cf)
189189 if (ret .getColumn ("analysisSets" ) == null )
190190 {
191191 String chr = sourceTable .getSqlDialect ().isPostgreSQL () ? "chr" : "char" ;
192- SQLFragment sql = new SQLFragment ("(SELECT " ).append (ret .getSqlDialect ().getGroupConcat (new SQLFragment ("a.name" ), true , true , chr + "(10)" )).append (" as expr FROM " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_ANALYSIS_SET_MEMBERS + " asm JOIN " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_ANALYSIS_SETS + " a ON (asm.analysisSet = a.rowid) WHERE asm.dataid = " + ExprColumn .STR_TABLE_ALIAS + ".dataid)" );
192+ SQLFragment sql = new SQLFragment ("(SELECT " ).append (ret .getSqlDialect ().getGroupConcat (new SQLFragment ("a.name" ), true , true , new SQLFragment ( chr + "(10)" ) )).append (" as expr FROM " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_ANALYSIS_SET_MEMBERS + " asm JOIN " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_ANALYSIS_SETS + " a ON (asm.analysisSet = a.rowid) WHERE asm.dataid = " + ExprColumn .STR_TABLE_ALIAS + ".dataid)" );
193193 ExprColumn newCol = new ExprColumn (ret , "analysisSets" , sql , JdbcType .VARCHAR , sourceTable .getColumn ("rowid" ));
194194 newCol .setURL (DetailsURL .fromString ("/query/executeQuery.view?schemaName=sequenceanalysis&query.queryName=analysisSetMembers&query.dataid~eq=${dataid}" , ret .getContainer ().isWorkbook () ? ret .getContainer ().getParent () : ret .getContainer ()));
195195 newCol .setLabel ("Analyses Using This File" );
@@ -283,14 +283,14 @@ public void renderGridCellContents(RenderContext ctx, Writer out) throws IOExcep
283283 newCol .setLabel ("Total Files" );
284284 ret .addColumn (newCol );
285285
286- SQLFragment sql2 = new SQLFragment ("(SELECT " ).append (sourceTable .getSqlDialect ().getGroupConcat (new SQLFragment ("d.Name" ), true , true , "',' " )).append (new SQLFragment (" as expr FROM " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_READ_DATA + " rd JOIN exp.data d ON (d.RowId = rd.fileId1 OR d.RowId = rd.fileId2) WHERE rd.readset = " + ExprColumn .STR_TABLE_ALIAS + ".rowid)" ));
286+ SQLFragment sql2 = new SQLFragment ("(SELECT " ).append (sourceTable .getSqlDialect ().getGroupConcat (new SQLFragment ("d.Name" ), true , true , ", " )).append (new SQLFragment (" as expr FROM " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_READ_DATA + " rd JOIN exp.data d ON (d.RowId = rd.fileId1 OR d.RowId = rd.fileId2) WHERE rd.readset = " + ExprColumn .STR_TABLE_ALIAS + ".rowid)" ));
287287 ExprColumn newCol2 = new ExprColumn (ret , "fileNames" , sql2 , JdbcType .VARCHAR , sourceTable .getColumn ("rowid" ));
288288 newCol2 .setURL (DetailsURL .fromString ("/query/executeQuery.view?schemaName=sequenceanalysis&query.queryName=readData&query.readset~eq=${rowid}" ));
289289 newCol2 .setLabel ("File Names" );
290290 newCol2 .setDescription ("This will display a comma-separated list of all file names with reads. This can be useful for SRA submissions." );
291291 ret .addColumn (newCol2 );
292292
293- SQLFragment sql3 = new SQLFragment ("(SELECT " ).append (sourceTable .getSqlDialect ().getGroupConcat (new SQLFragment ("rd.sra_accession" ), true , true , "',' " )).append (new SQLFragment (" as expr FROM " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_READ_DATA + " rd WHERE rd.readset = " + ExprColumn .STR_TABLE_ALIAS + ".rowid)" ));
293+ SQLFragment sql3 = new SQLFragment ("(SELECT " ).append (sourceTable .getSqlDialect ().getGroupConcat (new SQLFragment ("rd.sra_accession" ), true , true , ", " )).append (new SQLFragment (" as expr FROM " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_READ_DATA + " rd WHERE rd.readset = " + ExprColumn .STR_TABLE_ALIAS + ".rowid)" ));
294294 ExprColumn newCol3 = new ExprColumn (ret , "sraRuns" , sql3 , JdbcType .VARCHAR , sourceTable .getColumn ("rowid" ));
295295 newCol3 .setURL (DetailsURL .fromString ("/query/executeQuery.view?schemaName=sequenceanalysis&query.queryName=readData&query.readset~eq=${rowid}" ));
296296 newCol3 .setLabel ("SRA Runs" );
@@ -327,7 +327,7 @@ public void renderGridCellContents(RenderContext ctx, Writer out) throws IOExcep
327327 if (ret .getColumn ("distinctGenomes" ) == null )
328328 {
329329 String chr = ret .getSqlDialect ().isPostgreSQL () ? "chr" : "char" ;
330- SQLFragment sql = new SQLFragment ("(SELECT " ).append (ret .getSqlDialect ().getGroupConcat (new SQLFragment ("l.name" ), true , true , (chr + "(10)" ))).append (new SQLFragment (" as expr FROM " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_ANALYSES + " a JOIN " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_REF_LIBRARIES + " l ON (a.library_id = l.rowid) WHERE a.readset = " + ExprColumn .STR_TABLE_ALIAS + ".rowid)" ));
330+ SQLFragment sql = new SQLFragment ("(SELECT " ).append (ret .getSqlDialect ().getGroupConcat (new SQLFragment ("l.name" ), true , true , new SQLFragment (chr + "(10)" ))).append (new SQLFragment (" as expr FROM " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_ANALYSES + " a JOIN " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_REF_LIBRARIES + " l ON (a.library_id = l.rowid) WHERE a.readset = " + ExprColumn .STR_TABLE_ALIAS + ".rowid)" ));
331331 ExprColumn newCol = new ExprColumn (ret , "distinctGenomes" , sql , JdbcType .VARCHAR , sourceTable .getColumn ("rowid" ));
332332 newCol .setLabel ("Genomes With Alignments For Readset" );
333333 newCol .setWidth ("200" );
@@ -351,7 +351,7 @@ public void renderGridCellContents(RenderContext ctx, Writer out) throws IOExcep
351351 {
352352 String chr = sourceTable .getSqlDialect ().isPostgreSQL () ? "chr" : "char" ;
353353 SQLFragment sql = new SQLFragment ("(SELECT " ).
354- append (sourceTable .getSqlDialect ().getGroupConcat (new SQLFragment ("rd.category" ), true , true , chr + "(10)" )).
354+ append (sourceTable .getSqlDialect ().getGroupConcat (new SQLFragment ("rd.category" ), true , true , new SQLFragment ( chr + "(10)" ) )).
355355 append (" as expr FROM " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_OUTPUTFILES + " rd WHERE rd.readset = " + ExprColumn .STR_TABLE_ALIAS + ".rowid)" );
356356 ExprColumn newCol = new ExprColumn (ret , "outputFileTypes" , sql , JdbcType .VARCHAR , sourceTable .getColumn ("rowid" ));
357357 newCol .setLabel ("Output File Types" );
@@ -390,7 +390,7 @@ public void renderGridCellContents(RenderContext ctx, Writer out) throws IOExcep
390390
391391 if (ret .getColumn ("runIds" ) == null )
392392 {
393- SQLFragment sql = new SQLFragment ("(SELECT " ).append (sourceTable .getSqlDialect ().getGroupConcat (new SQLFragment ("rd.runId" ), true , true , "',' " )).append (" FROM " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_READ_DATA + " rd WHERE rd.readset = " + ExprColumn .STR_TABLE_ALIAS + ".rowid)" );
393+ SQLFragment sql = new SQLFragment ("(SELECT " ).append (sourceTable .getSqlDialect ().getGroupConcat (new SQLFragment ("rd.runId" ), true , true , ", " )).append (" FROM " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_READ_DATA + " rd WHERE rd.readset = " + ExprColumn .STR_TABLE_ALIAS + ".rowid)" );
394394 ExprColumn newCol = new ExprColumn (ret , "runIds" , sql , JdbcType .VARCHAR , sourceTable .getColumn ("rowid" ));
395395 newCol .setLabel ("Run(s)" );
396396
@@ -400,7 +400,7 @@ public void renderGridCellContents(RenderContext ctx, Writer out) throws IOExcep
400400
401401 if (ret .getColumn ("jobIds" ) == null )
402402 {
403- SQLFragment sql = new SQLFragment ("(SELECT " ).append (sourceTable .getSqlDialect ().getGroupConcat (new SQLFragment ("runs.jobId" ), true , true , "',' " )).append (" FROM " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_READ_DATA + " rd JOIN exp.experimentrun runs ON (rd.runId = runs.rowId) WHERE rd.readset = " + ExprColumn .STR_TABLE_ALIAS + ".rowid)" );
403+ SQLFragment sql = new SQLFragment ("(SELECT " ).append (sourceTable .getSqlDialect ().getGroupConcat (new SQLFragment ("runs.jobId" ), true , true , ", " )).append (" FROM " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_READ_DATA + " rd JOIN exp.experimentrun runs ON (rd.runId = runs.rowId) WHERE rd.readset = " + ExprColumn .STR_TABLE_ALIAS + ".rowid)" );
404404 ExprColumn newCol = new ExprColumn (ret , "jobIds" , sql , JdbcType .VARCHAR , sourceTable .getColumn ("rowid" ));
405405 newCol .setLabel ("Job(s)" );
406406
@@ -453,7 +453,7 @@ private TableInfo createRefSequencesTable(TableInfo sourceTable)
453453 {
454454 SharedDataTable <?> ret = new SharedDataTable <>(this , sourceTable );
455455 String chr = sourceTable .getSqlDialect ().isPostgreSQL () ? "chr" : "char" ;
456- SQLFragment sql = new SQLFragment ("(SELECT " ).append (sourceTable .getSqlDialect ().getGroupConcat (new SQLFragment ("r.name" ), true , true , chr + "(10)" )).append (" as expr FROM " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_REF_LIBRARY_MEMBERS + " rm JOIN " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_REF_LIBRARIES + " r ON (rm.library_id = r.rowid) WHERE rm.ref_nt_id = " + ExprColumn .STR_TABLE_ALIAS + ".rowid)" );
456+ SQLFragment sql = new SQLFragment ("(SELECT " ).append (sourceTable .getSqlDialect ().getGroupConcat (new SQLFragment ("r.name" ), true , true , new SQLFragment ( chr + "(10)" ) )).append (" as expr FROM " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_REF_LIBRARY_MEMBERS + " rm JOIN " + SequenceAnalysisSchema .SCHEMA_NAME + "." + SequenceAnalysisSchema .TABLE_REF_LIBRARIES + " r ON (rm.library_id = r.rowid) WHERE rm.ref_nt_id = " + ExprColumn .STR_TABLE_ALIAS + ".rowid)" );
457457 ExprColumn newCol = new ExprColumn (ret , "genomes" , sql , JdbcType .VARCHAR , sourceTable .getColumn ("rowid" ));
458458 newCol .setLabel ("Genome(s) Using Sequence" );
459459 newCol .setWidth ("200" );
0 commit comments