Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ else if(isMolecule)
//skip selected precursors that are already excluded
selectedRowsKeys.forEach(id -> {
List<ExcludedPrecursor> prec = precursorsList.stream().filter(p -> p.getId() == id).toList();
ExcludedPrecursor precursor = prec.get(0);
ExcludedPrecursor precursor = prec.getFirst();
precursor.setIsPeptide(isPeptide);

if (isExcluding)
Expand Down
13 changes: 7 additions & 6 deletions src/org/labkey/targetedms/SkylineAuditLogManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private int persistAuditLog(User user, AuditLogImportContext pContext, SkylineAu
ent.setDocumentGUID(pContext._documentGUID);
pContext._rootHash.update(ent.getEntryHash().getBytes(StandardCharsets.UTF_8));
// Insert at the beginning of the list so we can quickly iterate in reverse order for validation
entries.add(0, ent);
entries.addFirst(ent);
}
catch (XMLStreamException e)
{
Expand Down Expand Up @@ -247,7 +247,7 @@ private int persistAuditLog(User user, AuditLogImportContext pContext, SkylineAu
}

if (pContext._runId != null) //set the document version id on the chronologically last log entry.
entries.get(entries.size() - 1).setVersionId(pContext._runId);
entries.getLast().setVersionId(pContext._runId);

AuditLogTree treePointer = pContext._logTree;
int persistedEntriesCount = 0;
Expand Down Expand Up @@ -280,7 +280,7 @@ private int persistAuditLog(User user, AuditLogImportContext pContext, SkylineAu
}
}
if (persistedEntriesCount == 0) //if no entries were actually saved into the database we are uploading an earlier document version
entries.get(entries.size() - 1).insertRunAuditLogEntry(user, pContext._runId); //and still need to update the terminal entry with the versionId.
entries.getLast().insertRunAuditLogEntry(user, pContext._runId); //and still need to update the terminal entry with the versionId.

return entries.size();
}
Expand All @@ -304,7 +304,8 @@ private void verifyPostRequisites(AuditLogImportContext pContext, SkylineAuditLo
* Builds a tree of audit log entry tokens representing the document versioning tree
* @return the root node of the tree
*/
private AuditLogTree buildLogTree(@NotNull GUID pDocumentGUID) throws AuditLogException {
private AuditLogTree buildLogTree(@NotNull GUID pDocumentGUID)
{

TableInfo entryTbl = TargetedMSManager.getTableInfoSkylineAuditLogEntry();

Expand Down Expand Up @@ -440,7 +441,7 @@ private TargetedMSRun getNewRun(GUID pDocumentGUID, Container container)
run.setContainer(container);
run.setDocumentGUID(pDocumentGUID);
Table.insert(_user, TargetedMSManager.getTableInfoRuns(), run);
_logger.info(String.format("new run is inserted with id %d", run.getId()));
_logger.info("new run is inserted with id {}", run.getId());
return run;
}

Expand Down Expand Up @@ -564,7 +565,7 @@ public void addAVersionTest() throws IOException, AuditLogException

for(String fileName : testFileNames)
{
_logger.info("AuditLogFiles/" + fileName);
_logger.info("AuditLogFiles/{}", fileName);
runs.push(getNewRun(_docGUID));
tree = persistALogFile("AuditLogFiles/" + fileName, runs.peek());
}
Expand Down
2 changes: 1 addition & 1 deletion src/org/labkey/targetedms/SkylineBinaryDataHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public DataType getDataType()
}

@Override
public void importFile(@NotNull ExpData data, @NotNull FileLike dataFile, @NotNull ViewBackgroundInfo info, @NotNull Logger log, @NotNull XarContext context) throws ExperimentException
public void importFile(@NotNull ExpData data, @NotNull FileLike dataFile, @NotNull ViewBackgroundInfo info, @NotNull Logger log, @NotNull XarContext context)
{
}

Expand Down
61 changes: 28 additions & 33 deletions src/org/labkey/targetedms/SkylineDocImporter.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public TargetedMSRun importRun(RunInfo runInfo, PipelineJob job) throws IOExcept
// Skip if run was already fully imported
if (run.getStatusId() == SkylineDocImporter.STATUS_SUCCESS)
{
_log.info(_expData.getName() + " has already been imported so it does not need to be imported again");
_log.info("{} has already been imported so it does not need to be imported again", _expData.getName());
return run;
}

Expand Down Expand Up @@ -249,9 +249,9 @@ public TargetedMSRun importRun(RunInfo runInfo, PipelineJob job) throws IOExcept
saveRunDocumentSize(run);

updateRunStatus(IMPORT_STARTED);
_log.info("Starting to import Skyline document from " + run.getFileName());
_log.info("Starting to import Skyline document from {}", run.getFileName());
importSkylineDoc(run, inputFile.toNioPathForRead().toFile());
_log.info("Completed import of Skyline document from " + run.getFileName());
_log.info("Completed import of Skyline document from {}", run.getFileName());

updateRunStatus(IMPORT_SUCCEEDED, STATUS_SUCCESS);

Expand Down Expand Up @@ -401,17 +401,14 @@ private void importSkylineDoc(TargetedMSRun run, File f) throws XMLStreamExcepti
modInfo, libraryNameIdMap, pepGroup, parser, peptides, smallMolecules, parser.getTransitionSettings());
if (++peptideGroupCount % 100 == 0)
{
_log.info("Imported " + peptideGroupCount + " peptide groups.");
_log.info("Imported {} peptide groups.", peptideGroupCount);
}
}

