Skip to content

Commit ebfd690

Browse files
authored
GitHub Issue 875: Assay Multi-File Transform Import Skips First Data Row (#7456)
- TsvDataSerializer.exportData() to write first row regardless of if column headers written - Experiment module metric (assayRunsWithMultipleInputFiles) for count of the number of Luminex and Standard assay runs that were imported with > 1 data input file
1 parent 8d961f0 commit ebfd690

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

api/src/org/labkey/api/qc/TsvDataSerializer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ private List<String> exportData(DataIteratorBuilder data, List<String> columns,
9191
sep = "\t";
9292
}
9393
pw.println();
94-
writeRow(row, columns, pw, tsvWriter);
9594
}
95+
writeRow(row, columns, pw, tsvWriter); // GitHub Issue #875: write the first row regardless of whether we had a header or not
9696

9797
// write the remaining rows
9898
while (iter.next())

experiment/src/org/labkey/experiment/ExperimentModule.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,17 @@ SELECT COUNT(DISTINCT DD.DomainURI) FROM
652652
JOIN exp.DomainDescriptor DD on PD.domainID = DD.domainId
653653
WHERE DD.domainUri LIKE ? AND D.rangeURI = ?""", "urn:lsid:%:" + ExpProtocol.AssayDomainTypes.Result.getPrefix() + ".%", PropertyType.FILE_LINK.getTypeUri()).getObject(Long.class));
654654

655+
// metric to count the number of Luminex and Standard assay runs that were imported with > 1 data file
656+
assayMetrics.put("assayRunsWithMultipleInputFiles", new SqlSelector(schema, """
657+
SELECT COUNT(*) FROM (
658+
SELECT sourceapplicationid, COUNT(*) AS count FROM exp.data
659+
WHERE lsid NOT LIKE '%:RelatedFile.%' AND sourceapplicationid IN (
660+
SELECT rowid FROM exp.protocolapplication
661+
WHERE lsid LIKE '%:SimpleProtocol.CoreStep' AND (protocollsid LIKE '%:LuminexAssayProtocol.%' OR protocollsid LIKE '%:GeneralAssayProtocol.%')
662+
)
663+
GROUP BY sourceapplicationid
664+
) x WHERE count > 1""").getObject(Long.class));
665+
655666
Map<String, Object> sampleLookupCountMetrics = new HashMap<>();
656667
SQLFragment baseAssaySampleLookupSQL = new SQLFragment("SELECT COUNT(*) FROM exp.propertydescriptor WHERE (lookupschema = 'samples' OR (lookupschema = 'exp' AND lookupquery = 'Materials')) AND propertyuri LIKE ?");
657668

0 commit comments

Comments
 (0)