GeezerVison is showing github.com — Merge branch 'master' into issue929 · biojava/biojava@7f160ef
File treeExpand file treeCollapse file tree Open diff view settings biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test/scop biojava-modfinder/src/test/java/org/biojava/nbio/protmod/phosphosite main/java/org/biojava/nbio/structure test/java/org/biojava/nbio/structure/align/util
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test/scop/TestParsingScopDomainPDB.java -56Lines changed: 0 additions & 56 deletions Collapse file Copy file name to clipboardExpand all lines: biojava-modfinder/src/test/java/org/biojava/nbio/protmod/phosphosite/TestAcetylation.java +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 24 | 24 | import org.biojava.nbio.phosphosite.Dataset; | 25 | 25 | import org.biojava.nbio.phosphosite.Site; | 26 | 26 | import org.junit.Before; | | 27 | +import org.junit.Ignore; | 27 | 28 | import org.junit.Test; | 28 | 29 |
| 29 | 30 | import java.io.File; | @@ -91,6 +92,7 @@ private File getLocalFileName(String phosphoSiteFileLocation){ | 91 | 92 | * Tests that the acetylation file can get parsed without problems. | 92 | 93 | * | 93 | 94 | */ | | 95 | + @Ignore("The file needed from the phosphosite resource is no longer available. See #975") | 94 | 96 | @Test | 95 | 97 | public void testAcetylation() throws IOException { | 96 | 98 |
| |
Collapse file Copy file name to clipboardExpand all lines: biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterface.java +10-11Lines changed: 10 additions & 11 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -113,6 +113,9 @@ public StructureInterface( | 113 | 113 | this.moleculeIds = new Pair<>(firstMoleculeId,secondMoleculeId); | 114 | 114 | this.contacts = contacts; | 115 | 115 | this.transforms = new Pair<>(firstTransf, secondTransf); | | 116 | + | | 117 | + this.groupAsas1 = new TreeMap<>(); | | 118 | + this.groupAsas2 = new TreeMap<>(); | 116 | 119 | } | 117 | 120 |
| 118 | 121 | /** | @@ -290,12 +293,8 @@ protected Atom[] getAtomsForAsa(int cofactorSizeToUse) { | 290 | 293 | Atom[] atoms2 = getSecondAtomsForAsa(cofactorSizeToUse); | 291 | 294 |
| 292 | 295 | Atom[] atoms = new Atom[atoms1.length+atoms2.length]; | 293 | | - for (int i=0;i<atoms1.length;i++) { | 294 | | - atoms[i] = atoms1[i]; | 295 | | - } | 296 | | - for (int i=0;i<atoms2.length;i++) { | 297 | | - atoms[i+atoms1.length] = atoms2[i]; | 298 | | - } | | 296 | + System.arraycopy(atoms1, 0, atoms, 0, atoms1.length); | | 297 | + System.arraycopy(atoms2, 0, atoms, atoms1.length, atoms2.length); | 299 | 298 |
| 300 | 299 | return atoms; | 301 | 300 | } | @@ -326,7 +325,7 @@ private static Atom[] getAllNonHAtomArray(Atom[] m, int minSizeHetAtomToInclude) | 326 | 325 | atoms.add(a); | 327 | 326 |
| 328 | 327 | } | 329 | | - return atoms.toArray(new Atom[atoms.size()]); | | 328 | + return atoms.toArray(new Atom[0]); | 330 | 329 | } | 331 | 330 |
| 332 | 331 | /** | @@ -425,11 +424,11 @@ public void setFirstGroupAsa(GroupAsa groupAsa) { | 425 | 424 | groupAsas1.put(groupAsa.getGroup().getResidueNumber(), groupAsa); | 426 | 425 | } | 427 | 426 |
| 428 | | - void setFirstGroupAsas(Map<ResidueNumber, GroupAsa> firstGroupAsas) { | | 427 | + public void setFirstGroupAsas(Map<ResidueNumber, GroupAsa> firstGroupAsas) { | 429 | 428 | this.groupAsas1 = firstGroupAsas; | 430 | 429 | } | 431 | 430 |
| 432 | | - void setSecondGroupAsas(Map<ResidueNumber, GroupAsa> secondGroupAsas) { | | 431 | + public void setSecondGroupAsas(Map<ResidueNumber, GroupAsa> secondGroupAsas) { | 433 | 432 | this.groupAsas2 = secondGroupAsas; | 434 | 433 | } | 435 | 434 |
| @@ -587,8 +586,8 @@ public void setCluster(StructureInterfaceCluster cluster) { | 587 | 586 | } | 588 | 587 |
| 589 | 588 | /** | 590 | | - * Calculates the contact overlap score between this StructureInterface and | 591 | | - * the given one. The calculation assumes that both interfaces come from the same structure. The ouput | | 589 | + * Calculates the Jaccard contact set score (intersection over union) between this StructureInterface and | | 590 | + * the given one. The calculation assumes that both interfaces come from the same structure. The output | 592 | 591 | * will not necessarily make sense if the two interfaces come from different structures. | 593 | 592 | * The two sides of the given StructureInterface need to match this StructureInterface | 594 | 593 | * in the sense that they must come from the same Entity, i.e. | |
Collapse file Copy file name to clipboardExpand all lines: biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterfaceList.java +6-4Lines changed: 6 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -365,7 +365,7 @@ public List<StructureInterfaceCluster> getClusters() { | 365 | 365 |
| 366 | 366 | /** | 367 | 367 | * Calculate the interface clusters for this StructureInterfaceList | 368 | | - * using a contact overlap score to measure the similarity of interfaces. | | 368 | + * using Jaccard contact set scores to measure the similarity of interfaces. | 369 | 369 | * Subsequent calls will use the cached value without recomputing the clusters. | 370 | 370 | * The clusters will be assigned ids by sorting descending by {@link StructureInterfaceCluster#getTotalArea()} | 371 | 371 | * @param contactOverlapScoreClusterCutoff the contact overlap score above which a pair will be | @@ -382,6 +382,7 @@ public List<StructureInterfaceCluster> getClusters(double contactOverlapScoreClu | 382 | 382 | // nothing to do if we have no interfaces | 383 | 383 | if (list.size()==0) return clusters; | 384 | 384 |
| | 385 | + logger.debug("Calculating all-vs-all Jaccard scores for {} interfaces", list.size()); | 385 | 386 | double[][] matrix = new double[list.size()][list.size()]; | 386 | 387 |
| 387 | 388 | for (int i=0;i<list.size();i++) { | @@ -399,6 +400,7 @@ public List<StructureInterfaceCluster> getClusters(double contactOverlapScoreClu | 399 | 400 |
| 400 | 401 | } | 401 | 402 |
| | 403 | + logger.debug("Will now cluster {} interfaces based on full all-vs-all Jaccard scores matrix", list.size()); | 402 | 404 | SingleLinkageClusterer slc = new SingleLinkageClusterer(matrix, true); | 403 | 405 |
| 404 | 406 | Map<Integer, Set<Integer>> clusteredIndices = slc.getClusters(contactOverlapScoreClusterCutoff); | @@ -434,11 +436,11 @@ public List<StructureInterfaceCluster> getClusters(double contactOverlapScoreClu | 434 | 436 | interf.setCluster(cluster); | 435 | 437 | } | 436 | 438 | } | | 439 | + logger.debug("Done clustering {} interfaces based on full all-vs-all Jaccard scores matrix. Found a total of {} clusters", list.size(), clusters.size()); | 437 | 440 |
| 438 | 441 | // now we sort by areas (descending) and assign ids based on that sorting | 439 | | - clusters.sort((o1, o2) -> { | 440 | | - return Double.compare(o2.getTotalArea(), o1.getTotalArea()); //note we invert so that sorting is descending | 441 | | - }); | | 442 | + clusters.sort((o1, o2) -> Double.compare(o2.getTotalArea(), o1.getTotalArea())); //note we invert so that sorting is descending | | 443 | + | 442 | 444 | int id = 1; | 443 | 445 | for (StructureInterfaceCluster cluster:clusters) { | 444 | 446 | cluster.setId(id); | |
Collapse file Copy file name to clipboardExpand all lines: biojava-structure/src/main/java/org/biojava/nbio/structure/scop/ScopFactory.java +2-1Lines changed: 2 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -51,6 +51,7 @@ public class ScopFactory { | 51 | 51 | private static final Logger logger = LoggerFactory.getLogger(ScopFactory.class); | 52 | 52 |
| 53 | 53 | // berkeley 2 | | 54 | + public static final String VERSION_2_0_8 = "2.08"; | 54 | 55 | public static final String VERSION_2_0_7 = "2.07"; | 55 | 56 | public static final String VERSION_2_0_6 = "2.06"; | 56 | 57 | public static final String VERSION_2_0_5 = "2.05"; | @@ -78,7 +79,7 @@ public class ScopFactory { | 78 | 79 | public static final String VERSION_1_55 = "1.55"; | 79 | 80 |
| 80 | 81 | // The most recent version as of compilation time | 81 | | - public static final String LATEST_VERSION = VERSION_2_0_7; | | 82 | + public static final String LATEST_VERSION = VERSION_2_0_8; | 82 | 83 |
| 83 | 84 | // Hold one instance for each version | 84 | 85 | private static Map<String,ScopDatabase> versionedScopDBs = new HashMap<>(); | |
Collapse file Copy file name to clipboardExpand all lines: biojava-structure/src/main/java/org/biojava/nbio/structure/scop/ScopInstallation.java +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 58 | 58 | */ | 59 | 59 | public class ScopInstallation implements LocalScopDatabase { | 60 | 60 |
| 61 | | - public static final String DEFAULT_VERSION = "1.75"; | | 61 | + public static final String DEFAULT_VERSION = ScopFactory.LATEST_VERSION; | 62 | 62 |
| 63 | 63 | private static final Logger logger = LoggerFactory.getLogger(ScopInstallation.class); | 64 | 64 |
| @@ -354,7 +354,7 @@ public ScopDomain getDomainByScopID(String scopId) { | 354 | 354 | if ( scopId.length() < 6) { | 355 | 355 | throw new ScopIOException("Does not look like a scop ID! " + scopId); | 356 | 356 | } | 357 | | - String pdbId = scopId.substring(1,5); | | 357 | + String pdbId = scopId.substring(1,5); //TODO handle this when you handle extended PDBId (PDB ID) | 358 | 358 | List<ScopDomain> doms = getDomainsForPDB(pdbId); | 359 | 359 | if ( doms == null) | 360 | 360 | return null; | |
Collapse file Copy file name to clipboardExpand all lines: biojava-structure/src/test/java/org/biojava/nbio/structure/align/util/AtomCacheTest.java +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 64 | 64 | import org.biojava.nbio.structure.test.util.GlobalsHelper; | 65 | 65 | import org.junit.After; | 66 | 66 | import org.junit.Before; | | 67 | +import org.junit.Ignore; | 67 | 68 | import org.junit.Test; | 68 | 69 | import org.slf4j.Logger; | 69 | 70 | import org.slf4j.LoggerFactory; | @@ -88,7 +89,7 @@ public void setUp() { | 88 | 89 | StructureIO.setAtomCache(cache); | 89 | 90 |
| 90 | 91 | // Use a fixed SCOP version for stability | 91 | | - ScopFactory.setScopDatabase(ScopFactory.VERSION_1_75B); | | 92 | + ScopFactory.setScopDatabase(ScopFactory.LATEST_VERSION); | 92 | 93 | } | 93 | 94 |
| 94 | 95 | @After | @@ -166,6 +167,7 @@ public void testGetStructureForDomain3() throws IOException, StructureException | 166 | 167 | * @throws IOException | 167 | 168 | * @throws StructureException | 168 | 169 | */ | | 170 | + @Ignore("SCOP files < 2.08 are no longer available") | 169 | 171 | @Test | 170 | 172 | public void testGetStructureForChainlessDomains() throws IOException, StructureException { | 171 | 173 | ScopDatabase scop = ScopFactory.getSCOP(ScopFactory.VERSION_1_71); // Uses the range '1-135' without a chain | |
Collapse file Copy file name to clipboardExpand all lines: pom.xml +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 457 | 457 | <dependency> | 458 | 458 | <groupId>org.biojava.thirdparty</groupId> | 459 | 459 | <artifactId>forester</artifactId> | 460 | | - <version>1.038</version> | | 460 | + <version>1.039</version> | 461 | 461 | </dependency> | 462 | 462 | <dependency> | 463 | 463 | <groupId>javax.xml.bind</groupId> | |
|