Search in sources :

Example 1 with ReadsValidationResponse

use of uk.ac.ebi.ena.webin.cli.validator.response.ReadsValidationResponse in project webin-cli by enasequence.

the class ReadsValidationTest method validFastq.

@Test
public void validFastq() {
    File manifestFile = manifestBuilder().file(FileType.FASTQ, "valid.fastq.gz").build();
    WebinCliExecutor<ReadsManifest, ReadsValidationResponse> executor = executorBuilder.build(manifestFile, RESOURCE_DIR);
    executor.readManifest();
    SubmissionFiles submissionFiles = executor.getManifestReader().getManifest().files();
    assertThat(submissionFiles.get().size()).isEqualTo(1);
    assertThat(submissionFiles.get(FileType.FASTQ).size()).isOne();
    executor.validateSubmission();
}
Also used : ReadsManifest(uk.ac.ebi.ena.webin.cli.validator.manifest.ReadsManifest) File(java.io.File) ReadsValidationResponse(uk.ac.ebi.ena.webin.cli.validator.response.ReadsValidationResponse) SubmissionFiles(uk.ac.ebi.ena.webin.cli.validator.file.SubmissionFiles) Test(org.junit.Test)

Example 2 with ReadsValidationResponse

use of uk.ac.ebi.ena.webin.cli.validator.response.ReadsValidationResponse in project webin-cli by enasequence.

the class ReadsValidationTest method sameFilePairedFastq.

@Test
public void sameFilePairedFastq() {
    File manifestFile = manifestBuilder().file(FileType.FASTQ, "valid.fastq.gz").file(FileType.FASTQ, "valid.fastq.gz").build();
    WebinCliExecutor<ReadsManifest, ReadsValidationResponse> executor = executorBuilder.build(manifestFile, RESOURCE_DIR);
    executor.readManifest();
    SubmissionFiles submissionFiles = executor.getManifestReader().getManifest().files();
    assertThat(submissionFiles.get().size()).isEqualTo(2);
    assertThat(submissionFiles.get(FileType.FASTQ).size()).isEqualTo(2);
    assertThatThrownBy(() -> executor.validateSubmission()).isInstanceOf(WebinCliException.class).hasMessage("");
    System.out.println(executor.getValidationDir().getAbsolutePath());
    new ReportTester(executor).textInSubmissionReport("Multiple (1) occurrences of read name");
}
Also used : ReadsManifest(uk.ac.ebi.ena.webin.cli.validator.manifest.ReadsManifest) File(java.io.File) ReadsValidationResponse(uk.ac.ebi.ena.webin.cli.validator.response.ReadsValidationResponse) SubmissionFiles(uk.ac.ebi.ena.webin.cli.validator.file.SubmissionFiles) Test(org.junit.Test)

Example 3 with ReadsValidationResponse

use of uk.ac.ebi.ena.webin.cli.validator.response.ReadsValidationResponse in project webin-cli by enasequence.

the class ReadsValidationTest method validPairedFastqOneFile.

@Test
public void validPairedFastqOneFile() {
    File manifestFile = manifestBuilder().file(FileType.FASTQ, "valid_paired_single_fastq.gz").build();
    WebinCliExecutor<ReadsManifest, ReadsValidationResponse> executor = executorBuilder.build(manifestFile, RESOURCE_DIR);
    executor.readManifest();
    SubmissionFiles submissionFiles = executor.getManifestReader().getManifest().files();
    assertThat(submissionFiles.get().size()).isEqualTo(1);
    assertThat(submissionFiles.get(FileType.FASTQ).size()).isOne();
    executor.validateSubmission();
    assertThat(executor.getValidationResponse().isPaired());
}
Also used : ReadsManifest(uk.ac.ebi.ena.webin.cli.validator.manifest.ReadsManifest) File(java.io.File) ReadsValidationResponse(uk.ac.ebi.ena.webin.cli.validator.response.ReadsValidationResponse) SubmissionFiles(uk.ac.ebi.ena.webin.cli.validator.file.SubmissionFiles) Test(org.junit.Test)

Example 4 with ReadsValidationResponse

use of uk.ac.ebi.ena.webin.cli.validator.response.ReadsValidationResponse in project webin-cli by enasequence.

the class ReadsValidationTest method validPairedFastqTwoFiles.

@Test
public void validPairedFastqTwoFiles() {
    File manifestFile = manifestBuilder().file(FileType.FASTQ, "valid_paired_1.fastq.gz").file(FileType.FASTQ, "valid_paired_2.fastq.gz").build();
    WebinCliExecutor<ReadsManifest, ReadsValidationResponse> executor = executorBuilder.build(manifestFile, RESOURCE_DIR);
    executor.readManifest();
    SubmissionFiles submissionFiles = executor.getManifestReader().getManifest().files();
    assertThat(submissionFiles.get().size()).isEqualTo(2);
    assertThat(submissionFiles.get(FileType.FASTQ).size()).isEqualTo(2);
    executor.validateSubmission();
    assertThat(executor.getValidationResponse().isPaired());
}
Also used : ReadsManifest(uk.ac.ebi.ena.webin.cli.validator.manifest.ReadsManifest) File(java.io.File) ReadsValidationResponse(uk.ac.ebi.ena.webin.cli.validator.response.ReadsValidationResponse) SubmissionFiles(uk.ac.ebi.ena.webin.cli.validator.file.SubmissionFiles) Test(org.junit.Test)

Example 5 with ReadsValidationResponse

use of uk.ac.ebi.ena.webin.cli.validator.response.ReadsValidationResponse in project webin-cli by enasequence.

the class ReadsValidationTest method invalidBAM.

@Test
public void invalidBAM() {
    File manifestFile = manifestBuilder().file(FileType.BAM, "invalid.bam").build();
    WebinCliExecutor<ReadsManifest, ReadsValidationResponse> executor = executorBuilder.build(manifestFile, RESOURCE_DIR);
    executor.readManifest();
    SubmissionFiles submissionFiles = executor.getManifestReader().getManifest().files();
    assertThat(submissionFiles.get().size()).isEqualTo(1);
    assertThat(submissionFiles.get(FileType.BAM).size()).isOne();
    assertThatThrownBy(() -> executor.validateSubmission()).isInstanceOf(WebinCliException.class).hasMessage("");
    new ReportTester(executor).textInFileReport("invalid.bam", "File contains no valid reads");
}
Also used : ReadsManifest(uk.ac.ebi.ena.webin.cli.validator.manifest.ReadsManifest) File(java.io.File) ReadsValidationResponse(uk.ac.ebi.ena.webin.cli.validator.response.ReadsValidationResponse) SubmissionFiles(uk.ac.ebi.ena.webin.cli.validator.file.SubmissionFiles) Test(org.junit.Test)

Aggregations

ReadsManifest (uk.ac.ebi.ena.webin.cli.validator.manifest.ReadsManifest)15 ReadsValidationResponse (uk.ac.ebi.ena.webin.cli.validator.response.ReadsValidationResponse)15 File (java.io.File)11 Test (org.junit.Test)11 SubmissionFiles (uk.ac.ebi.ena.webin.cli.validator.file.SubmissionFiles)11 ReportTester (uk.ac.ebi.ena.webin.cli.ReportTester)3 WebinCliException (uk.ac.ebi.ena.webin.cli.WebinCliException)3