Skip to content

Commit bb563fa

Browse files
authored
Merge branch 'master' into master
2 parents 6e1c12d + dbdc477 commit bb563fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+4611
-119
lines changed

biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test/PDBFileParserTest.java

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import java.io.IOException;
3333
import java.io.InputStream;
3434
import java.io.StringReader;
35-
3635
import org.biojava.nbio.structure.Atom;
3736
import org.biojava.nbio.structure.Chain;
3837
import org.biojava.nbio.structure.ChainImpl;
@@ -50,6 +49,12 @@
5049
import org.junit.Before;
5150
import org.junit.Test;
5251

52+
/**
53+
* Test the {@link PDBFileParser}.
54+
*
55+
* @author Aleix Lafita
56+
*
57+
*/
5358
public class PDBFileParserTest {
5459

5560
private static PDBFileParser parser;
@@ -555,8 +560,6 @@ public void testCorrectAtomNamePadding() throws IOException {
555560

556561
/**
557562
* Test handling of missing Element column. Issue 537 in github.
558-
* @author Aleix Lafita
559-
* @throws IOException
560563
*/
561564
@Test
562565
public void testMissingElements() throws IOException {
@@ -627,4 +630,28 @@ public void testMissingElements() throws IOException {
627630
assertTrue("the Element column has not been filled correctly", pdb.equals(original));
628631

629632
}
633+
634+
/**
635+
* Test the parsing of release and last modified dates.
636+
*/
637+
@Test
638+
public void testDates() throws IOException {
639+
640+
String revisionDates =
641+
"REVDAT 5 13-JUL-11 1STP 1 VERSN "+newline+
642+
"REVDAT 4 24-FEB-09 1STP 1 VERSN " + newline+
643+
"REVDAT 3 01-APR-03 1STP 1 JRNL " + newline+
644+
"REVDAT 2 15-OCT-94 1STP 1 AUTHOR " + newline+
645+
"REVDAT 1 15-OCT-92 1STP 0 " + newline;
646+
647+
BufferedReader br = new BufferedReader(new StringReader(revisionDates));
648+
Structure s = parser.parsePDBFile(br);
649+
650+
// The latest modified date should be 2011
651+
assertEquals(s.getPDBHeader().getModDate().getYear() + 1900, 2011);
652+
653+
// The release date should be 1992
654+
assertEquals(s.getPDBHeader().getRelDate().getYear() + 1900, 1992);
655+
656+
}
630657
}

biojava-integrationtest/src/test/java/org/biojava/nbio/structure/test/io/StructureIOTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
*/
2121
package org.biojava.nbio.structure.test.io;
2222

23-
2423
import static org.junit.Assert.*;
2524

2625
import java.io.IOException;
@@ -29,15 +28,16 @@
2928
import org.biojava.nbio.structure.StructureIO;
3029
import org.junit.Test;
3130

32-
33-
31+
/**
32+
* Test StructureIO methods.
33+
*
34+
*/
3435
public class StructureIOTest {
3536

3637
@Test
3738
public void testStructureIO() throws IOException, StructureException {
3839

3940
String pdbId = "1gav";
40-
4141
int nrAssembls = StructureIO.getBiologicalAssemblies(pdbId).size();
4242
assertEquals(1,nrAssembls);
4343

biojava-structure/src/main/java/org/biojava/nbio/structure/AminoAcidImpl.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
*/
2424
package org.biojava.nbio.structure;
2525

26-
import java.io.Serializable;
27-
2826
/**
2927
* AminoAcid inherits most from Hetatom. Adds a few AminoAcid
3028
* specific methods.
@@ -34,7 +32,7 @@
3432
* @version %I% %G%
3533
*
3634
*/
37-
public class AminoAcidImpl extends HetatomImpl implements AminoAcid, Serializable {
35+
public class AminoAcidImpl extends HetatomImpl implements AminoAcid {
3836

3937
private static final long serialVersionUID = -6018854413829044230L;
4038

biojava-structure/src/main/java/org/biojava/nbio/structure/AtomImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
import org.biojava.nbio.structure.io.FileConvert;
2727

28-
import java.io.Serializable;
2928
import java.util.ArrayList;
3029
import java.util.List;
3130

@@ -39,7 +38,7 @@
3938
* @since 1.4
4039
* @version %I% %G%
4140
*/
42-
public class AtomImpl implements Atom, Serializable, PDBRecord {
41+
public class AtomImpl implements Atom {
4342

4443
private static final long serialVersionUID = -2258364127420562883L;
4544

biojava-structure/src/main/java/org/biojava/nbio/structure/Bond.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@
2020
*/
2121
package org.biojava.nbio.structure;
2222

23+
import java.io.Serializable;
24+
2325
/**
2426
* A simple bond -- it stores information about two atoms as well as information
2527
* about its bond order.
2628
*
2729
* @author Jules Jacobsen <jacobsen@ebi.ac.uk>
2830
* @author Ulysse Carion
2931
*/
30-
public interface Bond {
32+
public interface Bond extends Serializable {
3133

3234
/**
3335
* Gets atom 'A' of this bond. There is no meaning to which atom is 'A' and

biojava-structure/src/main/java/org/biojava/nbio/structure/BondImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
*/
2121
package org.biojava.nbio.structure;
2222

23-
import java.io.Serializable;
2423
import java.util.ArrayList;
2524
import java.util.List;
2625

@@ -31,7 +30,7 @@
3130
* @author Jules Jacobsen <jacobsen@ebi.ac.uk>
3231
* @author Ulysse Carion
3332
*/
34-
public class BondImpl implements Serializable, Bond {
33+
public class BondImpl implements Bond {
3534

3635
private static final long serialVersionUID = 8836120946858134380L;
3736
private Atom atomA;

biojava-structure/src/main/java/org/biojava/nbio/structure/Chain.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.biojava.nbio.structure.io.FileParsingParameters;
2828
import org.biojava.nbio.structure.io.mmcif.model.ChemComp;
2929

30+
import java.io.Serializable;
3031
import java.util.List;
3132

3233
/**
@@ -48,7 +49,7 @@
4849
* @version %I% %G%
4950
* @since 1.4
5051
*/
51-
public interface Chain {
52+
public interface Chain extends Serializable {
5253

5354
/** returns an identical copy of this Chain.
5455
* @return an identical copy of this Chain

biojava-structure/src/main/java/org/biojava/nbio/structure/ChainImpl.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
import org.slf4j.Logger;
3636
import org.slf4j.LoggerFactory;
3737

38-
import java.io.Serializable;
3938
import java.util.*;
4039

4140

@@ -47,7 +46,7 @@
4746
* @author Jules Jacobsen
4847
* @since 1.4
4948
*/
50-
public class ChainImpl implements Chain, Serializable {
49+
public class ChainImpl implements Chain {
5150

5251
private final static Logger logger = LoggerFactory.getLogger(ChainImpl.class);
5352

@@ -712,7 +711,7 @@ public boolean isWaterOnly() {
712711
public boolean isPureNonPolymer() {
713712
for (Group g : getAtomGroups()) {
714713

715-
ChemComp cc = g.getChemComp();
714+
//ChemComp cc = g.getChemComp();
716715

717716
if ( g.isPolymeric() &&
718717
!g.isHetAtomInFile() ) {

biojava-structure/src/main/java/org/biojava/nbio/structure/DBRef.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.slf4j.Logger;
2626
import org.slf4j.LoggerFactory;
2727

28-
import java.io.Serializable;
2928
import java.lang.reflect.Method;
3029
import java.util.Formatter;
3130
import java.util.Locale;
@@ -38,7 +37,7 @@
3837
* @since 4:56:14 PM
3938
* @version %I% %G%
4039
*/
41-
public class DBRef implements PDBRecord, Serializable{
40+
public class DBRef implements PDBRecord {
4241

4342
private final static Logger logger = LoggerFactory.getLogger(DBRef.class);
4443

biojava-structure/src/main/java/org/biojava/nbio/structure/Element.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
*/
2323
package org.biojava.nbio.structure;
2424

25-
import java.io.Serializable;
2625
import java.util.HashMap;
2726
import java.util.Map;
2827

@@ -40,7 +39,7 @@
4039
*
4140
*/
4241

43-
public enum Element implements Serializable {
42+
public enum Element {
4443

4544
// most frequently used elements first
4645
H(1, 1, 39, 1.10f, 0.32f, 1, 1, 1, 1, 1, 1.008f, 0, 1, new int[] {1}, 2.20f, ElementType.OTHER_NONMETAL),

0 commit comments

Comments
 (0)