if (!_shouldSaveTransitionChromInfos)
{
TargetedMSModule targetedMSModule = ModuleLoader.getInstance().getModule(TargetedMSModule.class);
_log.info("None of the " + parser.getTransitionChromInfoCount() + " TransitionChromInfos in the file " +
"were imported because they exceed the limit of " +
targetedMSModule.MAX_TRANSITION_CHROM_INFOS_PROPERTY.getEffectiveValue(_container) + " and there are more than " +
targetedMSModule.MAX_PRECURSORS_PROPERTY.getEffectiveValue(_container) + " precursors");
_log.info("None of the {} TransitionChromInfos in the file were imported because they exceed the limit of {} and there are more than {} precursors", parser.getTransitionChromInfoCount(), targetedMSModule.MAX_TRANSITION_CHROM_INFOS_PROPERTY.getEffectiveValue(_container), targetedMSModule.MAX_PRECURSORS_PROPERTY.getEffectiveValue(_container));
}

// Done parsing document
Expand Down Expand Up @@ -546,7 +543,7 @@ private void calculateSampleFileIRTStats(TargetedMSRun run, ReplicateInfo replic
return;
}

_log.info("Calculating iRT correlations for " + replicateInfo.skylineIdSampleFileIdMap.size() + " sample(s)");
_log.info("Calculating iRT correlations for {} sample(s)", replicateInfo.skylineIdSampleFileIdMap.size());

// Get the iRT scale to which we are comparing each sample
SimpleFilter iRTFilter = new SimpleFilter(FieldKey.fromParts("iRTScaleId"), run.getiRTscaleId());
Expand Down Expand Up @@ -600,7 +597,7 @@ private void calculateSampleFileIRTStats(TargetedMSRun run, ReplicateInfo replic
updatedCount++;
}
}
_log.info("Finished calculating iRT correlations for all samples. " + updatedCount + " had a regression line calculated.");
_log.info("Finished calculating iRT correlations for all samples. {} had a regression line calculated.", updatedCount);

}

Expand Down Expand Up @@ -691,9 +688,9 @@ private void deleteOldSampleFiles(ReplicateInfo replicateInfo)
return;
}

_log.info(String.format("Updating previously imported data for %d old sample files.", total));
_log.info("Updating previously imported data for {} old sample files.", total);
_log.debug("Found data for the following old sample files in the QC folder:");
replicateInfo.oldSamplesToDelete.keySet().forEach(key -> _log.debug(String.format(" %s", key)));
replicateInfo.oldSamplesToDelete.keySet().forEach(key -> _log.debug(" {}", key));

List<Long> existingSamples = new LongArrayList(total);
replicateInfo.oldSamplesToDelete.forEach((key, value) -> value.forEach(existingSample -> existingSamples.add(existingSample.getId())));
Expand All @@ -709,7 +706,7 @@ private void deleteOldSampleFiles(ReplicateInfo replicateInfo)
}
catch (URISyntaxException e)
{
_log.error("Unable to delete file " + srcFile + ". May be an invalid path. This file is no longer needed on the server.");
_log.error("Unable to delete file {}. May be an invalid path. This file is no longer needed on the server.", srcFile);
}
}
}
Expand Down Expand Up @@ -819,7 +816,7 @@ private void insertDigestSettings(PeptideSettings pepSettings)
}
else
{
enzyme = existingEnzymes.get(0);
enzyme = existingEnzymes.getFirst();
}

