use of org.molgenis.data.file.support.FileRepositoryCollection in project molgenis by molgenis.
the class OntologyImportServiceIT method testDoImportOwl.
private void testDoImportOwl() {
String fileName = "ontology-small.owl.zip";
File file = getFile("/owl/" + fileName);
FileRepositoryCollection repoCollection = fileRepositoryCollectionFactory.createFileRepositoryCollection(file);
ImportService importService = importServiceFactory.getImportService(file, repoCollection);
EntityImportReport importReport = importService.doImport(repoCollection, ADD, PACKAGE_DEFAULT);
validateImportReport(importReport, ImmutableMap.of("sys_ont_OntologyTermDynamicAnnotation", 4, "sys_ont_OntologyTermSynonym", 9, "sys_ont_OntologyTermNodePath", 10, "sys_ont_Ontology", 1, "sys_ont_OntologyTerm", 9), emptySet());
// Verify the import as system as we need write permissions on sys tables to carry out the verification
runAsSystem(this::verifyOwlAsSystem);
}
use of org.molgenis.data.file.support.FileRepositoryCollection in project molgenis by molgenis.
the class VcfImportServiceIT method testDoImportVcfWithoutSamples.
private void testDoImportVcfWithoutSamples() {
String entityTypeId = "variantsWithoutSamples";
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), ImmutableSet.of(entityTypeId));
assertVariants(entityTypeId, false);
}
use of org.molgenis.data.file.support.FileRepositoryCollection 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.file.support.FileRepositoryCollection 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.file.support.FileRepositoryCollection 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);
}
Aggregations