use of org.molgenis.data.importer.ImportService in project molgenis by molgenis.
the class VcfImportServiceIT method testDoImportVcfGzWithSamples.
private void testDoImportVcfGzWithSamples() {
String entityTypeId = "variantsWithSamplesGz";
String fileName = entityTypeId + ".vcf.gz";
File file = getFile("/vcf/" + fileName);
FileRepositoryCollection repoCollection = fileRepositoryCollectionFactory.createFileRepositoryCollection(file);
ImportService importService = importServiceFactory.getImportService(file, repoCollection);
EntityImportReport importReport = importService.doImport(repoCollection, ADD, PACKAGE_DEFAULT);
validateImportReport(importReport, ImmutableMap.of("variantsWithSamplesGz", 10, "variantsWithSamplesGzSample", 10), ImmutableSet.of("variantsWithSamplesGz", "variantsWithSamplesGzSample"));
assertVariants(entityTypeId, true);
}
use of org.molgenis.data.importer.ImportService in project molgenis by molgenis.
the class VcfImportServiceIT method testDoImportVcfWithSamples.
private void testDoImportVcfWithSamples() {
String entityTypeId = "variantsWithSamples";
String fileName = entityTypeId + ".vcf";
File file = getFile("/vcf/" + fileName);
FileRepositoryCollection repoCollection = fileRepositoryCollectionFactory.createFileRepositoryCollection(file);
ImportService importService = importServiceFactory.getImportService(file, repoCollection);
EntityImportReport importReport = importService.doImport(repoCollection, ADD, PACKAGE_DEFAULT);
validateImportReport(importReport, ImmutableMap.of(entityTypeId, 10, entityTypeId + "Sample", 10), ImmutableSet.of(entityTypeId, entityTypeId + "Sample"));
assertVariants(entityTypeId, true);
}
use of org.molgenis.data.importer.ImportService in project molgenis by molgenis.
the class EmxImportServiceIT method testDoImportEmxCsvZip.
private void testDoImportEmxCsvZip() {
String fileName = "emx-csv.zip";
File file = getFile("/csv/" + fileName);
FileRepositoryCollection repoCollection = fileRepositoryCollectionFactory.createFileRepositoryCollection(file);
ImportService importService = importServiceFactory.getImportService(file, repoCollection);
EntityImportReport importReport = importService.doImport(repoCollection, ADD, PACKAGE_DEFAULT);
validateImportReport(importReport, ImmutableMap.of(CSV_HOSPITAL, 3, CSV_PATIENTS, 3), ImmutableSet.of(CSV_HOSPITAL, CSV_PATIENTS));
verifyFirstAndLastRows(CSV_HOSPITAL, hospitalFirstRow, hospitalLastRow);
verifyFirstAndLastRows(CSV_PATIENTS, patientsFirstRow, patientsLastRow);
}
use of org.molgenis.data.importer.ImportService in project molgenis by molgenis.
the class EmxImportServiceIT method testDoImportEmxTsvZip.
private void testDoImportEmxTsvZip() {
String fileName = "emx-tsv.zip";
File file = getFile("/tsv/" + fileName);
FileRepositoryCollection repoCollection = fileRepositoryCollectionFactory.createFileRepositoryCollection(file);
ImportService importService = importServiceFactory.getImportService(file, repoCollection);
EntityImportReport importReport = importService.doImport(repoCollection, ADD, PACKAGE_DEFAULT);
validateImportReport(importReport, ImmutableMap.of(TSV_HOSPITAL, 3, TSV_PATIENTS, 3), ImmutableSet.of(TSV_HOSPITAL, TSV_PATIENTS));
verifyFirstAndLastRows(TSV_HOSPITAL, hospitalFirstRow, hospitalLastRow);
verifyFirstAndLastRows(TSV_PATIENTS, patientsFirstRow, patientsLastRow);
}
use of org.molgenis.data.importer.ImportService in project molgenis by molgenis.
the class EmxImportServiceIT method executeAddUpdateOrUpdateTest.
private void executeAddUpdateOrUpdateTest(File file, File addUpdateFile, Map<String, Integer> entityCountMap, Set<String> addedEntityTypes, Runnable entityValidationMethod) {
FileRepositoryCollection addRepoCollection = fileRepositoryCollectionFactory.createFileRepositoryCollection(file);
ImportService addImportService = importServiceFactory.getImportService(file, addRepoCollection);
addImportService.doImport(addRepoCollection, ADD, PACKAGE_DEFAULT);
FileRepositoryCollection addUpdateRepoCollection = fileRepositoryCollectionFactory.createFileRepositoryCollection(addUpdateFile);
ImportService addUpdateImportService = importServiceFactory.getImportService(addUpdateFile, addUpdateRepoCollection);
EntityImportReport importReport = addUpdateImportService.doImport(addUpdateRepoCollection, ADD_UPDATE_EXISTING, PACKAGE_DEFAULT);
validateImportReport(importReport, entityCountMap, addedEntityTypes);
entityValidationMethod.run();
}
Aggregations