PeptideSettings.EnzymeDigestionSettings digestSettings = pepSettings.getEnzymeDigestionSettings();
Expand Down Expand Up @@ -988,9 +985,9 @@ private void handleReplicateExclusions(Replicate replicate, ReplicateAnnotation
// If there is an ignore_in_QC annotation and we already have existing exclusions, don't insert but compare and
// give a warning if there is a mismatch.
if (!shouldExcludeFromAnnot)
_log.warn("Replicate " + replicate.getName() + " has an ignore_in_QC=false annotation but there are existing exclusions that were added within Panorama or from a previous import.");
_log.warn("Replicate {} has an ignore_in_QC=false annotation but there are existing exclusions that were added within Panorama or from a previous import.", replicate.getName());
else if (!hasExistingExcludeAllMetrics)
_log.warn("Replicate " + replicate.getName() + " has an ignore_in_QC=true annotation but there are existing metric specific exclusions that were added within Panorama.");
_log.warn("Replicate {} has an ignore_in_QC=true annotation but there are existing metric specific exclusions that were added within Panorama.", replicate.getName());
}
}
}
Expand Down Expand Up @@ -1074,7 +1071,7 @@ else if (SkylineFileUtils.EXT_SKY_LOG.equalsIgnoreCase(ext))
newScale = true;
else
{
iRTScaleId = scaleIds.get(0);
iRTScaleId = scaleIds.getFirst();
SimpleFilter iRTFilter = new SimpleFilter(FieldKey.fromParts("iRTScaleId"), iRTScaleId);
List<IrtPeptide> existingScale = new TableSelector(TargetedMSManager.getTableInfoiRTPeptide(), iRTFilter, null).getArrayList(IrtPeptide.class);

Expand Down Expand Up @@ -1123,7 +1120,7 @@ private ArrayList<IrtPeptide> normalizeIrtImportAndReweighValues(List<IrtPeptide
IRegressionFunction regressionLine = IrtRegressionCalculator.calcRegressionLine(new RetentionTimeProviderImpl(importScale), new ArrayList<>(existingStandards.values()), new ArrayList<>(existingLibrary.values()), _log);

if (regressionLine == null)
throw new PipelineJobException(makeIrtStandardsErrorMsg(existingScale.get(0).getiRTScaleId(), new ArrayList<>(existingStandards.values()), importScale));
throw new PipelineJobException(makeIrtStandardsErrorMsg(existingScale.getFirst().getiRTScaleId(), new ArrayList<>(existingStandards.values()), importScale));

applyIrtRegressionLine(regressionLine, importScale);

Expand Down Expand Up @@ -1284,7 +1281,7 @@ else if(!pepGroup.isDecoy())
}

// CONSIDER: If there is already an identical entry in the PeptideGroup table re-use it.
_log.info("Inserting " + pepGroup.getLabel());
_log.info("Inserting {}", pepGroup.getLabel());
pepGroup = Table.insert(_user, TargetedMSManager.getTableInfoPeptideGroup(), pepGroup);

for (Protein protein : pepGroup.getProteins())
Expand Down Expand Up @@ -1332,7 +1329,7 @@ else if(!pepGroup.isDecoy())
peptideCount++;
if (peptideCount % 50 == 0)
{
_log.debug(String.format("Inserted %d peptides", peptideCount));
_log.debug("Inserted {} peptides", peptideCount);
}
}
case MOLECULE -> {
Expand All @@ -1346,7 +1343,7 @@ else if(!pepGroup.isDecoy())
moleculeCount++;
if (moleculeCount % 50 == 0)
{
_log.debug(String.format("Inserted %d molecules", moleculeCount));
_log.debug("Inserted {} molecules", moleculeCount);
}
}
}
Expand All @@ -1356,11 +1353,11 @@ else if(!pepGroup.isDecoy())
}
if(peptideCount > 0)
{
_log.debug(String.format("Total peptides inserted: %d", peptideCount));
_log.debug("Total peptides inserted: {}", peptideCount);
}
if(moleculeCount > 0)
{
_log.debug(String.format("Total molecules inserted: %d", moleculeCount));
_log.debug("Total molecules inserted: {}", moleculeCount);
}
}

