From ed6a4c2d5a35eb6215cc8a39c14deeea6a856dd7 Mon Sep 17 00:00:00 2001 From: JJ Gao Date: Sun, 27 May 2018 14:56:46 -0400 Subject: [PATCH] support swissmodel --- MutationHotspotsDetection/pom.xml | 21 +- .../ProteinStructureHotspotDetective.java | 10 +- .../ContactMapFromPDB.java} | 14 +- .../structure/ContactMapFromSwissModel.java | 226 ++++++++++++++++++ .../utils/{ => structure}/OneToOneMap.java | 2 +- .../ProteinStructureContactMapCalculator.java | 30 +++ .../utils/ProteinStructureUtilsTest.java | 75 ------ ...teinStructureContactMapCalculatorTest.java | 95 ++++++++ README.md | 2 +- pom.xml | 2 +- 10 files changed, 378 insertions(+), 99 deletions(-) rename MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/{ProteinStructureUtils.java => structure/ContactMapFromPDB.java} (95%) create mode 100644 MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/structure/ContactMapFromSwissModel.java rename MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/{ => structure}/OneToOneMap.java (99%) create mode 100644 MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/structure/ProteinStructureContactMapCalculator.java delete mode 100644 MutationHotspotsDetection/src/test/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/ProteinStructureUtilsTest.java create mode 100644 MutationHotspotsDetection/src/test/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/structure/ProteinStructureContactMapCalculatorTest.java diff --git a/MutationHotspotsDetection/pom.xml b/MutationHotspotsDetection/pom.xml index 5c47f06..c67404c 100644 --- a/MutationHotspotsDetection/pom.xml +++ b/MutationHotspotsDetection/pom.xml @@ -4,10 +4,10 @@ org.cbioportal.mutationhotspots master - 1.1.0 + 1.2.0 MutationHotspotsDetection - 1.1.0 + 1.2.0 jar UTF-8 @@ -19,7 +19,12 @@ org.biojava biojava-core - 4.0.0 + 5.0.2 + + + org.biojava + biojava-structure + 5.0.2 org.apache.commons @@ -36,11 +41,6 @@ commons-lang 2.4 - - org.biojava - biojava-structure - 4.2.0 - org.genomenexus genomenexus-g2s-client @@ -63,6 +63,11 @@ commons-io 2.4 + + com.fasterxml.jackson.core + jackson-databind + 2.9.5 + diff --git a/MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/impl/ProteinStructureHotspotDetective.java b/MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/impl/ProteinStructureHotspotDetective.java index 65a1683..9d9f472 100644 --- a/MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/impl/ProteinStructureHotspotDetective.java +++ b/MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/impl/ProteinStructureHotspotDetective.java @@ -25,7 +25,8 @@ import org.cbioportal.mutationhotspots.mutationhotspotsdetection.stat.DetectedInDecoy; import org.cbioportal.mutationhotspots.mutationhotspotsdetection.stat.StructureHotspotDetectedInDecoy; import org.cbioportal.mutationhotspots.mutationhotspotsdetection.ContactMap; -import org.cbioportal.mutationhotspots.mutationhotspotsdetection.utils.ProteinStructureUtils; +import org.cbioportal.mutationhotspots.mutationhotspotsdetection.utils.structure.ContactMapFromPDB; +import org.cbioportal.mutationhotspots.mutationhotspotsdetection.utils.structure.ProteinStructureContactMapCalculator; /** @@ -54,15 +55,18 @@ protected Set processSingleHotspotsOnAProtein(MutatedProtein protein, int[] counts = getMutationCountsOnProtein(mapResidueHotspot, protein.getLength()); Map,Set> mapResiduesHotspots3D = new HashMap<>(); - Map contactMaps = ProteinStructureUtils.getInstance().getContactMaps(protein, + Map contactMaps = ProteinStructureContactMapCalculator.getPDBCalculator().getContactMaps(protein, parameters.getIdentpThresholdFor3DHotspots(), parameters.getDistanceClosestAtomsThresholdFor3DHotspots()); + contactMaps.putAll(ProteinStructureContactMapCalculator.getSwissModelCalculator().getContactMaps(protein, + parameters.getIdentpThresholdFor3DHotspots(), parameters.getDistanceClosestAtomsThresholdFor3DHotspots())); + int i = 0; for (Map.Entry entryContactMaps : contactMaps.entrySet()) { MutatedProtein3D protein3D = entryContactMaps.getKey(); ContactMap contactMap = entryContactMaps.getValue(); if (contactMap.getProteinRight()>protein.getLength()) { - System.err.println("\tMapped Protein resisue longer than protein length."); + System.err.println("\tMapped Protein residue longer than protein length."); continue; } diff --git a/MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/ProteinStructureUtils.java b/MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/structure/ContactMapFromPDB.java similarity index 95% rename from MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/ProteinStructureUtils.java rename to MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/structure/ContactMapFromPDB.java index 3dd77ce..f545586 100644 --- a/MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/ProteinStructureUtils.java +++ b/MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/structure/ContactMapFromPDB.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package org.cbioportal.mutationhotspots.mutationhotspotsdetection.utils; +package org.cbioportal.mutationhotspots.mutationhotspotsdetection.utils.structure; import org.cbioportal.mutationhotspots.mutationhotspotsdetection.ContactMap; import java.util.ArrayList; @@ -29,7 +29,6 @@ import org.cbioportal.mutationhotspots.mutationhotspotsdetection.MutatedProtein3D; import org.cbioportal.mutationhotspots.mutationhotspotsdetection.impl.MutatedProtein3DImpl; import org.genomenexus.g2s.client.ApiException; -import org.genomenexus.g2s.client.api.GetAlignmentsApi; import org.genomenexus.g2s.client.api.GetResidueMappingApi; import org.genomenexus.g2s.client.model.Alignment; import org.genomenexus.g2s.client.model.ResidueMapping; @@ -38,16 +37,11 @@ * * @author jgao */ -public final class ProteinStructureUtils { - private static final ProteinStructureUtils instance = new ProteinStructureUtils(); - public static ProteinStructureUtils getInstance() { - return instance; - } +public class ContactMapFromPDB implements ProteinStructureContactMapCalculator { - private final GetAlignmentsApi g2sGetAlignmentsApi; private final GetResidueMappingApi g2sGetResidueMappingApi; - private ProteinStructureUtils() { + ContactMapFromPDB() { AtomCache atomCache = new AtomCache(); // if (dirPdbCache!=null) { // atomCache.setCachePath(dirPdbCache); @@ -58,10 +52,10 @@ private ProteinStructureUtils() { atomCache.setFileParsingParams(params); StructureIO.setAtomCache(atomCache); - g2sGetAlignmentsApi = new GetAlignmentsApi(); g2sGetResidueMappingApi = new GetResidueMappingApi(); } + @Override public Map getContactMaps(MutatedProtein mutatedProtein, double identpThreshold, double distanceThresholdClosestAtoms) { Map contactMaps = new HashMap<>(); diff --git a/MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/structure/ContactMapFromSwissModel.java b/MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/structure/ContactMapFromSwissModel.java new file mode 100644 index 0000000..f4ca00b --- /dev/null +++ b/MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/structure/ContactMapFromSwissModel.java @@ -0,0 +1,226 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.cbioportal.mutationhotspots.mutationhotspotsdetection.utils.structure; + +import com.fasterxml.jackson.databind.JsonNode; +import org.cbioportal.mutationhotspots.mutationhotspotsdetection.ContactMap; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.biojava.nbio.structure.Atom; +import org.biojava.nbio.structure.Chain; +import org.biojava.nbio.structure.Group; +import org.biojava.nbio.structure.Structure; +import org.biojava.nbio.structure.StructureIO; +import org.biojava.nbio.structure.StructureTools; +import org.biojava.nbio.structure.contact.AtomContact; +import org.biojava.nbio.structure.contact.AtomContactSet; +import org.biojava.nbio.structure.contact.Pair; +import org.cbioportal.mutationhotspots.mutationhotspotsdetection.MutatedProtein; +import org.cbioportal.mutationhotspots.mutationhotspotsdetection.MutatedProtein3D; +import org.cbioportal.mutationhotspots.mutationhotspotsdetection.impl.MutatedProtein3DImpl; +import org.genomenexus.g2s.client.model.Alignment; +import org.genomenexus.g2s.client.model.ResidueMapping; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.IOException; +import java.net.URL; +import java.util.logging.Level; +import java.util.logging.Logger; +import org.biojava.nbio.structure.io.PDBFileReader; + +/** + * + * @author jgao + */ +public class ContactMapFromSwissModel implements ProteinStructureContactMapCalculator { + + ContactMapFromSwissModel() { + + } + + @Override + public Map getContactMaps(MutatedProtein mutatedProtein, + double identpThreshold, double distanceThresholdClosestAtoms) { + Map contactMaps = new HashMap<>(); + + String uniprotAcc = mutatedProtein.getUniprotAcc(); + if (uniprotAcc == null) { + return Collections.emptyMap(); + } + + List> structures = readSwissModel(uniprotAcc); + for (Map structure : structures) { + Object obj = structure.get("identity"); + if (obj != null) { + double identity = Double.class.cast(obj); + if (identity < identpThreshold) { + continue; + } + } // if identity not available, still process + + obj = structure.get("template"); + if (obj == null) { + continue; + } + String[] template = String.class.cast(obj).split("\\."); + String pdbId = template[0]; + String chain = template[2]; + + obj = structure.get("coordinates"); + if (obj == null) { + continue; + } + String structureUrl = String.class.cast(obj); + + obj = structure.get("from"); + if (obj == null) { + continue; + } + int from = Integer.class.cast(obj); + + obj = structure.get("to"); + if (obj == null) { + continue; + } + int to = Integer.class.cast(obj); + + MutatedProtein3DImpl protein3D = new MutatedProtein3DImpl(mutatedProtein); + protein3D.setPdbId("swissmodel:"+pdbId); + protein3D.setPdbChain(chain); + + Map> pdbContactMap = getPdbContactMap(structureUrl, distanceThresholdClosestAtoms); + + ContactMap contactMap = getContactMap(pdbContactMap, from, to, mutatedProtein.getLength()); + + contactMaps.put(protein3D, contactMap); + } + + return contactMaps; + } + + private List> readSwissModel(String uniprotAcc) { + List> ret = new ArrayList<>(); + + ObjectMapper mapper = new ObjectMapper(); + + JsonNode root; + try { + URL url = new URL("https://swissmodel.expasy.org/repository/uniprot/"+uniprotAcc+".json?provider=swissmodel"); + root = mapper.readTree(url); + } catch (IOException ex) { + Logger.getLogger(ContactMapFromSwissModel.class.getName()).log(Level.SEVERE, null, ex); + return Collections.emptyList(); + } + + JsonNode structuresNode = root.get("result").get("structures"); + Iterator it = structuresNode.elements(); + while (it.hasNext()) { + JsonNode strucNode = it.next(); + Map map = mapper.convertValue(strucNode, Map.class); + ret.add(map); + } + + return ret; + } + + private ContactMap getContactMap(Map> pdbContactMap, + int start, int end, int proteinLength) { + ContactMap contactMap = new ContactMap(proteinLength); + contactMap.setProteinLeft(start); + contactMap.setProteinRight(end); + + boolean[][] matrix = contactMap.getContact(); + + for (Map.Entry> entryPdbContactMap : pdbContactMap.entrySet()) { + int pdbPos = entryPdbContactMap.getKey(); + + Set pdbNeighbors = entryPdbContactMap.getValue(); + if (pdbNeighbors.isEmpty()) { + continue; + } + + for (Integer pdbNeighbor : pdbNeighbors) { + matrix[pdbPos][pdbNeighbor] = true; + matrix[pdbNeighbor][pdbPos] = true; + } + } + + return contactMap; + } + + private Map> getPdbContactMap(String strUrl, double distanceThreashold) { + Map> map = new HashMap<>(); + try { + PDBFileReader reader = new PDBFileReader(); + URL url = new URL(strUrl); + Structure structure = reader.getStructure(url.openStream()); + Chain chain = structure.getChainByIndex(0); + AtomContactSet contacts = StructureTools.getAtomsInContact(chain, distanceThreashold); + + Iterator it = contacts.iterator(); + while (it.hasNext()) { + AtomContact atomContact = it.next(); + Pair atoms = atomContact.getPair(); + Group group1 = atoms.getFirst().getGroup(); + Group group2 = atoms.getSecond().getGroup(); + if (!group1.hasAminoAtoms() || !group2.hasAminoAtoms() || group1==group2) { + continue; + } + + Integer res1 = group1.getResidueNumber().getSeqNum(); + Integer res2 = group2.getResidueNumber().getSeqNum(); + + Set neighbors = map.get(res1); + if (neighbors == null) { + neighbors = new HashSet<>(); + map.put(res1, neighbors); + } + + neighbors.add(res2); + + // we don't add res1 to the neighbors of res2, so it's not a complete map + } + } catch (Exception e) { + e.printStackTrace(); + System.err.println("Unable to calculate contact map for "+strUrl); + } + + return map; + } + + private OneToOneMap getPdbSeqResidueMapping(List alignments) { + Collections.sort(alignments, (Alignment align1, Alignment align2) -> { + int ret = align1.getEvalue().compareTo(align2.getEvalue()); // sort from small evalue to large evalue + if (ret == 0) { + ret = -align1.getIdentity().compareTo(align2.getIdentity()); + } + return ret; + }); + + OneToOneMap map = new OneToOneMap(); + + for (Alignment alignment : alignments) { + List residueMapping = alignment.getResidueMapping(); + + for (ResidueMapping r : residueMapping) { + if (!r.getQueryAminoAcid().equals(r.getPdbAminoAcid())) { + continue; + } + + Integer iseq = r.getQueryPosition(); + Integer ipdb = r.getPdbPosition(); + + map.put(ipdb, iseq); + } + } + return map; + } +} diff --git a/MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/OneToOneMap.java b/MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/structure/OneToOneMap.java similarity index 99% rename from MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/OneToOneMap.java rename to MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/structure/OneToOneMap.java index bfec54b..59d7b8f 100644 --- a/MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/OneToOneMap.java +++ b/MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/structure/OneToOneMap.java @@ -3,7 +3,7 @@ * To change this template file, choose Tools | Templates * and open the template in the editor. */ -package org.cbioportal.mutationhotspots.mutationhotspotsdetection.utils; +package org.cbioportal.mutationhotspots.mutationhotspotsdetection.utils.structure; import java.util.Collection; import java.util.Collections; diff --git a/MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/structure/ProteinStructureContactMapCalculator.java b/MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/structure/ProteinStructureContactMapCalculator.java new file mode 100644 index 0000000..49f86ca --- /dev/null +++ b/MutationHotspotsDetection/src/main/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/structure/ProteinStructureContactMapCalculator.java @@ -0,0 +1,30 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.cbioportal.mutationhotspots.mutationhotspotsdetection.utils.structure; + +import java.util.Map; +import org.cbioportal.mutationhotspots.mutationhotspotsdetection.ContactMap; +import org.cbioportal.mutationhotspots.mutationhotspotsdetection.MutatedProtein; +import org.cbioportal.mutationhotspots.mutationhotspotsdetection.MutatedProtein3D; + +/** + * + * @author jgao + */ +public interface ProteinStructureContactMapCalculator { + static final ProteinStructureContactMapCalculator pdbCalculator = new ContactMapFromPDB(); + public static ProteinStructureContactMapCalculator getPDBCalculator() { + return pdbCalculator; + } + + static final ProteinStructureContactMapCalculator swissModelCalculator = new ContactMapFromSwissModel(); + public static ProteinStructureContactMapCalculator getSwissModelCalculator() { + return swissModelCalculator; + } + + Map getContactMaps(MutatedProtein mutatedProtein, double identpThreshold, double distanceThresholdClosestAtoms); + +} diff --git a/MutationHotspotsDetection/src/test/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/ProteinStructureUtilsTest.java b/MutationHotspotsDetection/src/test/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/ProteinStructureUtilsTest.java deleted file mode 100644 index a44ad46..0000000 --- a/MutationHotspotsDetection/src/test/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/ProteinStructureUtilsTest.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * To change this license header, choose License Headers in Project Properties. - * To change this template file, choose Tools | Templates - * and open the template in the editor. - */ -package org.cbioportal.mutationhotspots.mutationhotspotsdetection.utils; - -import org.cbioportal.mutationhotspots.mutationhotspotsdetection.ContactMap; -import java.util.Map; -import org.cbioportal.mutationhotspots.mutationhotspotsdetection.MutatedProtein; -import org.cbioportal.mutationhotspots.mutationhotspotsdetection.MutatedProtein3D; -import org.cbioportal.mutationhotspots.mutationhotspotsdetection.impl.MutatedProteinImpl; -import org.cbioportal.mutationhotspots.mutationhotspotsdetection.impl.ProteinImpl; -import org.junit.After; -import org.junit.AfterClass; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * - * @author jgao - */ -public class ProteinStructureUtilsTest { - - public ProteinStructureUtilsTest() { - } - - @BeforeClass - public static void setUpClass() { - } - - @AfterClass - public static void tearDownClass() { - } - - @Before - public void setUp() { - } - - @After - public void tearDown() { - } - - /** - * Test of getContactMaps method, of class ProteinStructureUtils. - */ - @Test - public void testGetContactMaps() { - System.out.println("getContactMaps"); - -// String dirPdbCache = "/Users/jgao/projects/cbio-portal-data/reference-data/pdb-cache"; - ProteinStructureUtils instance = ProteinStructureUtils.getInstance(); - - MutatedProtein mutatedProtein = new MutatedProteinImpl(); - mutatedProtein.setGeneSymbol("MAP2K1"); - mutatedProtein.setProteinId("ENSP00000302486.4"); - mutatedProtein.setLength(393); -// mutatedProtein.setSequence( "MPKKKPTPIQLNPAPDGSAVNGTSSAETNLEALQKKLEELELDEQQRKRLEAFLTQKQKV\n" + -// "GELKDDDFEKISELGAGNGGVVFKVSHKPSGLVMARKLIHLEIKPAIRNQIIRELQVLHE\n" + -// "CNSPYIVGFYGAFYSDGEISICMEHMDGGSLDQVLKKAGRIPEQILGKVSIAVIKGLTYL\n" + -// "REKHKIMHRDVKPSNILVNSRGEIKLCDFGVSGQLIDSMANSFVGTRSYMSPERLQGTHY\n" + -// "SVQSDIWSMGLSLVEMAVGRYPIPPPDAKELELMFGCQVEGDAAETPPRPRTPGRPLSSY\n" + -// "GMDSRPPMAIFELLDYIVNEPPPKLPSGVFSLEFQDFVNKCLIKNPAERADLKQLMVHAF\n" + -// "IKRSDAEEVDFAGWLCSTIGLNQPSTPTHAAGV"); - double identpThreshold = 90; - double distanceThresholdClosestAtoms = 5.0; - -// Map expResult = null; - Map result = instance.getContactMaps(mutatedProtein, identpThreshold, distanceThresholdClosestAtoms); -// assertEquals(expResult, result); - System.out.println("done"); - } - -} diff --git a/MutationHotspotsDetection/src/test/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/structure/ProteinStructureContactMapCalculatorTest.java b/MutationHotspotsDetection/src/test/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/structure/ProteinStructureContactMapCalculatorTest.java new file mode 100644 index 0000000..948411d --- /dev/null +++ b/MutationHotspotsDetection/src/test/java/org/cbioportal/mutationhotspots/mutationhotspotsdetection/utils/structure/ProteinStructureContactMapCalculatorTest.java @@ -0,0 +1,95 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package org.cbioportal.mutationhotspots.mutationhotspotsdetection.utils.structure; + +import java.util.ArrayList; +import java.util.List; +import org.cbioportal.mutationhotspots.mutationhotspotsdetection.ContactMap; +import java.util.Map; +import org.cbioportal.mutationhotspots.mutationhotspotsdetection.MutatedProtein; +import org.cbioportal.mutationhotspots.mutationhotspotsdetection.MutatedProtein3D; +import org.cbioportal.mutationhotspots.mutationhotspotsdetection.impl.MutatedProteinImpl; +import org.junit.After; +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * + * @author jgao + */ +public class ProteinStructureContactMapCalculatorTest { + + private List proteins; + + public ProteinStructureContactMapCalculatorTest() { + } + + @BeforeClass + public static void setUpClass() { + } + + @AfterClass + public static void tearDownClass() { + } + + @Before + public void setUp() { + proteins = new ArrayList<>(); + + MutatedProtein mutatedProtein; + + mutatedProtein = new MutatedProteinImpl(); + mutatedProtein.setGeneSymbol("AKT1"); + mutatedProtein.setProteinId("ENSP00000270202.4"); + mutatedProtein.setUniprotAcc("P31749"); + mutatedProtein.setLength(480); + proteins.add(mutatedProtein); + + mutatedProtein = new MutatedProteinImpl(); + mutatedProtein.setGeneSymbol("MAP2K1"); + mutatedProtein.setProteinId("ENSP00000302486.4"); + mutatedProtein.setUniprotAcc("Q02750"); + mutatedProtein.setLength(393); + proteins.add(mutatedProtein); + } + + @After + public void tearDown() { + } + + //@Test + public void testGetContactMapsFromPDB() { + System.out.println("getContactMapsPDB"); + + ProteinStructureContactMapCalculator instance = ProteinStructureContactMapCalculator.getPDBCalculator(); + double identpThreshold = 90; + double distanceThresholdClosestAtoms = 5.0; + + proteins.forEach(mutatedProtein -> { + Map result = instance.getContactMaps(mutatedProtein, identpThreshold, distanceThresholdClosestAtoms); + }); + + System.out.println("done"); + } + + @Test + public void testGetContactMapsFromSwissModel() { + System.out.println("getContactMapsFromSwissModel"); + + ProteinStructureContactMapCalculator instance = ProteinStructureContactMapCalculator.getSwissModelCalculator(); + double identpThreshold = 90; + double distanceThresholdClosestAtoms = 5.0; + + proteins.forEach(mutatedProtein -> { + Map result = instance.getContactMaps(mutatedProtein, identpThreshold, distanceThresholdClosestAtoms); + }); + + System.out.println("done"); + } + +} diff --git a/README.md b/README.md index d27c428..2b61f87 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Binary JAR file is available in [releases](https://github.com/knowledgesystems/m ## Usage -`java -jar MutationHotspotsDetection-1.1.0.jar ` +`java -jar MutationHotspotsDetection-1.2.0.jar ` Here is [an example input MAF file](https://github.com/knowledgesystems/mutationhotspots/blob/1.0.1/MutationHotspotsDetection/src/main/resources/data/example.maf) diff --git a/pom.xml b/pom.xml index 82c33de..66792ee 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ master pom MutationHotspots Master - 1.1.0 + 1.2.0 master maven module https://github.com/cBioPortal/mutationhotspots/