Skip to content

Commit 7f160ef

Browse files
committed
Merge branch 'master' into issue929
2 parents 00f1633 + 3e83b5b commit 7f160ef

8 files changed

Lines changed: 26 additions & 76 deletions

File tree

biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test/scop/TestParsingScopDomainPDB.java

Lines changed: 0 additions & 56 deletions
This file was deleted.

biojava-modfinder/src/test/java/org/biojava/nbio/protmod/phosphosite/TestAcetylation.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.biojava.nbio.phosphosite.Dataset;
2525
import org.biojava.nbio.phosphosite.Site;
2626
import org.junit.Before;
27+
import org.junit.Ignore;
2728
import org.junit.Test;
2829

2930
import java.io.File;
@@ -91,6 +92,7 @@ private File getLocalFileName(String phosphoSiteFileLocation){
9192
* Tests that the acetylation file can get parsed without problems.
9293
*
9394
*/
95+
@Ignore("The file needed from the phosphosite resource is no longer available. See #975")
9496
@Test
9597
public void testAcetylation() throws IOException {
9698

biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterface.java

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,9 @@ public StructureInterface(
113113
this.moleculeIds = new Pair<>(firstMoleculeId,secondMoleculeId);
114114
this.contacts = contacts;
115115
this.transforms = new Pair<>(firstTransf, secondTransf);
116+
117+
this.groupAsas1 = new TreeMap<>();
118+
this.groupAsas2 = new TreeMap<>();
116119
}
117120

118121
/**
@@ -290,12 +293,8 @@ protected Atom[] getAtomsForAsa(int cofactorSizeToUse) {
290293
Atom[] atoms2 = getSecondAtomsForAsa(cofactorSizeToUse);
291294

292295
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);
299298

300299
return atoms;
301300
}
@@ -326,7 +325,7 @@ private static Atom[] getAllNonHAtomArray(Atom[] m, int minSizeHetAtomToInclude)
326325
atoms.add(a);
327326

328327
}
329-
return atoms.toArray(new Atom[atoms.size()]);
328+
return atoms.toArray(new Atom[0]);
330329
}
331330

332331
/**
@@ -425,11 +424,11 @@ public void setFirstGroupAsa(GroupAsa groupAsa) {
425424
groupAsas1.put(groupAsa.getGroup().getResidueNumber(), groupAsa);
426425
}
427426

428-
void setFirstGroupAsas(Map<ResidueNumber, GroupAsa> firstGroupAsas) {
427+
public void setFirstGroupAsas(Map<ResidueNumber, GroupAsa> firstGroupAsas) {
429428
this.groupAsas1 = firstGroupAsas;
430429
}
431430

432-
void setSecondGroupAsas(Map<ResidueNumber, GroupAsa> secondGroupAsas) {
431+
public void setSecondGroupAsas(Map<ResidueNumber, GroupAsa> secondGroupAsas) {
433432
this.groupAsas2 = secondGroupAsas;
434433
}
435434

@@ -587,8 +586,8 @@ public void setCluster(StructureInterfaceCluster cluster) {
587586
}
588587

589588
/**
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
592591
* will not necessarily make sense if the two interfaces come from different structures.
593592
* The two sides of the given StructureInterface need to match this StructureInterface
594593
* in the sense that they must come from the same Entity, i.e.

biojava-structure/src/main/java/org/biojava/nbio/structure/contact/StructureInterfaceList.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,7 @@ public List<StructureInterfaceCluster> getClusters() {
365365

366366
/**
367367
* 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.
369369
* Subsequent calls will use the cached value without recomputing the clusters.
370370
* The clusters will be assigned ids by sorting descending by {@link StructureInterfaceCluster#getTotalArea()}
371371
* @param contactOverlapScoreClusterCutoff the contact overlap score above which a pair will be
@@ -382,6 +382,7 @@ public List<StructureInterfaceCluster> getClusters(double contactOverlapScoreClu
382382
// nothing to do if we have no interfaces
383383
if (list.size()==0) return clusters;
384384

385+
logger.debug("Calculating all-vs-all Jaccard scores for {} interfaces", list.size());
385386
double[][] matrix = new double[list.size()][list.size()];
386387

387388
for (int i=0;i<list.size();i++) {
@@ -399,6 +400,7 @@ public List<StructureInterfaceCluster> getClusters(double contactOverlapScoreClu
399400

400401
}
401402

403+
logger.debug("Will now cluster {} interfaces based on full all-vs-all Jaccard scores matrix", list.size());
402404
SingleLinkageClusterer slc = new SingleLinkageClusterer(matrix, true);
403405

404406
Map<Integer, Set<Integer>> clusteredIndices = slc.getClusters(contactOverlapScoreClusterCutoff);
@@ -434,11 +436,11 @@ public List<StructureInterfaceCluster> getClusters(double contactOverlapScoreClu
434436
interf.setCluster(cluster);
435437
}
436438
}
439+
logger.debug("Done clustering {} interfaces based on full all-vs-all Jaccard scores matrix. Found a total of {} clusters", list.size(), clusters.size());
437440

438441
// 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+
442444
int id = 1;
443445
for (StructureInterfaceCluster cluster:clusters) {
444446
cluster.setId(id);

biojava-structure/src/main/java/org/biojava/nbio/structure/scop/ScopFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ public class ScopFactory {
5151
private static final Logger logger = LoggerFactory.getLogger(ScopFactory.class);
5252

5353
// berkeley 2
54+
public static final String VERSION_2_0_8 = "2.08";
5455
public static final String VERSION_2_0_7 = "2.07";
5556
public static final String VERSION_2_0_6 = "2.06";
5657
public static final String VERSION_2_0_5 = "2.05";
@@ -78,7 +79,7 @@ public class ScopFactory {
7879
public static final String VERSION_1_55 = "1.55";
7980

8081
// 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;
8283

8384
// Hold one instance for each version
8485
private static Map<String,ScopDatabase> versionedScopDBs = new HashMap<>();

biojava-structure/src/main/java/org/biojava/nbio/structure/scop/ScopInstallation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
*/
5959
public class ScopInstallation implements LocalScopDatabase {
6060

61-
public static final String DEFAULT_VERSION = "1.75";
61+
public static final String DEFAULT_VERSION = ScopFactory.LATEST_VERSION;
6262

6363
private static final Logger logger = LoggerFactory.getLogger(ScopInstallation.class);
6464

@@ -354,7 +354,7 @@ public ScopDomain getDomainByScopID(String scopId) {
354354
if ( scopId.length() < 6) {
355355
throw new ScopIOException("Does not look like a scop ID! " + scopId);
356356
}
357-
String pdbId = scopId.substring(1,5);
357+
String pdbId = scopId.substring(1,5); //TODO handle this when you handle extended PDBId (PDB ID)
358358
List<ScopDomain> doms = getDomainsForPDB(pdbId);
359359
if ( doms == null)
360360
return null;

biojava-structure/src/test/java/org/biojava/nbio/structure/align/util/AtomCacheTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
import org.biojava.nbio.structure.test.util.GlobalsHelper;
6565
import org.junit.After;
6666
import org.junit.Before;
67+
import org.junit.Ignore;
6768
import org.junit.Test;
6869
import org.slf4j.Logger;
6970
import org.slf4j.LoggerFactory;
@@ -88,7 +89,7 @@ public void setUp() {
8889
StructureIO.setAtomCache(cache);
8990

9091
// Use a fixed SCOP version for stability
91-
ScopFactory.setScopDatabase(ScopFactory.VERSION_1_75B);
92+
ScopFactory.setScopDatabase(ScopFactory.LATEST_VERSION);
9293
}
9394

9495
@After
@@ -166,6 +167,7 @@ public void testGetStructureForDomain3() throws IOException, StructureException
166167
* @throws IOException
167168
* @throws StructureException
168169
*/
170+
@Ignore("SCOP files < 2.08 are no longer available")
169171
@Test
170172
public void testGetStructureForChainlessDomains() throws IOException, StructureException {
171173
ScopDatabase scop = ScopFactory.getSCOP(ScopFactory.VERSION_1_71); // Uses the range '1-135' without a chain

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@
457457
<dependency>
458458
<groupId>org.biojava.thirdparty</groupId>
459459
<artifactId>forester</artifactId>
460-
<version>1.038</version>
460+
<version>1.039</version>
461461
</dependency>
462462
<dependency>
463463
<groupId>javax.xml.bind</groupId>

0 commit comments

Comments
 (0)