Expand Down Expand Up @@ -1726,7 +1723,7 @@ private void insertLibInfo(Precursor.LibraryInfo libraryInfo, Precursor precurso
if (_missingLibraries.add(libraryInfo.getLibraryName()))
{
// Only log the first time
_log.warn("'" + libraryInfo.getLibraryName() + "' library was not found in settings.");
_log.warn("'{}' library was not found in settings.", libraryInfo.getLibraryName());
}
}
else
Expand Down Expand Up @@ -2304,7 +2301,7 @@ private void insertSampleFiles(ReplicateInfo replicateInfo, Map<Instrument, Long

if (pathToSampleFile.containsKey(sampleFile.getFilePath()))
{
_log.warn("Duplicate entries found for file path " + sampleFile.getFilePath() + ", may not resolve sample file-scoped chromatograms correctly");
_log.warn("Duplicate entries found for file path {}, may not resolve sample file-scoped chromatograms correctly", sampleFile.getFilePath());
}
else
{
Expand Down Expand Up @@ -2362,7 +2359,7 @@ private Path copyFileToCloud(Path sourcePath, Path targetParentPath) throws IOEx
{
Path dest = targetParentPath.resolve(FileUtil.getFileName(sourcePath));
Files.copy(sourcePath, dest, StandardCopyOption.REPLACE_EXISTING);
_log.info("Copied " + FileUtil.getFileName(sourcePath) + " to cloud storage.");
_log.info("Copied {} to cloud storage.", FileUtil.getFileName(sourcePath));
return dest;
}

Expand Down Expand Up @@ -2616,7 +2613,7 @@ public RunInfo prepareRun()
TargetedMSRun run = getRun();
if (run == null)
{
_log.info("Starting import from " + _expData.getName());
_log.info("Starting import from {}", _expData.getName());
run = createRun();
}

Expand Down Expand Up @@ -2685,7 +2682,7 @@ int quantifyRun(TargetedMSRun run, PeptideSettings pepSettings, Collection<Group
}
for (GroupComparisonSettings groupComparison : groupComparisons)
{
_log.debug(String.format("Calculating fold change for group comparison %s, %d of %d", groupComparison.getName(), ++i, groupComparisons.size()));
_log.debug("Calculating fold change for group comparison {}, {} of {}", groupComparison.getName(), ++i, groupComparisons.size());
for (FoldChange foldChange : quantifier.calculateFoldChanges(groupComparison))
{
Table.insert(_user, TargetedMSManager.getTableInfoFoldChange(), foldChange);
Expand Down Expand Up @@ -2928,7 +2925,7 @@ private void doUpdate(int percDone)
{
_job.setStatus(PipelineJob.TaskStatus.running + ", " + percDone + "%"); // This will throw a CancelledException if the job was cancelled.
}
_log.info(percDone + "% Done");
_log.info("{}% Done", percDone);
}


Expand Down Expand Up @@ -3043,17 +3040,15 @@ private boolean documentIsWithinLimits(File file, Container container, Logger lo
// To prevent giant DIA documents from overwhelming the DB, we skip importing TransitionChromInfos if the document
// has more than 100,000 AND has more than 1,000 precursors. We use both because a document may have a lot of
// replicates, so the TransitionChromInfo count by itself isn't sufficient to do the desired screening
log.info("Reading Skyline file, " + file.getName() + ", to determine if the TransitionChromInfos in the document should be stored...");
log.info("Reading Skyline file, {}, to determine if the TransitionChromInfos in the document should be stored...", file.getName());
boolean documentWithinLimits = new TransitionChromInfoAndPrecursorTally(maxTransitionChromInfos, maxPrecursors).isWithinLimits(file, log);
if (documentWithinLimits)
{
log.info("TransitionChromInfo counts or precursor counts are within the allowed limits. TransitionChromInfos will be stored");
}
else
{
log.info("TransitionChromInfos in the document exceed the limit of " + maxTransitionChromInfos +
", and there are more than " + maxPrecursors + " precursors." +
" TransitionChromInfos will not be stored.");
log.info("TransitionChromInfos in the document exceed the limit of {}, and there are more than {} precursors. TransitionChromInfos will not be stored.", maxTransitionChromInfos, maxPrecursors);
}
return documentWithinLimits;
}
Expand Down
6 changes: 3 additions & 3 deletions src/org/labkey/targetedms/SkylineFileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static Path getSkylineFile(@Nullable String runLSID, @NotNull Container c
TargetedMSRun run = TargetedMSManager.getRunByLsid(runLSID, container);
if (run == null)
{
LOG.warn("Run with experimentRunLSID " + runLSID + " does not exist in container " + container.getPath());
LOG.warn("Run with experimentRunLSID {} does not exist in container {}", runLSID, container.getPath());
return null;
}

Expand All @@ -79,11 +79,11 @@ public static Path getSkylineFile(@Nullable String runLSID, @NotNull Container c
}
else
{
LOG.warn("Skyline file does not exist: " + (skyDocfile != null ? FileUtil.getFileName(skyDocfile) : null) + ", referenced from " + container.getPath());
LOG.warn("Skyline file does not exist: {}, referenced from {}", skyDocfile != null ? FileUtil.getFileName(skyDocfile) : null, container.getPath());
return null;
}
}
LOG.warn("No input data found for targetedms run " + run.getId() + " in container " + container.getPath());
LOG.warn("No input data found for targetedms run {} in container {}", run.getId(), container.getPath());
return null;
}
}
Loading
Loading