public TieringAnalysis(String opencgaHome, String studyStr, String token, String clinicalAnalysisId, List<String> diseasePanelIds, ObjectMap config) { super(opencgaHome, studyStr, token); this.clinicalAnalysisId = clinicalAnalysisId; this.diseasePanelIds = diseasePanelIds; this.maxCoverage = 20; this.cellBaseClient = new CellBaseClient(storageConfiguration.getCellbase().toClientConfiguration()); this.alignmentStorageManager = new AlignmentStorageManager(catalogManager, StorageEngineFactory.get(storageConfiguration)); }
public StorageConfiguration(String defaultStorageEngineId, List<StorageEngineConfiguration> storageEngines) { this.defaultStorageEngineId = defaultStorageEngineId; this.storageEngines = storageEngines; this.cellbase = new CellBaseConfiguration(); this.server = new ServerConfiguration(); this.cache = new CacheConfiguration(); this.search = new SearchConfiguration(); this.clinical = new SearchConfiguration(); }
public CellBaseRestVariantAnnotator(StorageConfiguration storageConfiguration, ProjectMetadata projectMetadata, ObjectMap options) throws VariantAnnotatorException { super(storageConfiguration, projectMetadata, options); List<String> hosts = storageConfiguration.getCellbase().getHosts(); if (hosts.isEmpty()) { throw new VariantAnnotatorException("Missing defaultValue \"CellBase Hosts\""); } String cellbaseRest = hosts.get(0); checkNotNull(cellbaseRest, "cellbase hosts"); ClientConfiguration clientConfiguration = storageConfiguration.getCellbase().toClientConfiguration(); clientConfiguration.getRest().setTimeout(TIMEOUT); cellBaseClient = new CellBaseClient(species, assembly, clientConfiguration); logger.info("Annotating with Cellbase REST. host '{}', version '{}', species '{}', assembly '{}'", cellbaseRest, cellbaseVersion, species, assembly); if (impreciseVariants) { // If the cellbase sever supports imprecise variants, use the original toString, which adds the CIPOS and CIEND variantSerializer = Variant::toString; } else { variantSerializer = variant -> variant.getChromosome() + ':' + variant.getStart() + ':' + (variant.getReference().isEmpty() ? "-" : variant.getReference()) + ':' + (variant.getAlternate().isEmpty() ? "-" : variant.getAlternate()); } }
public ClientConfiguration toClientConfiguration() { ClientConfiguration clientConfiguration = new ClientConfiguration(); clientConfiguration.setVersion(this.getVersion()); clientConfiguration.setDefaultSpecies("hsapiens"); RestConfig rest = new RestConfig(); List<String> hosts = new ArrayList<>(this.getHosts().size()); for (String host : this.getHosts()) { hosts.add(host.replace("/webservices/rest", "")); } rest.setHosts(hosts); clientConfiguration.setRest(rest); return clientConfiguration; } }
List<String> hosts = storageConfiguration.getCellbase().getDatabase().getHosts(); String hostsString = StringUtils.join(hosts, ","); checkNotNull(hostsString, "cellbase database host"); databaseCredentials.setHost(hostsString); databaseCredentials.setPassword(storageConfiguration.getCellbase().getDatabase().getPassword()); databaseCredentials.setUser(storageConfiguration.getCellbase().getDatabase().getUser()); databaseCredentials.setOptions(storageConfiguration.getCellbase().getDatabase().getOptions()); databases.setMongodb(databaseCredentials); cellBaseConfiguration.setDatabases(databases);
public AbstractCellBaseVariantAnnotator(StorageConfiguration storageConfiguration, ProjectMetadata projectMetadata, ObjectMap params) throws VariantAnnotatorException { super(storageConfiguration, projectMetadata, params); // species = toCellBaseSpeciesName(params.getString(VariantAnnotationManager.SPECIES)); // assembly = params.getString(VariantAnnotationManager.ASSEMBLY); species = projectMetadata.getSpecies(); assembly = projectMetadata.getAssembly(); cellbaseVersion = storageConfiguration.getCellbase().getVersion(); queryOptions = new QueryOptions(); if (StringUtils.isNotEmpty(params.getString(ANNOTATOR_CELLBASE_INCLUDE))) { queryOptions.put(QueryOptions.INCLUDE, params.getString(ANNOTATOR_CELLBASE_INCLUDE)); } else if (StringUtils.isNotEmpty(params.getString(ANNOTATOR_CELLBASE_EXCLUDE))) { queryOptions.put(QueryOptions.EXCLUDE, params.getString(ANNOTATOR_CELLBASE_EXCLUDE)); } if (!params.getBoolean(ANNOTATOR_CELLBASE_USE_CACHE)) { queryOptions.append("useCache", false); } impreciseVariants = params.getBoolean(ANNOTATOR_CELLBASE_IMPRECISE_VARIANTS, true); checkNotNull(cellbaseVersion, "cellbase version"); checkNotNull(species, "species"); checkNotNull(assembly, "assembly"); }
public CustomAnalysis(Query query, String opencgaHome, String studyStr, String token) { super(opencgaHome, studyStr, token); this.query = query; // this.clinicalAnalysisId = clinicalAnalysisId; // this.probandSampleId = probandSampleId; // this.diseaseName = diseaseName; // this.diseasePanelIds = diseasePanelIds; this.maxCoverage = 20; this.cellBaseClient = new CellBaseClient(storageConfiguration.getCellbase().toClientConfiguration()); this.alignmentStorageManager = new AlignmentStorageManager(catalogManager, StorageEngineFactory.get(storageConfiguration)); }
CellBaseConfiguration cellBaseConfiguration = new CellBaseConfiguration(Arrays.asList("localhost"), "v3", new DatabaseCredentials (Arrays.asList("localhost"), "user", "password")); ServerConfiguration serverConfiguration =
public CellBaseUtils getCellBaseUtils() throws StorageEngineException { if (cellBaseUtils == null) { final ProjectMetadata metadata = getStudyConfigurationManager().getProjectMetadata(getOptions()).first(); String species = metadata.getSpecies(); String assembly = metadata.getAssembly(); ClientConfiguration clientConfiguration = configuration.getCellbase().toClientConfiguration(); if (StringUtils.isEmpty(species)) { species = clientConfiguration.getDefaultSpecies(); } species = toCellBaseSpeciesName(species); cellBaseUtils = new CellBaseUtils(new CellBaseClient(species, assembly, clientConfiguration)); } return cellBaseUtils; }
public VariantSearchManager(StudyConfigurationManager studyConfigurationManager, StorageConfiguration storageConfiguration) { this.storageConfiguration = storageConfiguration; this.solrQueryParser = new SolrQueryParser(studyConfigurationManager); this.cellBaseClient = new CellBaseClient(storageConfiguration.getCellbase().toClientConfiguration()); this.variantSearchToVariantConverter = new VariantSearchToVariantConverter(); this.solrManager = new SolrManager(storageConfiguration.getSearch().getHosts(), storageConfiguration.getSearch().getMode(), storageConfiguration.getSearch().getTimeout()); // Set internal insert batch size from configuration and default value insertBatchSize = storageConfiguration.getSearch().getInsertBatchSize() > 0 ? storageConfiguration.getSearch().getInsertBatchSize() : DEFAULT_INSERT_BATCH_SIZE; logger = LoggerFactory.getLogger(VariantSearchManager.class); }
List<Variant> variants = reader.read(limit); CellBaseClient cellBaseClient = new CellBaseClient(variantStorageEngine.getConfiguration().getCellbase().toClientConfiguration()); QueryResponse<VariantAnnotation> queryResponse = cellBaseClient.getVariantClient().getAnnotationByVariantIds(variants.stream().map(Variant::toString).collect(Collectors.toList()), QueryOptions.empty());