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 @@ -62,7 +62,7 @@ public static class VariantProcessingTest extends SequenceIntegrationTests.Abstr
private static final String PROJECT_NAME = "VariantProcessingTestProject";

@BeforeClass
public static void initialSetUp() throws Exception
public static void initialSetUp()
{
doInitialSetUp(PROJECT_NAME);
}
Expand Down Expand Up @@ -90,12 +90,12 @@ public void testVariantProcessing() throws Exception

//create VCF, import as outputfile
String basename = "TestFile_" + FileUtil.getTimestamp();
File vcf = new File(_pipelineRoot, basename + ".vcf.gz");
File vcf = FileUtil.appendName(getPipelineRoot(_project), basename + ".vcf.gz");
Integer outputFileId = createTestVcf(genomeId, vcf);

//make job params
String jobName = "TestVariantProcessing";
JSONObject config = substituteParams(new File(_sampleData, VARIANT_JOB), jobName);
JSONObject config = substituteParams(FileUtil.appendName(_sampleData, VARIANT_JOB), jobName);
Set<Integer> outputFileIds = Collections.singleton(outputFileId);

TableInfo ti = QueryService.get().getUserSchema(TestContext.get().getUser(), _project, SequenceAnalysisSchema.SCHEMA_NAME).getTable(SequenceAnalysisSchema.TABLE_OUTPUTFILES, null);
Expand All @@ -110,13 +110,13 @@ public void testVariantProcessing() throws Exception
SequenceOutputHandlerJob job = (SequenceOutputHandlerJob)j;

Set<File> extraFiles = new HashSet<>();
extraFiles.add(new File(job.getAnalysisDirectory(), jobName + "." + outputFileId + ".log"));
extraFiles.add(new File(job.getAnalysisDirectory(), "sequenceOutput.json"));
extraFiles.add(new File(job.getAnalysisDirectory(), "sequenceSupport.json.gz"));
extraFiles.add(FileUtil.appendName(job.getAnalysisDirectory(), jobName + "." + outputFileId + ".log"));
extraFiles.add(FileUtil.appendName(job.getAnalysisDirectory(), "sequenceOutput.json"));
extraFiles.add(FileUtil.appendName(job.getAnalysisDirectory(), "sequenceSupport.json.gz"));
extraFiles.add(ProcessVariantsHandler.getPedigreeFile(job.getAnalysisDirectory(), "laboratory.subjects"));
extraFiles.add(new File(job.getAnalysisDirectory(), basename + ".gfiltered.selectVariants.annotated.filtered.vcf.gz"));
extraFiles.add(new File(job.getAnalysisDirectory(), basename + ".gfiltered.selectVariants.annotated.filtered.vcf.gz.tbi"));
extraFiles.add(new File(job.getAnalysisDirectory(), job.getBaseName() + ".pipe.xar.xml"));
extraFiles.add(FileUtil.appendName(job.getAnalysisDirectory(), basename + ".gfiltered.selectVariants.annotated.filtered.vcf.gz"));
extraFiles.add(FileUtil.appendName(job.getAnalysisDirectory(), basename + ".gfiltered.selectVariants.annotated.filtered.vcf.gz.tbi"));
extraFiles.add(FileUtil.appendName(job.getAnalysisDirectory(), job.getBaseName() + ".pipe.xar.xml"));

verifyFileOutputs(job.getAnalysisDirectory(), extraFiles);

Expand All @@ -128,7 +128,7 @@ public void testVariantProcessing() throws Exception
}
}

protected Set<PipelineJob> createOutputHandlerJob(String jobName, JSONObject config, Class handlerClass, Set<Integer> outputFileIDs) throws Exception
protected Set<PipelineJob> createOutputHandlerJob(String jobName, JSONObject config, Class<?> handlerClass, Set<Integer> outputFileIDs) throws Exception
{
Map<String, Object> headers = new HashMap<>();
headers.put("Content-Type", "application/json");
Expand Down Expand Up @@ -199,7 +199,7 @@ private int createTestVcf(int genomeId, File vcf)
Integer dataId = new TableSelector(SequenceAnalysisSchema.getTable(SequenceAnalysisSchema.TABLE_REF_LIBRARIES), PageFlowUtil.set("fasta_file"), new SimpleFilter(FieldKey.fromString("rowid"), genomeId), null).getObject(Integer.class);
ExpData data = ExperimentService.get().getExpData(dataId);

File dictFile = new File(data.getFile().getParent(), FileUtil.getBaseName(data.getFile().getName()) + ".dict");
File dictFile = FileUtil.appendName(data.getFile().getParentFile(), FileUtil.getBaseName(data.getFile().getName()) + ".dict");
if (dictFile.exists())
{
SAMSequenceDictionary dict = SAMSequenceDictionaryExtractor.extractDictionary(dictFile.toPath());
Expand All @@ -221,7 +221,7 @@ private int createTestVcf(int genomeId, File vcf)
writer.add(vcb.make());
}

ExpData d = createExpData(vcf);
ExpData d = createExpData(vcf, _project);
Map<String, Object> params = new CaseInsensitiveHashMap<>();
params.put("name", "TestVcf");
params.put("description", "Description");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1924,7 +1924,7 @@ else if (o.has("relPath") || o.has("fileName"))

if (f == null || !f.exists())
{
throw new PipelineValidationException("Unknown file: " + o.getString("relPath") + " / " + o.getString("fileName"));
throw new PipelineValidationException("Unknown file: " + o.optString("relPath") + " / " + o.optString("fileName"));
}

ret.add(f.toNioPathForRead().toFile());
Expand Down
Loading