Skip to content
Merged
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 @@ -291,7 +291,7 @@ else if (form.getFile() == null || form.getFile().length == 0)
}
else
{
files.addAll(form.getValidatedFiles(getContainer()));
files.addAll(form.getValidatedFiles(getContainer()).stream().map(FileLike::toNioPathForRead).map(Path::toFile).toList());
}

Set<File> usedPaths = new HashSet<>();
Expand Down Expand Up @@ -390,7 +390,7 @@ protected ModelAndView uploadRuns(ImportRunsForm form, BindException errors) thr
if (form.isCurrent())
files = Collections.singletonList(pr.resolvePath(form.getPath()));
else
files = form.getValidatedFiles(form.getContainer());
files = form.getValidatedFiles(form.getContainer()).stream().map(FileLike::toNioPathForRead).map(Path::toFile).toList();

// validate target study
Container targetStudy = getTargetStudy(form.getTargetStudy(), errors);
Expand Down Expand Up @@ -544,7 +544,7 @@ public class ImportAnalysisFromPipelineAction extends SimpleViewAction<PipelineP
@Override
public ModelAndView getView(PipelinePathForm form, BindException errors)
{
Path f = form.getValidatedSinglePath(getContainer());
FileLike f = form.getValidatedSingleFile(getContainer());
PipeRoot root = Objects.requireNonNull(PipelineService.get().findPipelineRoot(getContainer()));
String workspacePath = "/" + root.relativePath(f).replace('\\', '/');

Expand Down
9 changes: 5 additions & 4 deletions flow/src/org/labkey/flow/controllers/run/RunController.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
import org.labkey.flow.query.FlowTableType;
import org.labkey.flow.view.ExportAnalysisForm;
import org.labkey.flow.view.ExportAnalysisManifest;
import org.labkey.vfs.FileLike;
import org.springframework.validation.BindException;
import org.springframework.validation.Errors;
import org.springframework.web.servlet.ModelAndView;
Expand Down Expand Up @@ -604,13 +605,13 @@ else if (_wells != null && !_wells.isEmpty())
return _success = true;
}

private void writeManifest(String manifestJson, String dir) throws IOException
private void writeManifest(String manifestJson, File dir) throws IOException
{
if (manifestJson == null || manifestJson.isEmpty())
return;


File file = new File(dir,MANIFEST_FILENAME);
File file = FileUtil.appendName(dir, MANIFEST_FILENAME);
FileOutputStream statisticsFile = new FileOutputStream(file);

try (PrintWriter pw = PrintWriters.getPrintWriter(statisticsFile))
Expand Down Expand Up @@ -694,7 +695,7 @@ URLHelper onExportComplete(ExportAnalysisForm form, VirtualFile vf, SampleIdMap<
ViewBackgroundInfo vbi = new ViewBackgroundInfo(getContainer(), getUser(), null);

ExportAnalysisManifest analysisManifest = buildExportAnalysisManifest(form, files);
writeManifest(analysisManifest.toJSON(), vf.getLocation());
writeManifest(analysisManifest.toJSON(), location);

PipelineJob job = new ExportToScriptJob(_guid, _exportToScriptPath, _exportToScriptCommandLine, _exportToScriptFormat, form.getLabel(), location, _exportToScriptTimeout, _exportToScriptDeleteOnComplete, vbi, root);
String jobGuid = null;
Expand Down Expand Up @@ -780,7 +781,7 @@ public ExportToScriptJob(String guid, String exportToScriptPath, String exportTo
_deleteOnComplete = deleteOnComplete;

// setup the log file
File logFile = FileUtil.appendName(root.getLogDirectory(), FileUtil.makeFileNameWithTimestamp("export-to-script", "log"));
FileLike logFile = root.getLogDirectoryFileLike(true).resolveChild(FileUtil.makeFileNameWithTimestamp("export-to-script", "log"));
setLogFile(logFile);
}

Expand Down
35 changes: 1 addition & 34 deletions flow/src/org/labkey/flow/data/FlowAssayProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@
import org.labkey.api.exp.OntologyManager;
import org.labkey.api.exp.XarContext;
import org.labkey.api.exp.api.ExpData;
import org.labkey.api.exp.api.ExpExperiment;
import org.labkey.api.exp.api.ExpProtocol;
import org.labkey.api.exp.api.ExpRun;
import org.labkey.api.exp.api.IAssayDomainType;
import org.labkey.api.exp.property.Domain;
import org.labkey.api.exp.property.DomainProperty;
import org.labkey.api.gwt.client.DefaultValueType;
Expand Down Expand Up @@ -68,7 +66,6 @@
import org.labkey.flow.script.FlowPipelineProvider;
import org.labkey.flow.view.FlowQueryView;
import org.labkey.flow.webparts.AnalysesWebPart;
import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

Expand Down Expand Up @@ -214,7 +211,7 @@ public Domain getResultsDomain(ExpProtocol protocol, boolean forUpdate)
}

@Override
public AssayRunCreator getRunCreator()
public AssayRunCreator<?> getRunCreator()
{
throw new UnsupportedOperationException();
}
Expand Down Expand Up @@ -399,18 +396,6 @@ public DefaultValueType getDefaultValueDefault(Domain domain)
throw new UnsupportedOperationException();
}

