diff --git a/panoramapublic/src/org/labkey/panoramapublic/model/validation/SpecLibSourceFile.java b/panoramapublic/src/org/labkey/panoramapublic/model/validation/SpecLibSourceFile.java index a9cd5604..e3201817 100644 --- a/panoramapublic/src/org/labkey/panoramapublic/model/validation/SpecLibSourceFile.java +++ b/panoramapublic/src/org/labkey/panoramapublic/model/validation/SpecLibSourceFile.java @@ -88,9 +88,9 @@ public int hashCode() public JSONObject toJSON(Container container) { JSONObject jsonObject = super.toJSON(container); - if (isIdFile() && LibSourceFile.DIANN_REPORT_TSV_PLACEHOLDER.equals(getName()) && !found()) + if (isIdFile() && LibSourceFile.DIANN_REPORT_PLACEHOLDER.equals(getName()) && !found()) { - jsonObject.put("statusDetails", "The DIA-NN TSV report must be in the same directory as the " + + jsonObject.put("statusDetails", "The DIA-NN report file (.parquet or .tsv) must be in the same directory as the " + ".speclib, and share some leading characters in the file name"); } return jsonObject; diff --git a/panoramapublic/src/org/labkey/panoramapublic/proteomexchange/validator/SpecLibValidator.java b/panoramapublic/src/org/labkey/panoramapublic/proteomexchange/validator/SpecLibValidator.java index 9a71a3cd..5b18baf0 100644 --- a/panoramapublic/src/org/labkey/panoramapublic/proteomexchange/validator/SpecLibValidator.java +++ b/panoramapublic/src/org/labkey/panoramapublic/proteomexchange/validator/SpecLibValidator.java @@ -45,6 +45,10 @@ public class SpecLibValidator extends SpecLibValidation { + private static final List RAW_FILE_TYPES = List.of("raw", "wiff", "lcd", "d", "mzxml", "mzml"); + private static final String TSV = "tsv"; + private static final String PARQUET = "parquet"; + private List _docsWithLibrary; private SpecLibKeyWithSize _key; private SpecLibInfo _specLibInfo; @@ -188,20 +192,22 @@ private static List getLibSources(SpecLibReader libReader, ISpect } else if (sourceFiles.stream().anyMatch(LibSourceFile::isDiannSearch)) { - // Building a library with DIA-NN results in Skyline requires a .speclib file and a report TSV file. - // The .blib file includes the name of .speclib but not the name of the report TSV file. - // Building a library without the TSV gives this error message in Skyline: - // "...the TSV report is required to read speclib files and must be in the same directory as the speclib - // and share some leading characters (e.g. somedata-tsv.speclib and somedata-report.tsv)..." + // Building a library with DIA-NN results in Skyline requires a .speclib file and a report file (.parquet or .tsv). + // The .blib file includes the name of .speclib but not the name of the report file. + // Building a library without the report file gives this error message in Skyline: + // "...the Parquet or TSV report is required to read speclib files and must be in the same directory as the speclib + // and share some leading characters (e.g. somedata-tsv.speclib and somedata-report.parquet)..." // At some point Skyline may start including the names of all source files in the .blib SQLite file, - // so first check if any TSV files were listed as sources in the .blib - boolean hasTsvFiles = sourceFiles.stream() - .anyMatch(file -> file.hasIdFile() && file.getIdFile().toLowerCase().endsWith(".tsv")); - if (!hasTsvFiles) + // so first check if any Parquet or TSV files were listed as sources in the .blib + boolean hasReportFiles = sourceFiles.stream() + .anyMatch(file -> file.hasIdFile() + && (TSV.equals(FileUtil.getExtension(file.getIdFile().toLowerCase())) + || PARQUET.equals(FileUtil.getExtension(file.getIdFile().toLowerCase())))); + if (!hasReportFiles) { - // If there is no TSV source listed in the .blib, then add a placeholder for the DIA-NN report file. - sourceFiles.add(new LibSourceFile(null, LibSourceFile.DIANN_REPORT_TSV_PLACEHOLDER, null)); + // If there is no Parquet or TSV source listed in the .blib, then add a placeholder for the DIA-NN report file. + sourceFiles.add(new LibSourceFile(null, LibSourceFile.DIANN_REPORT_PLACEHOLDER, null)); } } @@ -254,7 +260,10 @@ private void validateLibrarySources(List sources, FileContentServ if (source.hasSpectrumSourceFile() && !checkedFiles.contains(ssf)) { checkedFiles.add(ssf); - Path path = getPath(ssf, rawFilesDirPaths, source.isMaxQuantSearch(), fcs); + // Libraries built with MaxQuant or DIA-NN v2.0 results may only have the base raw file names (without extension) + // stored in the BLIB. If the library source is either MaxQuant or DIA-NN we will compare with base file names of valid raw files. + boolean allowBaseName = source.isMaxQuantSearch() || source.isDiannSearch(); + Path path = getPath(ssf, rawFilesDirPaths, allowBaseName); SpecLibSourceFile sourceFile = new SpecLibSourceFile(ssf, SPECTRUM); sourceFile.setSpecLibValidationId(getId()); sourceFile.setPath(path != null ? path.toString() : DataFile.NOT_FOUND); @@ -263,10 +272,10 @@ private void validateLibrarySources(List sources, FileContentServ String idFile = source.getIdFile(); if (source.hasIdFile() && !checkedFiles.contains(idFile)) { - if (LibSourceFile.DIANN_REPORT_TSV_PLACEHOLDER.equals(idFile)) continue; // We will look for this when we come to the .speclib file + if (LibSourceFile.DIANN_REPORT_PLACEHOLDER.equals(idFile)) continue; // We will look for this when we come to the .speclib file checkedFiles.add(idFile); - Path path = getPath(idFile, rawFilesDirPaths, false, fcs); + Path path = getPath(idFile, rawFilesDirPaths, false); SpecLibSourceFile sourceFile = new SpecLibSourceFile(idFile, PEPTIDE_ID); sourceFile.setSpecLibValidationId(getId()); sourceFile.setPath(path != null ? path.toString() : DataFile.NOT_FOUND); @@ -274,13 +283,13 @@ private void validateLibrarySources(List sources, FileContentServ if (source.isDiannSearch()) { - // If this is a DIA-NN .speclib file, check for the required report TSV file. - // We are doing this because the .blib does not include the name of the report TSV file. - // We only know that: "the TSV report is required to read speclib files and must be in the + // If this is a DIA-NN .speclib file, check for the required report file (Parquet or TSV). + // We are doing this because the .blib does not include the name of the report file. + // We only know that: "the Parquet or TSV report is required to read speclib files and must be in the // same directory as the speclib and share some leading characters - // (e.g. somedata-tsv.speclib and somedata-report.tsv)" + // (e.g. somedata-tsv.speclib and somedata-report.parquet)" Path reportFilePath = sourceFile.found() ? getDiannReportFilePath(path) : null; - SpecLibSourceFile diannReportSourceFile = new SpecLibSourceFile(LibSourceFile.DIANN_REPORT_TSV_PLACEHOLDER, PEPTIDE_ID); + SpecLibSourceFile diannReportSourceFile = new SpecLibSourceFile(LibSourceFile.DIANN_REPORT_PLACEHOLDER, PEPTIDE_ID); diannReportSourceFile.setSpecLibValidationId(getId()); diannReportSourceFile.setPath(reportFilePath != null ? reportFilePath.toString() : DataFile.NOT_FOUND); idFiles.add(diannReportSourceFile); @@ -292,11 +301,11 @@ private void validateLibrarySources(List sources, FileContentServ setIdFiles(idFiles); } - private Path getPath(String name, Set rawFilesDirPaths, boolean isMaxquant, FileContentService fcs) + private Path getPath(String name, Set rawFilesDirPaths, boolean allowBaseName) { for (Path rawFilesDir: rawFilesDirPaths) { - Path path = findInDirectoryTree(rawFilesDir, name, isMaxquant); + Path path = findInDirectoryTree(rawFilesDir, name, allowBaseName); if (path != null) { return path; @@ -321,7 +330,19 @@ private static Path getDiannReportFilePath(Path speclibFilePath) private static Path getDiannReportFilePath(String specLibFileName, List candidateFiles) { - Map prefixLengthMap = getCommonPrefixLengthsForTsvFiles(candidateFiles, specLibFileName); + // First look for a matching Parquet file + Map prefixLengthMap = getCommonPrefixLengthsForParquetFiles(candidateFiles, specLibFileName); + // Find the Parquet file with the longest common prefix + Path parquetFile = prefixLengthMap.entrySet().stream() + .sorted((entry1, entry2) -> Integer.compare(entry2.getValue(), entry1.getValue())) // Sort descending by matching prefix length + .map(Map.Entry::getKey) // File paths + .findFirst() // Get the first file that meets the conditions + .orElse(null); + if (parquetFile != null) return parquetFile; + + + // Look for a matching TSV file if we did not find a Parquet file + prefixLengthMap = getCommonPrefixLengthsForTsvFiles(candidateFiles, specLibFileName); // Find the TSV file with the longest common prefix that also has the expected column headers in the first line return prefixLengthMap.entrySet().stream() @@ -332,12 +353,12 @@ private static Path getDiannReportFilePath(String specLibFileName, List ca .orElse(null); } - private static Map getCommonPrefixLengthsForTsvFiles(List files, String specLibFileName) + private static Map getCommonPrefixLengths(List files, String specLibFileName, String fileExtension) { String specLibFileBaseName = FileUtil.getBaseName(specLibFileName); // Remove file extension Map prefixLengthMap = new HashMap<>(); files.stream() - .filter(file -> file.getFileName().toString().toLowerCase().endsWith(".tsv")) // Ensure it's a TSV file + .filter(file -> fileExtension.equals(FileUtil.getExtension(file.getFileName().toString().toLowerCase()))) .forEach(file -> { // Get the longest common prefix length int commonPrefixLength = commonPrefixLength(specLibFileBaseName, FileUtil.getBaseName(file.getFileName().toString())); @@ -350,6 +371,16 @@ private static Map getCommonPrefixLengthsForTsvFiles(List f return prefixLengthMap; } + private static Map getCommonPrefixLengthsForTsvFiles(List files, String specLibFileName) + { + return getCommonPrefixLengths(files, specLibFileName, TSV); + } + + private static Map getCommonPrefixLengthsForParquetFiles(List files, String specLibFileName) + { + return getCommonPrefixLengths(files, specLibFileName, PARQUET); + } + private static int commonPrefixLength(String s1, String s2) { int maxLength = Math.min(s1.length(), s2.length()); @@ -418,7 +449,7 @@ private Path findInDirectoryTree(java.nio.file.Path rawFilesDirPath, String file return filePath; } - // Look for zip files + // Look for zip files, of raw files with matching base names if we are allowing basename matching. try (Stream list = Files.list(rawFilesDirPath).filter(p -> FileUtil.getFileName(p).startsWith(fileName))) { for (Path path : list.collect(Collectors.toList())) @@ -438,14 +469,27 @@ private static boolean accept(String fileName, String uploadedFileName) return accept(fileName, uploadedFileName, false); } - private static boolean accept(String fileName, String uploadedFileName, boolean allowBasenameOnly) + private static boolean accept(String fileName, String uploadedFileName, boolean allowBaseName) { // Accept QC_10.9.17.raw OR for QC_10.9.17.raw.zip // 170428_DBS_cal_7a.d OR 170428_DBS_cal_7a.d.zip - String ext = FileUtil.getExtension(uploadedFileName).toLowerCase(); + // If allowBaseName is set to true, accept + // B_240207_IO5x75_HeLa_400ng.raw (or another valid raw file extension) for B_240207_IO5x75_HeLa_400ng + String ext = FileUtil.getExtension(uploadedFileName); + ext = ext != null ? ext.toLowerCase() : ""; return fileName.equals(uploadedFileName) || ext.equals("zip") && fileName.equals(FileUtil.getBaseName(uploadedFileName)) - || (allowBasenameOnly && fileName.equals(FileUtil.getBaseName(uploadedFileName))); + || (allowBaseName && fileName.equals(getUploadedRawFileBaseName(uploadedFileName))); + } + + private static String getUploadedRawFileBaseName(String uploadedFileName) + { + String ext = FileUtil.getExtension(uploadedFileName.toLowerCase()); + if (!RAW_FILE_TYPES.stream().anyMatch(type -> type.equals(ext))) + { + return null; + } + return FileUtil.getBaseName(uploadedFileName); } public static class SpecLibKeyWithSize @@ -567,6 +611,10 @@ public void testAccept() // Accept 170428_DBS_cal_7a.d OR 170428_DBS_cal_7a.d.zip assertTrue(accept("170428_DBS_cal_7a.d", "170428_DBS_cal_7a.d")); assertTrue(accept("170428_DBS_cal_7a.d", "170428_DBS_cal_7a.d.zip")); + + assertFalse(accept("B_240207_IO5x75_HeLa_400ng", "B_240207_IO5x75_HeLa_400ng.raw")); + assertTrue(accept("B_240207_IO5x75_HeLa_400ng", "B_240207_IO5x75_HeLa_400ng.raw", true)); + assertFalse(accept("B_240207_IO5x75_HeLa_400ng", "B_240207_IO5x75_HeLa_400ng.txt", true)); } @Test diff --git a/panoramapublic/src/org/labkey/panoramapublic/speclib/LibSourceFile.java b/panoramapublic/src/org/labkey/panoramapublic/speclib/LibSourceFile.java index 2b02f709..320c574b 100644 --- a/panoramapublic/src/org/labkey/panoramapublic/speclib/LibSourceFile.java +++ b/panoramapublic/src/org/labkey/panoramapublic/speclib/LibSourceFile.java @@ -82,7 +82,7 @@ public boolean isMaxQuantSearch() return (hasIdFile() && getIdFile().endsWith("msms.txt")) || containsScoreType("MAXQUANT SCORE"); } - public static String DIANN_REPORT_TSV_PLACEHOLDER = "DIA-NN report file"; + public static String DIANN_REPORT_PLACEHOLDER = "DIA-NN report file"; // These are some of the column headers that we expect to see in a DIA-NN report TSV file public static List DIANN_REPORT_EXPECTED_HEADERS = List.of("File.Name", "Run", "Protein.Group", "Protein.Ids", "Protein.Names"); diff --git a/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/B_240207_IO5x75_HeLa_400ng_5min_synchro_6x40_100ms_Slot2-1_1_7489.raw b/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/B_240207_IO5x75_HeLa_400ng_5min_synchro_6x40_100ms_Slot2-1_1_7489.raw new file mode 100644 index 00000000..5d528f79 --- /dev/null +++ b/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/B_240207_IO5x75_HeLa_400ng_5min_synchro_6x40_100ms_Slot2-1_1_7489.raw @@ -0,0 +1 @@ +Dummy file for testing. \ No newline at end of file diff --git a/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/B_240207_IO5x75_HeLa_400ng_5min_synchro_6x40_100ms_Slot2-1_1_7491.raw b/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/B_240207_IO5x75_HeLa_400ng_5min_synchro_6x40_100ms_Slot2-1_1_7491.raw new file mode 100644 index 00000000..5d528f79 --- /dev/null +++ b/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/B_240207_IO5x75_HeLa_400ng_5min_synchro_6x40_100ms_Slot2-1_1_7491.raw @@ -0,0 +1 @@ +Dummy file for testing. \ No newline at end of file diff --git a/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/DiaNNLibrary.sky.zip b/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/DiaNNLibrary.sky.zip index d9225330..92f8c2ed 100644 Binary files a/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/DiaNNLibrary.sky.zip and b/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/DiaNNLibrary.sky.zip differ diff --git a/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/README.txt b/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/README.txt index 2afeeb50..aec528c6 100644 --- a/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/README.txt +++ b/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/README.txt @@ -1 +1,3 @@ -Files downloaded from https://panoramaweb.org/QuickProt_datasets.url (Ranish lab) \ No newline at end of file +- Files used to build the library test_diann_library.blib were downloaded from https://panoramaweb.org/QuickProt_datasets.url (Ranish lab). +- test_diann_V2_library.blib was built with test Skyline files downloaded from https://github.com/ProteoWizard/pwiz/tree/master/pwiz_tools/BiblioSpec/tests/inputs/diann2-synchro-pasef. + Raw files used for testing validation of test_diann_V2_library.blib are dummy files. \ No newline at end of file diff --git a/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/V2_report-lib.parquet.skyline.speclib b/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/V2_report-lib.parquet.skyline.speclib new file mode 100644 index 00000000..769d0b5e Binary files /dev/null and b/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/V2_report-lib.parquet.skyline.speclib differ diff --git a/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/V2_report.parquet b/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/V2_report.parquet new file mode 100644 index 00000000..ecf50c01 Binary files /dev/null and b/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/V2_report.parquet differ diff --git a/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/report-lib-for-test.parquet b/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/report-lib-for-test.parquet new file mode 100644 index 00000000..ecf50c01 Binary files /dev/null and b/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/report-lib-for-test.parquet differ diff --git a/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/report.parquet b/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/report.parquet new file mode 100644 index 00000000..ecf50c01 Binary files /dev/null and b/panoramapublic/test/sampledata/TargetedMS/panoramapublic/LibraryTest-DiaNN/report.parquet differ diff --git a/panoramapublic/test/src/org/labkey/test/pages/panoramapublic/DataValidationPage.java b/panoramapublic/test/src/org/labkey/test/pages/panoramapublic/DataValidationPage.java index f4db873c..cb6c4e35 100644 --- a/panoramapublic/test/src/org/labkey/test/pages/panoramapublic/DataValidationPage.java +++ b/panoramapublic/test/src/org/labkey/test/pages/panoramapublic/DataValidationPage.java @@ -175,6 +175,23 @@ public void verifyLibrarySourceFileStatusDetails(String file, String libraryFile ); } + // Verifies the path at which the file corresponding to a Peptide Id library source was found. + public void verifyPeptideIdFilePath(String peptideIdFile, String pathFound, String libraryFileName, String librarySize) + { + var panel = elementCache().specLibsPanel; + scrollIntoView(panel); + expandLibraryRow(panel, libraryFileName, librarySize); + + var filesTable = panel.findElement(getFilesTableLocator(libraryFileName, "lib-id-files-status")); + filesTable.findElement( + Locator.XPathLocator.tag("tbody").child("tr") + .child(Locator.tag("td").withText(peptideIdFile)) + .followingSibling("td") + .child(Locator.tag("span").withClass("pxv-valid").withText("FOUND")) + .parent().followingSibling("td").withText(pathFound) + ); + } + public void verifySpectralLibraryStatus(String libraryFile, String fileSize, String statusText, List skylineDocNames, List spectrumFiles, List spectrumFilesMissing, diff --git a/panoramapublic/test/src/org/labkey/test/tests/panoramapublic/PanoramaPublicValidationTest.java b/panoramapublic/test/src/org/labkey/test/tests/panoramapublic/PanoramaPublicValidationTest.java index 615963fc..85f3be69 100644 --- a/panoramapublic/test/src/org/labkey/test/tests/panoramapublic/PanoramaPublicValidationTest.java +++ b/panoramapublic/test/src/org/labkey/test/tests/panoramapublic/PanoramaPublicValidationTest.java @@ -12,6 +12,7 @@ import org.labkey.test.util.Ext4Helper; import org.labkey.test.util.TextSearcher; +import java.io.File; import java.util.Collections; import java.util.List; import java.util.StringJoiner; @@ -318,7 +319,7 @@ public void testDiannLibrarySources() "D14_rep2_DIA.mzML" ); List peptideIdSources = List.of("report-lib.parquet.skyline-for-test.speclib", - "DIA-NN report file" // We don't know the name of report TSV. This is a placeholder + "DIA-NN report file" // We don't know the name of report file. This is a placeholder ); goToDashboard(); @@ -338,6 +339,14 @@ public void testDiannLibrarySources() Collections.emptyList(), rawSources, List.of(peptideIdSources.get(0)), List.of(peptideIdSources.get(1))); + // Upload the Parquet files + log("Uploading Parquet files"); + List parquetFiles = List.of( + "report.parquet", + "report-lib-for-test.parquet" + ); + uploadToRawFiles(parquetFiles.stream().map(file -> testFilesFolder + "/" + file).toArray(String[]::new)); + // Upload the TSV files log("Uploading TSV files"); List tsvFiles = List.of( @@ -347,11 +356,16 @@ public void testDiannLibrarySources() "report-lib.parquet-missing-headers.tsv" ); uploadToRawFiles(tsvFiles.stream().map(file -> testFilesFolder + "/" + file).toArray(String[]::new)); - log("Running data validation job; TSV files uploaded"); + + log("Running data validation job; Parquet and TSV files uploaded"); validationPage = submitValidationJob(); verifySpecLibSourceFiles(validationPage, libraryName, skylineDoc, librarySize, Collections.emptyList(), rawSources, peptideIdSources, Collections.emptyList()); + // The validator will look for Parquet files first. Expect to see report-lib-for-test.parquet as the value in the "Path" column + validationPage.verifyPeptideIdFilePath(peptideIdSources.get(1), + "RawFiles" + File.separator + "report-lib-for-test.parquet", + libraryName,librarySize); // Move the .speclib file to a subdirectory log("Creating subdirectory and moving speclib file"); @@ -364,7 +378,7 @@ public void testDiannLibrarySources() verifySpecLibSourceFiles(validationPage, libraryName, skylineDoc, librarySize, Collections.emptyList(), rawSources, List.of(peptideIdSources.get(0)), List.of(peptideIdSources.get(1))); - String statusDetails = "(The DIA-NN TSV report must be in the same directory as the .speclib, and share some leading characters in the file name)"; + String statusDetails = "The DIA-NN report file (.parquet or .tsv) must be in the same directory as the .speclib, and share some leading characters in the file name"; validationPage.verifyLibrarySourceFileStatusDetails(peptideIdSources.get(1), libraryName, librarySize, true, statusDetails); // Move the TSV file to the same subdirectory as the .speclib file @@ -375,6 +389,48 @@ public void testDiannLibrarySources() verifySpecLibSourceFiles(validationPage, libraryName, skylineDoc, librarySize, Collections.emptyList(), rawSources, peptideIdSources, Collections.emptyList()); + + validationPage.verifyPeptideIdFilePath(peptideIdSources.get(1), + "RawFiles" + File.separator + "DIA-NN Results" + File.separator + "report-lib-for-test.tsv", + libraryName,librarySize); + + + // Test the second library. + // - This library is build with DIA-NN 2.0 results. + // - The report file is a Parquet file (V2_report.parquet) + // - The raw file names in SpectrumSourceFiles table of the .blib do not have extensions. + // Since the DIA-NN 2.0 output only includes the base file names of the raw files. + // The validator will look for any valid mass spec file that matches the given base file name. + libraryName = "test_diann_V2_library.blib"; + librarySize = "1 MB"; + List rawV2Sources = List.of( + "B_240207_IO5x75_HeLa_400ng_5min_synchro_6x40_100ms_Slot2-1_1_7489", + "B_240207_IO5x75_HeLa_400ng_5min_synchro_6x40_100ms_Slot2-1_1_7491" + ); + List peptideIdV2Sources = List.of("V2_report-lib.parquet.skyline.speclib", + "DIA-NN report file" // We don't know the name of report file. This is a placeholder + ); + log("Running data validation. All source files should be marked as missing."); + verifySpecLibSourceFiles(validationPage, libraryName, skylineDoc, librarySize, + Collections.emptyList(), rawV2Sources, + Collections.emptyList(), peptideIdV2Sources); + + log("Uploading speclib, Parquet, and raw files"); + List allLibraryFiles = List.of( + "V2_report.parquet", + "V2_report-lib.parquet.skyline.speclib", + "B_240207_IO5x75_HeLa_400ng_5min_synchro_6x40_100ms_Slot2-1_1_7491.raw", + "B_240207_IO5x75_HeLa_400ng_5min_synchro_6x40_100ms_Slot2-1_1_7489.raw" + ); + uploadToRawFiles(allLibraryFiles.stream().map(file -> testFilesFolder + "/" + file).toArray(String[]::new)); + log("Running data validation job; Parquet and raw file have been uploaded."); + validationPage = submitValidationJob(); + verifySpecLibSourceFiles(validationPage, libraryName, skylineDoc, librarySize, + rawV2Sources, Collections.emptyList(), + peptideIdV2Sources, Collections.emptyList()); + validationPage.verifyPeptideIdFilePath(peptideIdSources.get(1), + "RawFiles" + File.separator + "V2_report.parquet", + libraryName,librarySize); } private static void verifySpecLibSourceFiles(DataValidationPage validationPage, String libraryFileName, String skyZipName, String libraryFileSize, diff --git a/panoramapublic/webapp/PanoramaPublic/js/pxValidation.js b/panoramapublic/webapp/PanoramaPublic/js/pxValidation.js index 9a43be4f..00880847 100644 --- a/panoramapublic/webapp/PanoramaPublic/js/pxValidation.js +++ b/panoramapublic/webapp/PanoramaPublic/js/pxValidation.js @@ -81,8 +81,8 @@ renderFileStatus: function renderFileStatus(values, isSampleFile, link) { else status = "MISSING"; return '' + htmlEncode(status) + (link ? '' + link + '' : "") + '' - + (values.statusDetails ? '
(' - + htmlEncode(values.statusDetails) + ')
' : "") + + (values.statusDetails ? '
' + + htmlEncode(values.statusDetails) + '
' : "") + ''; }