Search in sources :

Example 11 with Sample

use of com.hartwig.patient.Sample in project pipeline5 by hartwigmedical.

the class SbpSampleReaderTest method handlesSubdirectories.

@Test
public void handlesSubdirectories() {
    returnJson(FASTQ_JSON_SUBDIRECTORIES);
    Sample sample = victim.read(EXISTS);
    assertThat(sample.lanes()).hasSize(2);
    assertThat(sample.name()).isEqualTo("CPCT02330029T");
}
Also used : Sample(com.hartwig.patient.Sample) Test(org.junit.Test)

Example 12 with Sample

use of com.hartwig.patient.Sample in project pipeline5 by hartwigmedical.

the class GoogleStorageSampleSourceTest method verifyFastq.

private void verifyFastq(final String firstOfPair, final String secondOfPair) {
    Bucket bucket = mock(Bucket.class);
    Blob firstBlob = TestBlobs.blob(firstOfPair);
    Blob secondBlob = TestBlobs.blob(secondOfPair);
    Page<Blob> page = TestBlobs.pageOf(firstBlob, secondBlob);
    when(bucket.list(Storage.BlobListOption.prefix("aligner/samples/"))).thenReturn(page);
    when(storage.get(Mockito.anyString())).thenReturn(bucket);
    Sample sample = victim.sample(referenceRunMetadata());
    assertThat(sample.name()).isEqualTo(TestInputs.referenceSample());
    assertThat(sample.lanes()).hasSize(1);
    Lane lane = sample.lanes().get(0);
    assertThat(lane.firstOfPairPath()).isEqualTo(firstBlob.getName());
    assertThat(lane.secondOfPairPath()).isEqualTo(secondBlob.getName());
}
Also used : Blob(com.google.cloud.storage.Blob) Bucket(com.google.cloud.storage.Bucket) Sample(com.hartwig.patient.Sample) Lane(com.hartwig.patient.Lane)

Aggregations

Sample (com.hartwig.patient.Sample)12 Test (org.junit.Test)8 Lane (com.hartwig.patient.Lane)4 Blob (com.google.cloud.storage.Blob)1 Bucket (com.google.cloud.storage.Bucket)1 Storage (com.google.cloud.storage.Storage)1 Arguments (com.hartwig.pipeline.Arguments)1 ResultsDirectory (com.hartwig.pipeline.ResultsDirectory)1 Aligner (com.hartwig.pipeline.alignment.Aligner)1 AlignmentOutput (com.hartwig.pipeline.alignment.AlignmentOutput)1 ImmutableAlignmentOutput (com.hartwig.pipeline.alignment.ImmutableAlignmentOutput)1 JsonSampleSource (com.hartwig.pipeline.alignment.sample.JsonSampleSource)1 SampleSource (com.hartwig.pipeline.alignment.sample.SampleSource)1 DataType (com.hartwig.pipeline.datatypes.DataType)1 FileTypes.bai (com.hartwig.pipeline.datatypes.FileTypes.bai)1 FileTypes.bam (com.hartwig.pipeline.datatypes.FileTypes.bam)1 PipelineStatus (com.hartwig.pipeline.execution.PipelineStatus)1 BashStartupScript (com.hartwig.pipeline.execution.vm.BashStartupScript)1 ComputeEngine (com.hartwig.pipeline.execution.vm.ComputeEngine)1 InputDownload (com.hartwig.pipeline.execution.vm.InputDownload)1