@Override
public boolean hasCustomView(IAssayDomainType domainType, boolean details)
{
return false;
}

@Override
public ModelAndView createBeginView(ViewContext context, ExpProtocol protocol)
{
return null;
}

@Override
public ModelAndView createBatchesView(ViewContext context, ExpProtocol protocol)
{
Expand All @@ -423,12 +408,6 @@ public ModelAndView createBatchesView(ViewContext context, ExpProtocol protocol)
return view;
}

@Override
public ModelAndView createBatchDetailsView(ViewContext context, ExpProtocol protocol, ExpExperiment batch)
{
return null;
}

@Override
public ModelAndView createRunsView(ViewContext context, ExpProtocol protocol)
{
Expand All @@ -437,18 +416,6 @@ public ModelAndView createRunsView(ViewContext context, ExpProtocol protocol)
return new FlowQueryView(form);
}

@Override
public ModelAndView createRunDetailsView(ViewContext context, ExpProtocol protocol, ExpRun run)
{
return null;
}

@Override
public ModelAndView createResultsView(ViewContext context, ExpProtocol protocol, BindException errors)
{
return null;
}

@Override
public ModelAndView createResultDetailsView(ViewContext context, ExpProtocol protocol, ExpData data, Object dataRowId)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import org.labkey.api.pipeline.PipelineService;
import org.labkey.api.query.FieldKey;
import org.labkey.api.security.User;
import org.labkey.api.util.FileUtil;
import org.labkey.api.util.Pair;
import org.labkey.api.view.ActionURL;
import org.labkey.api.view.ViewBackgroundInfo;
Expand Down Expand Up @@ -383,7 +384,7 @@ protected FlowRun saveAnalysis(User user, Container container, FlowExperiment ex
MultiValuedMap<String, String> sampleIdToNameMap) throws Exception
{
// Fake file URI set on the FCSFile/FCSAnalsyis ExpData to ensure it's recognized by the FlowDataHandler.
URI dataFileURI = new File(externalAnalysisFile.getParent(), "attributes.flowdata.xml").toURI();
URI dataFileURI = FileUtil.appendName(externalAnalysisFile.getParentFile(), "attributes.flowdata.xml").toURI();

// Prepare comp matrices for saving
Map<CompensationMatrix, AttributeSet> compMatrixMap = new HashMap<>();
Expand Down
2 changes: 1 addition & 1 deletion flow/src/org/labkey/flow/script/FlowJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ protected void runPostAnalysisJobs()
info("Running post-analysis jobs...");
for (FlowReportJob job : jobs)
{
job.setLogFile(getLogFile());
job.setLogFile(getLogFileLike());
job.setLogLevel(getLogLevel());
job.setSubmitted();
job.run();
Expand Down
6 changes: 4 additions & 2 deletions flow/src/org/labkey/flow/script/ScriptXarSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import org.labkey.api.exp.XarSource;
import org.labkey.api.pipeline.PipelineJob;
import org.labkey.api.util.FileUtil;
import org.labkey.vfs.FileLike;
import org.labkey.vfs.FileSystemLike;

import java.io.File;
import java.io.FileWriter;
Expand Down Expand Up @@ -85,8 +87,8 @@ public ExperimentArchiveDocument getDocument()


@Override
public Path getLogFilePath()
public FileLike getLogFilePath()
{
return _logFile.toPath();
return FileSystemLike.wrapFile(_logFile);
}
}
7 changes: 3 additions & 4 deletions luminex/src/org/labkey/luminex/LuminexAssayProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import org.labkey.api.assay.AssayDataType;
import org.labkey.api.assay.AssayPipelineProvider;
import org.labkey.api.assay.AssayProtocolSchema;
import org.labkey.api.assay.AssayRunCreator;
import org.labkey.api.assay.AssayRunDatabaseContext;
import org.labkey.api.assay.AssayRunUploadContext;
import org.labkey.api.assay.AssayTableMetadata;
Expand Down Expand Up @@ -113,7 +112,7 @@ public LuminexProtocolSchema createProtocolSchema(User user, Container container
public void registerLsidHandler()
{
super.registerLsidHandler();
LsidManager.get().registerHandler(LUMINEX_DATA_ROW_LSID_PREFIX, new LsidManager.ExpObjectLsidHandler()
LsidManager.get().registerHandler(LUMINEX_DATA_ROW_LSID_PREFIX, new LsidManager.ExpObjectLsidHandler<>()
{
@Override
public ExpData getObject(Lsid lsid)
Expand Down Expand Up @@ -454,7 +453,7 @@ public void deleteProtocol(ExpProtocol protocol, User user, @Nullable final Stri
}

@Override
public AssayRunDatabaseContext createRunDatabaseContext(ExpRun run, User user, HttpServletRequest request)
public AssayRunDatabaseContext<?> createRunDatabaseContext(ExpRun run, User user, HttpServletRequest request)
{
return new LuminexRunDatabaseContext(run, user, request);
}
Expand All @@ -466,7 +465,7 @@ public AssayRunAsyncContext<?> createRunAsyncContext(AssayRunUploadContext<?> co
}

@Override
public AssayRunCreator getRunCreator()
public LuminexRunCreator getRunCreator()
{
return new LuminexRunCreator(this);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public LuminexExclusionPipelineJob(ViewBackgroundInfo info, PipeRoot root, Lumin
{
super(LuminexAssayProvider.NAME, info, root);

setLogFile(root.getLogDirectoryFileLike(true).resolveChild(FileUtil.makeFileNameWithTimestamp("luminex_exclusion", "log")).toNioPathForWrite());
setLogFile(root.getLogDirectoryFileLike(true).resolveChild(FileUtil.makeFileNameWithTimestamp("luminex_exclusion", "log")));

_form = form;
_exclusionType = LuminexManager.ExclusionType.valueOf(form.getTableName());
Expand Down
13 changes: 6 additions & 7 deletions luminex/src/org/labkey/luminex/query/WellExclusionTable.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,18 @@ public WellExclusionTable(LuminexProtocolSchema schema, ContainerFilter cf, bool
{
super(LuminexProtocolSchema.getTableInfoWellExclusion(), schema, cf, filter);

getMutableColumn("DataId").setLabel("Data File");
getMutableColumn("DataId").setFk(new ExpSchema(schema.getUser(), schema.getContainer()).getDataIdForeignKey(cf));
getMutableColumnOrThrow("DataId").setLabel("Data File");
getMutableColumnOrThrow("DataId").setFk(new ExpSchema(schema.getUser(), schema.getContainer()).getDataIdForeignKey(cf));

getMutableColumn("Analytes").setFk(new MultiValuedForeignKey(new LookupForeignKey(cf, "WellExclusionId", null)
getMutableColumnOrThrow("Analytes").setFk(new MultiValuedForeignKey(new LookupForeignKey(cf, "WellExclusionId", null)
{
@Override
public TableInfo getLookupTableInfo()
{
return _userSchema.createWellExclusionAnalyteTable(getLookupContainerFilter());
}
}, "AnalyteId"));
getMutableColumn("Analytes").setUserEditable(false);
getMutableColumnOrThrow("Analytes").setUserEditable(false);

SQLFragment joinSQL = new SQLFragment(" FROM ");
joinSQL.append(LuminexProtocolSchema.getTableInfoDataRow(), "dr");
Expand Down Expand Up @@ -123,8 +123,7 @@ public Object getDisplayValue(RenderContext ctx)
if (null != result)
{
// get the list of unique wells (by splitting the concatenated string)
TreeSet<String> uniqueWells = new TreeSet<>();
uniqueWells.addAll(Arrays.asList(result.toString().split(MultiValuedRenderContext.VALUE_DELIMITER_REGEX)));
TreeSet<String> uniqueWells = new TreeSet<>(Arrays.asList(result.toString().split(MultiValuedRenderContext.VALUE_DELIMITER_REGEX)));

// put the unique wells back into a comma separated string
StringBuilder sb = new StringBuilder();
Expand Down Expand Up @@ -332,7 +331,7 @@ private void rerunTransformScripts(BatchValidationException errors) throws Query
for (ExpRun run : _runsToRefresh)
{
AssayProvider provider = AssayService.get().getProvider(run);
AssayRunDatabaseContext context = provider.createRunDatabaseContext(run, _userSchema.getUser(), null);
AssayRunDatabaseContext<?> context = provider.createRunDatabaseContext(run, _userSchema.getUser(), null);
provider.getRunCreator().saveExperimentRun(context, AssayService.get().findBatch(run), run, false, null);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.labkey.api.util.FileUtil;
import org.labkey.test.BaseWebDriverTest;
import org.labkey.test.Locator;
import org.labkey.test.TestFileUtils;
Expand Down Expand Up @@ -57,7 +58,7 @@ public final class LuminexPositivityTest extends LuminexTest
private Boolean _expectedNegativeControlValue = false;
private Boolean _newNegativeControlValue = false;
private static final String _negControlAnalyte = _analyteNames.get(1);
private static final File POSITIVITY_RTRANSFORM_SCRIPT_FILE = new File(TestFileUtils.getLabKeyRoot(), "server/modules/commonAssays/luminex/resources/transformscripts/description_parsing_example.pl");
private static final File POSITIVITY_RTRANSFORM_SCRIPT_FILE = FileUtil.appendPath(TestFileUtils.getLabKeyRoot(), org.labkey.api.util.Path.parse("server/modules/commonAssays/luminex/resources/transformscripts/description_parsing_example.pl"));
private static final String RUN_ID_BASE = "Positivity";

@BeforeClass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.apache.commons.lang3.StringUtils;
import org.junit.BeforeClass;
import org.labkey.api.query.QueryKey;
import org.labkey.api.util.FileUtil;
import org.labkey.remoteapi.CommandException;
import org.labkey.remoteapi.Connection;
import org.labkey.remoteapi.assay.GetProtocolCommand;
Expand Down Expand Up @@ -101,8 +102,8 @@ public abstract class LuminexTest extends BaseWebDriverTest
public static final File TEST_ASSAY_MULTIPLE_STANDARDS_3 = TestFileUtils.getSampleData("luminex/plate 3_IgA-Biot (Standard1).xls");
public static final File TEST_ASSAY_MULTIPLE_STANDARDS_3_XLSX = TestFileUtils.getSampleData("luminex/plate 3_IgA-Biot (Standard1).xls");

public static final File RTRANSFORM_SCRIPT_FILE_LABKEY = new File(TestFileUtils.getLabKeyRoot(), "server/modules/commonAssays/luminex/resources/transformscripts/labkey_luminex_transform.R");
public static final File RTRANSFORM_SCRIPT_FILE_LAB = new File(TestFileUtils.getLabKeyRoot(), "server/modules/commonAssays/luminex/resources/transformscripts/tomaras_luminex_transform.R");
public static final File RTRANSFORM_SCRIPT_FILE_LABKEY = FileUtil.appendPath(TestFileUtils.getLabKeyRoot(), org.labkey.api.util.Path.parse("server/modules/commonAssays/luminex/resources/transformscripts/labkey_luminex_transform.R"));
public static final File RTRANSFORM_SCRIPT_FILE_LAB = FileUtil.appendPath(TestFileUtils.getLabKeyRoot(), org.labkey.api.util.Path.parse("server/modules/commonAssays/luminex/resources/transformscripts/tomaras_luminex_transform.R"));

public static final String ASSAY_DATA_FILE_LOCATION_MULTIPLE_FIELD = "__primaryFile__";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.labkey.api.assay.AssayDataType;
import org.labkey.api.assay.AssayPipelineProvider;
import org.labkey.api.assay.AssayProtocolSchema;
import org.labkey.api.assay.AssayRunCreator;
import org.labkey.api.assay.AssayTableMetadata;
import org.labkey.api.assay.actions.AssayRunUploadForm;
import org.labkey.api.assay.matrix.ColumnMappingProperty;
Expand Down Expand Up @@ -93,7 +92,7 @@ public AssayTableMetadata getTableMetadata(@NotNull ExpProtocol protocol)
}

@Override
public AssayRunCreator getRunCreator()
public ExpressionMatrixRunCreator getRunCreator()
{
return new ExpressionMatrixRunCreator(this);
}
Expand Down
Loading