use of org.icgc.dcc.song.server.model.analysis.SequencingReadAnalysis in project SONG by overture-stack.
the class UploadServiceTest method testNullSyncSequencingRead.
@Test
public void testNullSyncSequencingRead() {
val filename1 = "documents/deserialization/sequencingread-deserialize1.json";
val uploadId1 = uploadFromTestDir(DEFAULT_STUDY, filename1, false);
val saveStatus1 = uploadService.save(DEFAULT_STUDY, uploadId1, false);
val analysisStatus1 = fromStatus(saveStatus1, "status");
assertThat(analysisStatus1).isEqualTo("ok");
val analysisId1 = fromStatus(saveStatus1, "analysisId");
val a1 = analysisService.read(analysisId1);
val sa1 = ((SequencingReadAnalysis) a1).getExperiment();
assertThat(sa1.getAligned()).isNull();
assertThat(sa1.getAlignmentTool()).isNull();
assertThat(sa1.getInsertSize()).isNull();
assertThat(sa1.getLibraryStrategy()).isEqualTo("WXS");
assertThat(sa1.getPairedEnd()).isNull();
assertThat(sa1.getReferenceGenome()).isNull();
assertThat(sa1.getInfo().path("random").isNull()).isTrue();
val filename2 = "documents/deserialization/sequencingread-deserialize2.json";
val uploadId2 = uploadFromTestDir(DEFAULT_STUDY, filename2, false);
val saveStatus2 = uploadService.save(DEFAULT_STUDY, uploadId2, false);
val analysisStatus2 = fromStatus(saveStatus2, "status");
assertThat(analysisStatus2).isEqualTo("ok");
val analysisId2 = fromStatus(saveStatus2, "analysisId");
val a2 = analysisService.read(analysisId2);
val sa2 = ((SequencingReadAnalysis) a2).getExperiment();
assertThat(sa2.getAligned()).isNull();
assertThat(sa2.getAlignmentTool()).isNull();
assertThat(sa2.getInsertSize()).isNull();
assertThat(sa2.getLibraryStrategy()).isEqualTo("WXS");
assertThat(sa2.getPairedEnd()).isTrue();
assertThat(sa2.getReferenceGenome()).isNull();
}
use of org.icgc.dcc.song.server.model.analysis.SequencingReadAnalysis in project SONG by overture-stack.
the class AnalysisService method updateAnalysis.
public ResponseEntity<String> updateAnalysis(String studyId, Analysis analysis) {
val id = analysis.getAnalysisId();
repository.deleteCompositeEntities(id);
saveCompositeEntities(studyId, id, analysis.getSample());
repository.deleteFiles(id);
analysis.getFile().forEach(f -> fileInfoService.delete(f.getObjectId()));
saveFiles(id, studyId, analysis.getFile());
analysisInfoService.update(id, analysis.getInfoAsString());
if (analysis instanceof SequencingReadAnalysis) {
val experiment = ((SequencingReadAnalysis) analysis).getExperiment();
updateSequencingRead(id, experiment);
} else if (analysis instanceof VariantCallAnalysis) {
val experiment = ((VariantCallAnalysis) analysis).getExperiment();
updateVariantCall(id, experiment);
}
return ok("AnalysisId %s was updated successfully", analysis.getAnalysisId());
}
use of org.icgc.dcc.song.server.model.analysis.SequencingReadAnalysis in project SONG by overture-stack.
the class AnalysisConverter method buildSequencingReadAnalysis.
private static SequencingReadAnalysis buildSequencingReadAnalysis(SeqReadAggregate seqReadAggregate) {
val analysisType = AnalysisTypes.resolve(seqReadAggregate.getType());
checkState(analysisType == SEQUENCING_READ, "The input SeqReadAggregate[%s] is NOT of analysisType [%s]", seqReadAggregate, SEQUENCING_READ.getAnalysisTypeName());
val sequencingReadAnalysis = new SequencingReadAnalysis();
val analysisId = seqReadAggregate.getAnalysisId();
sequencingReadAnalysis.setAnalysisId(analysisId);
sequencingReadAnalysis.setAnalysisState(PUBLISHED.toString());
sequencingReadAnalysis.setStudy(seqReadAggregate.getStudyId());
sequencingReadAnalysis.setInfo(NA);
val sequencingReadExperiment = SequencingRead.create(seqReadAggregate.getAnalysisId(), seqReadAggregate.isAligned(), seqReadAggregate.getAlignmentTool(), NULL_INSERT_SIZE, seqReadAggregate.getLibraryStrategy(), DEFAULT_SEQUENCING_READ_IS_PAIRED, seqReadAggregate.getReferenceGenome());
sequencingReadAnalysis.setExperiment(sequencingReadExperiment);
return sequencingReadAnalysis;
}
Aggregations