Search in sources :

Example 1 with GalaxyHistoriesService

use of ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyHistoriesService in project irida by phac-nml.

the class GalaxyHistoriesServiceIT method setup.

/**
 * Sets up files for history tests.
 * @throws URISyntaxException
 * @throws IOException
 * @throws CreateLibraryException
 * @throws ExecutionManagerObjectNotFoundException
 */
@Before
public void setup() throws URISyntaxException, IOException, CreateLibraryException, ExecutionManagerObjectNotFoundException {
    setupDataFiles();
    galaxyInstanceAdmin = localGalaxy.getGalaxyInstanceAdmin();
    HistoriesClient historiesClient = galaxyInstanceAdmin.getHistoriesClient();
    ToolsClient toolsClient = galaxyInstanceAdmin.getToolsClient();
    LibrariesClient librariesClient = galaxyInstanceAdmin.getLibrariesClient();
    galaxyLibrariesService = new GalaxyLibrariesService(librariesClient, LIBRARY_POLLING_TIME, LIBRARY_TIMEOUT, 1);
    galaxyHistory = new GalaxyHistoriesService(historiesClient, toolsClient, galaxyLibrariesService);
}
Also used : GalaxyHistoriesService(ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyHistoriesService) ToolsClient(com.github.jmchilton.blend4j.galaxy.ToolsClient) LibrariesClient(com.github.jmchilton.blend4j.galaxy.LibrariesClient) HistoriesClient(com.github.jmchilton.blend4j.galaxy.HistoriesClient) GalaxyLibrariesService(ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyLibrariesService) Before(org.junit.Before)

Example 2 with GalaxyHistoriesService

use of ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyHistoriesService in project irida by phac-nml.

the class GalaxyWorkflowsIT method setup.

/**
 * Sets up files and objects for workflow tests.
 * @throws URISyntaxException
 * @throws IOException
 */
@Before
public void setup() throws URISyntaxException, IOException {
    Assume.assumeFalse(WindowsPlatformCondition.isWindows());
    dataFile1 = Paths.get(GalaxyWorkflowsIT.class.getResource("testData1.fastq").toURI());
    dataFile2 = Paths.get(GalaxyWorkflowsIT.class.getResource("testData2.fastq").toURI());
    dataFile3 = Paths.get(GalaxyWorkflowsIT.class.getResource("testData3.fastq").toURI());
    dataFile4 = Paths.get(GalaxyWorkflowsIT.class.getResource("testData4.fastq").toURI());
    workflowPath = Paths.get(GalaxyWorkflowsIT.class.getResource("GalaxyWorkflowSingleInput.ga").toURI());
    invalidWorkflowPath = Paths.get(GalaxyWorkflowsIT.class.getResource("InvalidGalaxyWorkflowSingleInput.ga").toURI());
    dataFileNotExists = Files.createTempFile("temp", ".temp");
    Files.delete(dataFileNotExists);
    assertFalse(Files.exists(dataFileNotExists));
    galaxyAdminInstance = localGalaxy.getGalaxyInstanceAdmin();
    toolsClient = galaxyAdminInstance.getToolsClient();
    workflowsClient = galaxyAdminInstance.getWorkflowsClient();
    historiesClient = galaxyAdminInstance.getHistoriesClient();
    librariesClient = galaxyAdminInstance.getLibrariesClient();
    GalaxyLibrariesService galaxyLibrariesService = new GalaxyLibrariesService(librariesClient, LIBRARY_POLLING_TIME, LIBRARY_TIMEOUT, 1);
    galaxyHistory = new GalaxyHistoriesService(historiesClient, toolsClient, galaxyLibrariesService);
    galaxyWorkflowService = new GalaxyWorkflowService(workflowsClient, StandardCharsets.UTF_8);
}
Also used : GalaxyHistoriesService(ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyHistoriesService) GalaxyWorkflowService(ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyWorkflowService) GalaxyLibrariesService(ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyLibrariesService) Before(org.junit.Before)

Example 3 with GalaxyHistoriesService

use of ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyHistoriesService in project irida by phac-nml.

the class GalaxyHistoriesServiceTest method setup.

/**
 * Sets up objects for history tests.
 * @throws URISyntaxException
 */
@Before
public void setup() throws URISyntaxException {
    MockitoAnnotations.initMocks(this);
    when(okayResponse.getClientResponseStatus()).thenReturn(ClientResponse.Status.OK);
    when(invalidResponse.getClientResponseStatus()).thenReturn(ClientResponse.Status.FORBIDDEN);
    galaxyHistory = new GalaxyHistoriesService(historiesClient, toolsClient, galaxyLibrariesService);
    dataFile = Paths.get(this.getClass().getResource("testData1.fastq").toURI());
    history = new History();
    history.setId(HISTORY_ID);
    datasetHistoryContents = buildHistoryContentsList(FILENAME, DATA_ID);
    datasetForFile = new Dataset();
    datasetForFile.setName(FILENAME);
    datasetForFile.setId(DATA_ID);
    datasetForFile.setUrl("datasets/" + DATA_ID + "/display");
    datasetForFile.setGalaxyUrl("http://fakehost");
    datasetForFile.setApiKey("1");
}
Also used : GalaxyHistoriesService(ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyHistoriesService) Dataset(com.github.jmchilton.blend4j.galaxy.beans.Dataset) HistoryDataset(com.github.jmchilton.blend4j.galaxy.beans.HistoryDataset) History(com.github.jmchilton.blend4j.galaxy.beans.History) Before(org.junit.Before)

Example 4 with GalaxyHistoriesService

use of ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyHistoriesService in project irida by phac-nml.

the class AnalysisProvenanceServiceGalaxyTest method setUp.

@Before
public void setUp() {
    this.galaxyHistoriesService = mock(GalaxyHistoriesService.class);
    this.toolsClient = mock(ToolsClient.class);
    this.jobsClient = mock(JobsClient.class);
    this.provenanceService = new AnalysisProvenanceServiceGalaxy(galaxyHistoriesService, toolsClient, jobsClient);
}
Also used : GalaxyHistoriesService(ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyHistoriesService) AnalysisProvenanceServiceGalaxy(ca.corefacility.bioinformatics.irida.service.analysis.workspace.galaxy.AnalysisProvenanceServiceGalaxy) ToolsClient(com.github.jmchilton.blend4j.galaxy.ToolsClient) JobsClient(com.github.jmchilton.blend4j.galaxy.JobsClient) Before(org.junit.Before)

Example 5 with GalaxyHistoriesService

use of ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyHistoriesService in project irida by phac-nml.

the class AnalysisWorkspaceServiceGalaxyIT method setup.

/**
 * Sets up variables for testing.
 *
 * @throws URISyntaxException
 * @throws IOException
 * @throws IridaWorkflowLoadException
 */
@Before
public void setup() throws URISyntaxException, IOException, IridaWorkflowLoadException {
    Assume.assumeFalse(WindowsPlatformCondition.isWindows());
    Path sequenceFilePathReal = Paths.get(DatabaseSetupGalaxyITService.class.getResource("testData1.fastq").toURI());
    Path referenceFilePathReal = Paths.get(DatabaseSetupGalaxyITService.class.getResource("testReference.fasta").toURI());
    Path tempDir = Files.createTempDirectory(rootTempDirectory, "workspaceServiceGalaxyTest");
    sequenceFilePathA = tempDir.resolve("testDataA_R1_001.fastq");
    Files.copy(sequenceFilePathReal, sequenceFilePathA, StandardCopyOption.REPLACE_EXISTING);
    sequenceFilePath2A = tempDir.resolve("testDataA_R2_001.fastq");
    Files.copy(sequenceFilePathReal, sequenceFilePath2A, StandardCopyOption.REPLACE_EXISTING);
    sequenceFilePathB = tempDir.resolve("testDataB_R1_001.fastq");
    Files.copy(sequenceFilePathReal, sequenceFilePathB, StandardCopyOption.REPLACE_EXISTING);
    sequenceFilePath2B = tempDir.resolve("testDataB_R2_001.fastq");
    Files.copy(sequenceFilePathReal, sequenceFilePath2B, StandardCopyOption.REPLACE_EXISTING);
    sequenceFilePath3 = tempDir.resolve("testData3_R1_001.fastq");
    Files.copy(sequenceFilePathReal, sequenceFilePath3, StandardCopyOption.REPLACE_EXISTING);
    referenceFilePath = Files.createTempFile("testReference", ".fasta");
    Files.delete(referenceFilePath);
    Files.copy(referenceFilePathReal, referenceFilePath);
    singleFileSet = Sets.newHashSet(new SingleEndSequenceFile(new SequenceFile(sequenceFilePathA)));
    GalaxyInstance galaxyInstanceAdmin = localGalaxy.getGalaxyInstanceAdmin();
    HistoriesClient historiesClient = galaxyInstanceAdmin.getHistoriesClient();
    ToolsClient toolsClient = galaxyInstanceAdmin.getToolsClient();
    LibrariesClient librariesClient = galaxyInstanceAdmin.getLibrariesClient();
    GalaxyLibrariesService galaxyLibrariesService = new GalaxyLibrariesService(librariesClient, LIBRARY_POLLING_TIME, LIBRARY_TIMEOUT, 1);
    galaxyHistoriesService = new GalaxyHistoriesService(historiesClient, toolsClient, galaxyLibrariesService);
    pairSequenceFiles1A = new ArrayList<>();
    pairSequenceFiles1A.add(sequenceFilePathA);
    pairSequenceFiles2A = new ArrayList<>();
    pairSequenceFiles2A.add(sequenceFilePath2A);
    pairSequenceFiles1AB = new ArrayList<>();
    pairSequenceFiles1AB.add(sequenceFilePathA);
    pairSequenceFiles1AB.add(sequenceFilePathB);
    pairSequenceFiles2AB = new ArrayList<>();
    pairSequenceFiles2AB.add(sequenceFilePath2A);
    pairSequenceFiles2AB.add(sequenceFilePath2B);
}
Also used : Path(java.nio.file.Path) GalaxyHistoriesService(ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyHistoriesService) SequenceFile(ca.corefacility.bioinformatics.irida.model.sequenceFile.SequenceFile) SingleEndSequenceFile(ca.corefacility.bioinformatics.irida.model.sequenceFile.SingleEndSequenceFile) ToolsClient(com.github.jmchilton.blend4j.galaxy.ToolsClient) LibrariesClient(com.github.jmchilton.blend4j.galaxy.LibrariesClient) GalaxyInstance(com.github.jmchilton.blend4j.galaxy.GalaxyInstance) SingleEndSequenceFile(ca.corefacility.bioinformatics.irida.model.sequenceFile.SingleEndSequenceFile) HistoriesClient(com.github.jmchilton.blend4j.galaxy.HistoriesClient) GalaxyLibrariesService(ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyLibrariesService) Before(org.junit.Before)

Aggregations

GalaxyHistoriesService (ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyHistoriesService)5 Before (org.junit.Before)5 GalaxyLibrariesService (ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyLibrariesService)3 ToolsClient (com.github.jmchilton.blend4j.galaxy.ToolsClient)3 HistoriesClient (com.github.jmchilton.blend4j.galaxy.HistoriesClient)2 LibrariesClient (com.github.jmchilton.blend4j.galaxy.LibrariesClient)2 SequenceFile (ca.corefacility.bioinformatics.irida.model.sequenceFile.SequenceFile)1 SingleEndSequenceFile (ca.corefacility.bioinformatics.irida.model.sequenceFile.SingleEndSequenceFile)1 GalaxyWorkflowService (ca.corefacility.bioinformatics.irida.pipeline.upload.galaxy.GalaxyWorkflowService)1 AnalysisProvenanceServiceGalaxy (ca.corefacility.bioinformatics.irida.service.analysis.workspace.galaxy.AnalysisProvenanceServiceGalaxy)1 GalaxyInstance (com.github.jmchilton.blend4j.galaxy.GalaxyInstance)1 JobsClient (com.github.jmchilton.blend4j.galaxy.JobsClient)1 Dataset (com.github.jmchilton.blend4j.galaxy.beans.Dataset)1 History (com.github.jmchilton.blend4j.galaxy.beans.History)1 HistoryDataset (com.github.jmchilton.blend4j.galaxy.beans.HistoryDataset)1 Path (java.nio.file.Path)1