Skip to content

Commit

Permalink
Update code according to OpenCB packages changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jtarraga committed Oct 13, 2020
1 parent a8b9975 commit 01fb249
Show file tree
Hide file tree
Showing 23 changed files with 582 additions and 608 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public String getLogLevel() {
public void setLogLevel(String logLevel) {
// This small hack allow to configure the appropriate Logger level from the command line, this is done
// by setting the DEFAULT_LOG_LEVEL_KEY before the logger object is created.
System.setProperty(org.slf4j.impl.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, logLevel);
//System.setProperty(org.slf4j.impl.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, logLevel);
logger = LoggerFactory.getLogger(this.getClass().toString());
this.logLevel = logLevel;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
import org.opencb.bionetdb.core.neo4j.Neo4JVariantLoader;
import org.opencb.cellbase.client.config.ClientConfiguration;
import org.opencb.cellbase.client.config.RestConfig;
import org.opencb.cellbase.client.rest.CellBaseClient;
import org.opencb.cellbase.client.rest.GeneClient;
import org.opencb.cellbase.client.rest.ProteinClient;
import org.opencb.cellbase.client.rest.VariationClient;
import org.opencb.cellbase.client.rest.*;
import org.opencb.commons.datastore.core.Query;
import org.opencb.commons.datastore.core.QueryOptions;
import org.opencb.commons.datastore.core.QueryResult;
Expand Down Expand Up @@ -190,12 +187,12 @@ public void annotateGenes(List<String> geneIds) throws IOException, BioNetDBExce
}

public void annotateVariants(NodeQuery query, QueryOptions options) throws IOException, BioNetDBException {
VariationClient variationClient = cellBaseClient.getVariationClient();
VariantClient variationClient = cellBaseClient.getVariantClient();
networkDBAdaptor.annotateVariants(query, options, variationClient);
}

public void annotateVariants(List<String> variantIds) throws IOException, BioNetDBException {
VariationClient variationClient = cellBaseClient.getVariationClient();
VariantClient variationClient = cellBaseClient.getVariantClient();
networkDBAdaptor.annotateVariants(variantIds, variationClient);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.opencb.bionetdb.core.analysis;

import org.opencb.biodata.models.clinical.interpretation.ClinicalProperty;
import org.opencb.biodata.models.clinical.ClinicalProperty;
import org.opencb.biodata.models.clinical.Disorder;
import org.opencb.biodata.models.clinical.pedigree.Pedigree;
import org.opencb.biodata.models.commons.Disorder;
import org.opencb.biodata.models.variant.Variant;
import org.opencb.bionetdb.core.analysis.interpretation.ProteinNetworkInterpretationAnalysis;
import org.opencb.bionetdb.core.api.NetworkDBAdaptor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.opencb.biodata.models.clinical.Disorder;
import org.opencb.biodata.models.clinical.pedigree.Pedigree;
import org.opencb.biodata.models.commons.Disorder;
import org.opencb.biodata.models.variant.Variant;
import org.opencb.biodata.tools.pedigree.ModeOfInheritance;
import org.opencb.bionetdb.core.api.NetworkDBAdaptor;
Expand All @@ -18,7 +18,7 @@
import java.io.IOException;
import java.util.*;

import static org.opencb.biodata.models.clinical.interpretation.ClinicalProperty.Penetrance.COMPLETE;
import static org.opencb.biodata.models.clinical.ClinicalProperty.Penetrance.COMPLETE;

public class VariantAnalysis extends BioNetDBAnalysis {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.opencb.bionetdb.core.analysis.interpretation;

import org.apache.commons.collections.CollectionUtils;
import org.opencb.biodata.models.clinical.interpretation.ClinicalProperty;
import org.opencb.biodata.models.clinical.ClinicalProperty;
import org.opencb.biodata.models.clinical.Disorder;
import org.opencb.biodata.models.clinical.pedigree.Pedigree;
import org.opencb.biodata.models.commons.Disorder;
import org.opencb.biodata.models.variant.Variant;
import org.opencb.biodata.tools.pedigree.ModeOfInheritance;
import org.opencb.bionetdb.core.api.NetworkDBAdaptor;
Expand All @@ -14,7 +14,7 @@

import java.util.*;

import static org.opencb.biodata.models.clinical.interpretation.ClinicalProperty.Penetrance.COMPLETE;
import static org.opencb.biodata.models.clinical.ClinicalProperty.Penetrance.COMPLETE;

public class ProteinNetworkInterpretationAnalysis {

Expand All @@ -29,19 +29,19 @@ public QueryResult<Variant> execute(Pedigree pedigree, Disorder disorder, Clinic
// Check moi
Map<String, List<String>> genotypes;
switch (moi) {
case MONOALLELIC:
case AUTOSOMAL_DOMINANT:
genotypes = org.opencb.biodata.tools.pedigree.ModeOfInheritance.dominant(pedigree, disorder, COMPLETE);
break;
case BIALLELIC:
case AUTOSOMAL_RECESSIVE:
genotypes = org.opencb.biodata.tools.pedigree.ModeOfInheritance.recessive(pedigree, disorder, COMPLETE);
break;
case XLINKED_MONOALLELIC:
case X_LINKED_DOMINANT:
genotypes = org.opencb.biodata.tools.pedigree.ModeOfInheritance.xLinked(pedigree, disorder, true, COMPLETE);
break;
case XLINKED_BIALLELIC:
case X_LINKED_RECESSIVE:
genotypes = org.opencb.biodata.tools.pedigree.ModeOfInheritance.xLinked(pedigree, disorder, false, COMPLETE);
break;
case YLINKED:
case Y_LINKED:
genotypes = ModeOfInheritance.yLinked(pedigree, disorder, COMPLETE);
break;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import org.opencb.bionetdb.core.models.network.Node;
import org.opencb.cellbase.client.rest.GeneClient;
import org.opencb.cellbase.client.rest.ProteinClient;
import org.opencb.cellbase.client.rest.VariationClient;
import org.opencb.cellbase.client.rest.VariantClient;
import org.opencb.commons.datastore.core.Query;
import org.opencb.commons.datastore.core.QueryOptions;
import org.opencb.commons.datastore.core.QueryParam;
Expand Down Expand Up @@ -85,8 +85,8 @@ enum NetworkQueryParams implements QueryParam {
// A N N O T A T I O N M E T H O D s
//-------------------------------------------------------------------------

void annotateVariants(NodeQuery query, QueryOptions options, VariationClient variationClient) throws BioNetDBException, IOException;
void annotateVariants(List<String> variantIds, VariationClient variationClient) throws BioNetDBException, IOException;
void annotateVariants(NodeQuery query, QueryOptions options, VariantClient variantClient) throws BioNetDBException, IOException;
void annotateVariants(List<String> variantIds, VariantClient variantClient) throws BioNetDBException, IOException;

void annotateGenes(NodeQuery query, QueryOptions options, GeneClient geneClient) throws BioNetDBException, IOException;
void annotateGenes(List<String> geneIds, GeneClient geneClient) throws BioNetDBException, IOException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.opencb.bionetdb.core.io;

import org.apache.commons.lang3.StringUtils;
import org.biopax.paxtools.model.BioPAXElement;
import org.biopax.paxtools.model.level3.*;
import org.biopax.paxtools.model.level3.Process;
import org.opencb.bionetdb.core.models.network.Network;
import org.opencb.bionetdb.core.models.network.Node;
import org.opencb.bionetdb.core.models.network.Relation;
import org.sqlite.util.StringUtils;

import java.io.IOException;
import java.nio.file.Path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public enum Type {
PANEL__PANEL_VARIANT("PANEL__PANEL_VARIANT"),
PANEL__PANEL_STR("PANEL__PANEL_STR"),
PANEL__PANEL_REGION("PANEL__PANEL_REGION"),
PANEL__PHENOTYPE("PANEL__PHENOTYPE"),
PANEL__DISORDER("PANEL__DISORDER"),
PHENOTYPE__ONTOLOGY_TERM("PHENOTYPE__ONTOLOGY_TERM"),
PANEL_GENE__GENE("PANEL_GENE__GENE"),
PANEL_GENE__ONTOLOGY_TERM("PANEL_GENE__ONTOLOGY_TERM"),
Expand Down
Loading

0 comments on commit 01fb249

Please sign in to comment.