Commit 78bd61fa authored by M. Haseeb's avatar M. Haseeb

ENA-4067

- review followup.
parent 11ffd18e
......@@ -48,8 +48,6 @@ GenomeManifestReader extends ManifestReader<GenomeManifest> {
String AGP = "AGP";
String AUTHORS = "AUTHORS";
String ADDRESS = "ADDRESS";
String SUBMISSION_TOOL = "SUBMISSION_TOOL";
String SUBMISSION_TOOL_VERSION = "SUBMISSION_TOOL_VERSION";
}
......@@ -76,8 +74,6 @@ GenomeManifestReader extends ManifestReader<GenomeManifest> {
String AGP = "AGP file";
String AUTHORS = "For submission brokers only. Submitter's names as a comma-separated list";
String ADDRESS = "For submission brokers only. Submitter's address";
String SUBMISSION_TOOL = "Name of third-party or developed tool used to submit to ENA";
String SUBMISSION_TOOL_VERSION = "Version number of the third-party or developed tool used to submit to ENA";
}
......@@ -135,8 +131,8 @@ GenomeManifestReader extends ManifestReader<GenomeManifest> {
.meta().optional().name( Field.TPA ).desc( Description.TPA ).processor( CVFieldProcessor.CV_BOOLEAN ).and()
.meta().optional().name( Field.AUTHORS ).desc( Description.AUTHORS ).processor(new AuthorProcessor()).and()
.meta().optional().name( Field.ADDRESS ).desc( Description.ADDRESS ).and()
.meta().optional().name(ReadsManifestReader.Field.SUBMISSION_TOOL).desc(ReadsManifestReader.Description.SUBMISSION_TOOL).and()
.meta().optional().name(ReadsManifestReader.Field.SUBMISSION_TOOL_VERSION).desc(ReadsManifestReader.Description.SUBMISSION_TOOL_VERSION)
.meta().optional().name(Fields.SUBMISSION_TOOL).desc(Descriptions.SUBMISSION_TOOL).and()
.meta().optional().name(Fields.SUBMISSION_TOOL_VERSION).desc(Descriptions.SUBMISSION_TOOL_VERSION)
.build()
,
// File groups.
......@@ -249,8 +245,8 @@ GenomeManifestReader extends ManifestReader<GenomeManifest> {
manifest.setTpa( getAndValidateBoolean( getManifestReaderResult().getField( Field.TPA ) ) );
}
manifest.setSubmissionTool(getManifestReaderResult().getValue(ReadsManifestReader.Field.SUBMISSION_TOOL));
manifest.setSubmissionToolVersion(getManifestReaderResult().getValue(ReadsManifestReader.Field.SUBMISSION_TOOL_VERSION));
manifest.setSubmissionTool(getManifestReaderResult().getValue(Fields.SUBMISSION_TOOL));
manifest.setSubmissionToolVersion(getManifestReaderResult().getValue(Fields.SUBMISSION_TOOL_VERSION));
SubmissionFiles<GenomeManifest.FileType> submissionFiles = manifest.files();
......
......@@ -44,8 +44,6 @@ ReadsManifestReader extends ManifestReader<ReadsManifest> {
String FASTQ = "FASTQ";
String BAM = "BAM";
String CRAM = "CRAM";
String SUBMISSION_TOOL = "SUBMISSION_TOOL";
String SUBMISSION_TOOL_VERSION = "SUBMISSION_TOOL_VERSION";
}
public interface Description {
......@@ -66,8 +64,6 @@ ReadsManifestReader extends ManifestReader<ReadsManifest> {
String FASTQ = "Fastq file";
String BAM = "BAM file";
String CRAM = "CRAM file";
String SUBMISSION_TOOL = "Name of third-party or developed tool used to submit to ENA";
String SUBMISSION_TOOL_VERSION = "Version number of the third-party or developed tool used to submit to ENA";
}
private final static String INSTRUMENT_UNSPECIFIED = "unspecified";
......@@ -113,8 +109,8 @@ ReadsManifestReader extends ManifestReader<ReadsManifest> {
.file().optional().name(Field.CRAM).desc(Description.CRAM).processor(getCramProcessors()).and()
.meta().optional().hidden().name(Field.QUALITY_SCORE).desc(Description.QUALITY_SCORE).processor(new CVFieldProcessor(CV_QUALITY_SCORE)).and()
.meta().optional().hidden().name(Field.__HORIZON).desc(Description.__HORIZON).and()
.meta().optional().name(Field.SUBMISSION_TOOL).desc(Description.SUBMISSION_TOOL).and()
.meta().optional().name(Field.SUBMISSION_TOOL_VERSION).desc(Description.SUBMISSION_TOOL_VERSION)
.meta().optional().name(Fields.SUBMISSION_TOOL).desc(Descriptions.SUBMISSION_TOOL).and()
.meta().optional().name(Fields.SUBMISSION_TOOL_VERSION).desc(Descriptions.SUBMISSION_TOOL_VERSION)
.build()
,
// File groups.
......@@ -200,8 +196,8 @@ ReadsManifestReader extends ManifestReader<ReadsManifest> {
if (getManifestReaderResult().getCount(Field.__HORIZON) > 0)
manifest.setPairingHorizon(getAndValidatePositiveInteger(getManifestReaderResult().getField(Field.__HORIZON)));
manifest.setSubmissionTool(getManifestReaderResult().getValue(Field.SUBMISSION_TOOL));
manifest.setSubmissionToolVersion(getManifestReaderResult().getValue(Field.SUBMISSION_TOOL_VERSION));
manifest.setSubmissionTool(getManifestReaderResult().getValue(Fields.SUBMISSION_TOOL));
manifest.setSubmissionToolVersion(getManifestReaderResult().getValue(Fields.SUBMISSION_TOOL_VERSION));
processInstrumentAndPlatform();
......
......@@ -35,8 +35,6 @@ SequenceManifestReader extends ManifestReader<SequenceManifest>
String FLATFILE = "FLATFILE";
String AUTHORS = "AUTHORS";
String ADDRESS = "ADDRESS";
String SUBMISSION_TOOL = "SUBMISSION_TOOL";
String SUBMISSION_TOOL_VERSION = "SUBMISSION_TOOL_VERSION";
}
......@@ -52,8 +50,6 @@ SequenceManifestReader extends ManifestReader<SequenceManifest>
String FLATFILE = "Flat file";
String AUTHORS = "For submission brokers only. Submitter's names as a comma-separated list";
String ADDRESS = "For submission brokers only. Submitter's address";
String SUBMISSION_TOOL = "Name of third-party or developed tool used to submit to ENA";
String SUBMISSION_TOOL_VERSION = "Version number of the third-party or developed tool used to submit to ENA";
}
private final SequenceManifest manifest = new SequenceManifest();
......@@ -73,8 +69,8 @@ SequenceManifestReader extends ManifestReader<SequenceManifest>
.file().optional().name( Field.FLATFILE ).desc( Description.FLATFILE ).processor( getFlatfileProcessors() ).and()
.meta().optional().name( Field.AUTHORS ).desc( Description.AUTHORS ).processor(new AuthorProcessor()).and()
.meta().optional().name( Field.ADDRESS ).desc( Description.ADDRESS ).and()
.meta().optional().name(ReadsManifestReader.Field.SUBMISSION_TOOL).desc(ReadsManifestReader.Description.SUBMISSION_TOOL).and()
.meta().optional().name(ReadsManifestReader.Field.SUBMISSION_TOOL_VERSION).desc(ReadsManifestReader.Description.SUBMISSION_TOOL_VERSION)
.meta().optional().name(Fields.SUBMISSION_TOOL).desc(Descriptions.SUBMISSION_TOOL).and()
.meta().optional().name(Fields.SUBMISSION_TOOL_VERSION).desc(Descriptions.SUBMISSION_TOOL_VERSION)
.build()
,
// File groups.
......@@ -126,8 +122,8 @@ SequenceManifestReader extends ManifestReader<SequenceManifest>
manifest.setName(getManifestReaderResult().getValue( Field.NAME ));
manifest.setDescription(getManifestReaderResult().getValue( Field.DESCRIPTION ));
manifest.setSubmissionTool(getManifestReaderResult().getValue(ReadsManifestReader.Field.SUBMISSION_TOOL));
manifest.setSubmissionToolVersion(getManifestReaderResult().getValue(ReadsManifestReader.Field.SUBMISSION_TOOL_VERSION));
manifest.setSubmissionTool(getManifestReaderResult().getValue(Fields.SUBMISSION_TOOL));
manifest.setSubmissionToolVersion(getManifestReaderResult().getValue(Fields.SUBMISSION_TOOL_VERSION));
SubmissionFiles<SequenceManifest.FileType> submissionFiles = manifest.files();
......
......@@ -41,8 +41,6 @@ TranscriptomeManifestReader extends ManifestReader<TranscriptomeManifest>
String AUTHORS = "AUTHORS";
String ADDRESS = "ADDRESS";
String ASSEMBLY_TYPE = "ASSEMBLY_TYPE";
String SUBMISSION_TOOL = "SUBMISSION_TOOL";
String SUBMISSION_TOOL_VERSION = "SUBMISSION_TOOL_VERSION";
}
......@@ -64,8 +62,6 @@ TranscriptomeManifestReader extends ManifestReader<TranscriptomeManifest>
String AUTHORS = "For submission brokers only. Submitter's names as a comma-separated list";
String ADDRESS = "For submission brokers only. Submitter's address";
String ASSEMBLY_TYPE = "Assembly type";
String SUBMISSION_TOOL = "Name of third-party or developed tool used to submit to ENA";
String SUBMISSION_TOOL_VERSION = "Version number of the third-party or developed tool used to submit to ENA";
}
private static final ManifestCVList CV_ASSEMBLY_TYPE = new ManifestCVList(
......@@ -96,8 +92,8 @@ TranscriptomeManifestReader extends ManifestReader<TranscriptomeManifest>
.meta().optional().name( Field.AUTHORS ).desc( Description.AUTHORS ).processor(new AuthorProcessor()).and()
.meta().optional().name( Field.ADDRESS ).desc( Description.ADDRESS ).and()
.meta().required().name( Field.ASSEMBLY_TYPE ).desc( Description.ASSEMBLY_TYPE ).processor( new CVFieldProcessor( CV_ASSEMBLY_TYPE ) ).and()
.meta().optional().name(ReadsManifestReader.Field.SUBMISSION_TOOL).desc(ReadsManifestReader.Description.SUBMISSION_TOOL).and()
.meta().optional().name(ReadsManifestReader.Field.SUBMISSION_TOOL_VERSION).desc(ReadsManifestReader.Description.SUBMISSION_TOOL_VERSION)
.meta().optional().name(Fields.SUBMISSION_TOOL).desc(Descriptions.SUBMISSION_TOOL).and()
.meta().optional().name(Fields.SUBMISSION_TOOL_VERSION).desc(Descriptions.SUBMISSION_TOOL_VERSION)
.build()
,
// File groups.
......@@ -168,8 +164,8 @@ TranscriptomeManifestReader extends ManifestReader<TranscriptomeManifest>
manifest.setTpa( getAndValidateBoolean( getManifestReaderResult().getField(Field.TPA ) ) );
}
manifest.setSubmissionTool(getManifestReaderResult().getValue(ReadsManifestReader.Field.SUBMISSION_TOOL));
manifest.setSubmissionToolVersion(getManifestReaderResult().getValue(ReadsManifestReader.Field.SUBMISSION_TOOL_VERSION));
manifest.setSubmissionTool(getManifestReaderResult().getValue(Fields.SUBMISSION_TOOL));
manifest.setSubmissionToolVersion(getManifestReaderResult().getValue(Fields.SUBMISSION_TOOL_VERSION));
SubmissionFiles<TranscriptomeManifest.FileType> submissionFiles = manifest.files();
......
......@@ -41,10 +41,14 @@ ManifestReader<M extends Manifest> {
public interface Fields {
String INFO = "INFO";
String SUBMISSION_TOOL = "SUBMISSION_TOOL";
String SUBMISSION_TOOL_VERSION = "SUBMISSION_TOOL_VERSION";
}
public interface Descriptions {
String INFO = "Info file";
String SUBMISSION_TOOL = "Name of third-party or developed tool used to submit to ENA";
String SUBMISSION_TOOL_VERSION = "Version number of the third-party or developed tool used to submit to ENA";
}
private final List<ManifestFieldDefinition> infoFields = new ManifestFieldDefinition.Builder()
......
/*
* Copyright 2018-2019 EMBL - European Bioinformatics Institute
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package uk.ac.ebi.ena.webin.cli.context.genome;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import uk.ac.ebi.ena.webin.cli.ManifestBuilder;
import uk.ac.ebi.ena.webin.cli.ReportTester;
import uk.ac.ebi.ena.webin.cli.TempFileBuilder;
import uk.ac.ebi.ena.webin.cli.WebinCliException;
import uk.ac.ebi.ena.webin.cli.WebinCliExecutor;
import uk.ac.ebi.ena.webin.cli.WebinCliExecutorBuilder;
import uk.ac.ebi.ena.webin.cli.WebinCliMessage;
import uk.ac.ebi.ena.webin.cli.WebinCliParameters;
import uk.ac.ebi.ena.webin.cli.WebinCliTestUtils;
import uk.ac.ebi.ena.webin.cli.context.reads.ReadsManifestReader;
import uk.ac.ebi.ena.webin.cli.manifest.ManifestReader;
import uk.ac.ebi.ena.webin.cli.manifest.processor.MetadataProcessorFactory;
import uk.ac.ebi.ena.webin.cli.validator.manifest.GenomeManifest;
import uk.ac.ebi.ena.webin.cli.validator.manifest.ReadsManifest;
import uk.ac.ebi.ena.webin.cli.validator.response.ReadsValidationResponse;
import java.io.File;
import java.nio.file.Paths;
import java.util.Locale;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static uk.ac.ebi.ena.webin.cli.WebinCliTestUtils.getResourceDir;
import static uk.ac.ebi.ena.webin.cli.context.reads.ReadsManifestReader.Field;
public class
GenomeManifestReaderTest {
private static GenomeManifestReader createManifestReader() {
WebinCliParameters parameters = WebinCliTestUtils.getTestWebinCliParameters();
return new GenomeManifestReader(ManifestReader.DEFAULT_PARAMETERS, new MetadataProcessorFactory(parameters));
}
@Before
public void
before() {
Locale.setDefault(Locale.UK);
}
@Test
public void
testValidManifest() {
GenomeManifestReader manifestReader = createManifestReader();
GenomeManifest manifest = manifestReader.getManifest();
Assert.assertNull(manifest.getStudy());
Assert.assertNull(manifest.getSample());
Assert.assertNull(manifest.getPlatform());
Assert.assertNull(manifest.getName());
assertThat(manifest.files().files()).size().isZero();
Assert.assertNull(manifest.getDescription());
Assert.assertNull(manifest.getSubmissionTool());
Assert.assertNull(manifest.getSubmissionToolVersion());
manifestReader.readManifest(Paths.get("."),
new ManifestBuilder()
.field(Field.PLATFORM, " illumina")
.field(Field.NAME, " SOME-FANCY-NAME")
.field(Field.DESCRIPTION, " description")
.file("FASTA", TempFileBuilder.empty("fasta"))
.field(ManifestReader.Fields.SUBMISSION_TOOL, "ST-001")
.field(ManifestReader.Fields.SUBMISSION_TOOL_VERSION, "STV-001")
.build());
Assert.assertEquals("illumina", manifest.getPlatform());
Assert.assertEquals("SOME-FANCY-NAME", manifest.getName());
assertThat(manifest.files().files()).size().isOne();
Assert.assertEquals("description", manifest.getDescription());
Assert.assertEquals("ST-001", manifest.getSubmissionTool());
Assert.assertEquals("STV-001", manifest.getSubmissionToolVersion());
}
}
......@@ -46,8 +46,6 @@ public class GenomeXmlTest {
manifest.setCoverage("1");
manifest.setProgram("test_program");
manifest.setPlatform("test_platform");
manifest.setSubmissionTool("ST-001");
manifest.setSubmissionToolVersion("STV-001");
return manifest;
}
......@@ -68,6 +66,9 @@ public class GenomeXmlTest {
@Test
public void testRunAndAnalysisRef() {
GenomeManifest manifest = getDefaultManifest();
manifest.setSubmissionTool("ST-001");
manifest.setSubmissionToolVersion("STV-001");
manifest.addAnalysis(
new Analysis("ANALYSIS_ID1", "ANALYSIS_ID1_ALIAS"),
new Analysis("ANALYSIS_ID2", "ANALYSIS_ID2_ALIAS"));
......
......@@ -116,8 +116,8 @@ ReadsManifestReaderTest {
.field(Field.NAME, " SOME-FANCY-NAME")
.field(Field.DESCRIPTION, " description")
.file("BAM", TempFileBuilder.empty("bam"))
.field(Field.SUBMISSION_TOOL, "ST-001")
.field(Field.SUBMISSION_TOOL_VERSION, "STV-001")
.field(ManifestReader.Fields.SUBMISSION_TOOL, "ST-001")
.field(ManifestReader.Fields.SUBMISSION_TOOL_VERSION, "STV-001")
.build());
Assert.assertEquals("ILLUMINA", manifest.getPlatform());
......
/*
* Copyright 2018-2019 EMBL - European Bioinformatics Institute
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package uk.ac.ebi.ena.webin.cli.context.sequence;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import uk.ac.ebi.ena.webin.cli.ManifestBuilder;
import uk.ac.ebi.ena.webin.cli.ReportTester;
import uk.ac.ebi.ena.webin.cli.TempFileBuilder;
import uk.ac.ebi.ena.webin.cli.WebinCliException;
import uk.ac.ebi.ena.webin.cli.WebinCliExecutor;
import uk.ac.ebi.ena.webin.cli.WebinCliExecutorBuilder;
import uk.ac.ebi.ena.webin.cli.WebinCliMessage;
import uk.ac.ebi.ena.webin.cli.WebinCliParameters;
import uk.ac.ebi.ena.webin.cli.WebinCliTestUtils;
import uk.ac.ebi.ena.webin.cli.context.reads.ReadsManifestReader;
import uk.ac.ebi.ena.webin.cli.manifest.ManifestReader;
import uk.ac.ebi.ena.webin.cli.manifest.processor.MetadataProcessorFactory;
import uk.ac.ebi.ena.webin.cli.validator.manifest.ReadsManifest;
import uk.ac.ebi.ena.webin.cli.validator.manifest.SequenceManifest;
import uk.ac.ebi.ena.webin.cli.validator.response.ReadsValidationResponse;
import java.io.File;
import java.nio.file.Paths;
import java.util.Locale;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static uk.ac.ebi.ena.webin.cli.WebinCliTestUtils.getResourceDir;
import static uk.ac.ebi.ena.webin.cli.context.reads.ReadsManifestReader.Field;
public class
SequenceManifestReaderTest {
private static SequenceManifestReader createManifestReader() {
WebinCliParameters parameters = WebinCliTestUtils.getTestWebinCliParameters();
return new SequenceManifestReader(ManifestReader.DEFAULT_PARAMETERS, new MetadataProcessorFactory(parameters));
}
@Before
public void
before() {
Locale.setDefault(Locale.UK);
}
@Test
public void
testValidManifest() {
SequenceManifestReader manifestReader = createManifestReader();
SequenceManifest manifest = manifestReader.getManifest();
Assert.assertNull(manifest.getStudy());
Assert.assertNull(manifest.getSample());
Assert.assertNull(manifest.getName());
assertThat(manifest.files().files()).size().isZero();
Assert.assertNull(manifest.getDescription());
Assert.assertNull(manifest.getSubmissionTool());
Assert.assertNull(manifest.getSubmissionToolVersion());
manifestReader.readManifest(Paths.get("."),
new ManifestBuilder()
.field(Field.NAME, " SOME-FANCY-NAME")
.field(Field.DESCRIPTION, " description")
.file("FLATFILE", TempFileBuilder.empty("csv"))
.field(ManifestReader.Fields.SUBMISSION_TOOL, "ST-001")
.field(ManifestReader.Fields.SUBMISSION_TOOL_VERSION, "STV-001")
.build());
Assert.assertEquals("SOME-FANCY-NAME", manifest.getName());
assertThat(manifest.files().files()).size().isOne();
Assert.assertEquals("description", manifest.getDescription());
Assert.assertEquals("ST-001", manifest.getSubmissionTool());
Assert.assertEquals("STV-001", manifest.getSubmissionToolVersion());
}
}
......@@ -42,8 +42,6 @@ public class SequenceXmlTest {
manifest.setStudy(new Study());
manifest.getStudy().setBioProjectId("test_study");
manifest.setDescription("test_description");
manifest.setSubmissionTool("ST-001");
manifest.setSubmissionToolVersion("STV-001");
return manifest;
}
......@@ -68,6 +66,8 @@ public class SequenceXmlTest {
new Analysis("ANALYSIS_ID1", "ANALYSIS_ID1_ALIAS"),
new Analysis("ANALYSIS_ID2", "ANALYSIS_ID2_ALIAS"));
manifest.addRun(new Run("RUN_ID1", "RUN_ID1_ALIAS"), new Run("RUN_ID2", "RUN_ID2_ALIAS"));
manifest.setSubmissionTool("ST-001");
manifest.setSubmissionToolVersion("STV-001");
SubmissionBundle sb = prepareSubmissionBundle(manifest);
......
/*
* Copyright 2018-2019 EMBL - European Bioinformatics Institute
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this
* file except in compliance with the License. You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*/
package uk.ac.ebi.ena.webin.cli.context.transcriptome;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import uk.ac.ebi.ena.webin.cli.ManifestBuilder;
import uk.ac.ebi.ena.webin.cli.ReportTester;
import uk.ac.ebi.ena.webin.cli.TempFileBuilder;
import uk.ac.ebi.ena.webin.cli.WebinCliException;
import uk.ac.ebi.ena.webin.cli.WebinCliExecutor;
import uk.ac.ebi.ena.webin.cli.WebinCliExecutorBuilder;
import uk.ac.ebi.ena.webin.cli.WebinCliMessage;
import uk.ac.ebi.ena.webin.cli.WebinCliParameters;
import uk.ac.ebi.ena.webin.cli.WebinCliTestUtils;
import uk.ac.ebi.ena.webin.cli.context.reads.ReadsManifestReader;
import uk.ac.ebi.ena.webin.cli.manifest.ManifestReader;
import uk.ac.ebi.ena.webin.cli.manifest.processor.MetadataProcessorFactory;
import uk.ac.ebi.ena.webin.cli.validator.manifest.ReadsManifest;
import uk.ac.ebi.ena.webin.cli.validator.manifest.TranscriptomeManifest;
import uk.ac.ebi.ena.webin.cli.validator.response.ReadsValidationResponse;
import java.io.File;
import java.nio.file.Paths;
import java.util.Locale;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static uk.ac.ebi.ena.webin.cli.WebinCliTestUtils.getResourceDir;
import static uk.ac.ebi.ena.webin.cli.context.reads.ReadsManifestReader.Field;
public class
TranscriptomeManifestReaderTest {
private static TranscriptomeManifestReader createManifestReader() {
WebinCliParameters parameters = WebinCliTestUtils.getTestWebinCliParameters();
return new TranscriptomeManifestReader(ManifestReader.DEFAULT_PARAMETERS, new MetadataProcessorFactory(parameters));
}
@Before
public void
before() {
Locale.setDefault(Locale.UK);
}
@Test
public void
testValidManifest() {
TranscriptomeManifestReader manifestReader = createManifestReader();
TranscriptomeManifest manifest = manifestReader.getManifest();
Assert.assertNull(manifest.getStudy());
Assert.assertNull(manifest.getSample());
Assert.assertNull(manifest.getPlatform());
Assert.assertNull(manifest.getName());
assertThat(manifest.files().files()).size().isZero();
Assert.assertNull(manifest.getDescription());
Assert.assertNull(manifest.getSubmissionTool());
Assert.assertNull(manifest.getSubmissionToolVersion());
manifestReader.readManifest(Paths.get("."),
new ManifestBuilder()
.field(Field.PLATFORM, " illumina")
.field(Field.NAME, " SOME-FANCY-NAME")
.field(Field.DESCRIPTION, " description")
.file("FASTA", TempFileBuilder.empty("fasta"))
.field(ManifestReader.Fields.SUBMISSION_TOOL, "ST-001")
.field(ManifestReader.Fields.SUBMISSION_TOOL_VERSION, "STV-001")
.build());
Assert.assertEquals("illumina", manifest.getPlatform());
Assert.assertEquals("SOME-FANCY-NAME", manifest.getName());
assertThat(manifest.files().files()).size().isOne();
Assert.assertEquals("description", manifest.getDescription());
Assert.assertEquals("ST-001", manifest.getSubmissionTool());
Assert.assertEquals("STV-001", manifest.getSubmissionToolVersion());
}
}
......@@ -47,8 +47,6 @@ public class TranscriptomeXmlTest {
manifest.getStudy().setBioProjectId("test_study");
manifest.setProgram("test_program");
manifest.setPlatform("test_platform");
manifest.setSubmissionTool("ST-001");
manifest.setSubmissionToolVersion("STV-001");
return manifest;
}
......@@ -73,6 +71,8 @@ public class TranscriptomeXmlTest {
new Analysis("ANALYSIS_ID1", "ANALYSIS_ID1_ALIAS"),
new Analysis("ANALYSIS_ID2", "ANALYSIS_ID2_ALIAS"));
manifest.addRun(new Run("RUN_ID1", "RUN_ID1_ALIAS"), new Run("RUN_ID2", "RUN_ID2_ALIAS"));
manifest.setSubmissionTool("ST-001");
manifest.setSubmissionToolVersion("STV-001");
SubmissionBundle sb = prepareSubmissionBundle(manifest);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment