Skip to content

Commit 016ff70

Browse files
committed
minor refactor
1 parent a32f209 commit 016ff70

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

‎biojava-ontology/src/main/java/org/biojava/nbio/ontology/obo/OboFileHandler.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ else if (key.equals(NAME)){
153153
// ignore obsolete Terms...
154154
//logger.info("obsolete: {}", currentTerm);
155155
Annotation anno = currentTerm.getAnnotation();
156-
anno.setProperty(IS_OBSOLETE, new Boolean(true));
156+
anno.setProperty(IS_OBSOLETE, Boolean.TRUE);
157157

158158
} else if (key.equals(IS_A) ||
159159
key.equals(RELATIONSHIP) ||

‎biojava-ontology/src/test/java/org/biojava/nbio/ontology/TestParseOBO.java‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
import org.biojava.nbio.ontology.io.OboParser;
2626
import org.biojava.nbio.ontology.utils.Annotation;
27-
import org.junit.Before;
2827
import org.junit.Test;
2928

3029
import java.io.*;
@@ -42,13 +41,16 @@ public class TestParseOBO {
4241

4342
private OboParser parser;
4443

45-
final String testTermEntry = "\n[Term]\n" + "id: SO:0000691\n" + "name: cleaved_initiator_methionine \n"
46-
+ "namespace: sequence\n" + "alt_id: BS:00067\n"
44+
final String testTermEntry = "\n[Term]\n"
45+
+ "id: SO:0000691\n"
46+
+ "name: cleaved_initiator_methionine \n"
47+
+ "namespace: sequence\n"
48+
+ "alt_id: BS:00067\n"
4749
+ "def: \"The initiator methionine that has been cleaved from a mature polypeptide sequence.\" [EBIBS:GAR]\n"
48-
+ "subset: biosapiens\n" + "synonym: \"cleaved initiator methionine\" EXACT []\n"
50+
+ "subset: biosapiens\n"
51+
+ "synonym: \"cleaved initiator methionine\" EXACT []\n"
4952
+ "synonym: \"init_met\" RELATED [uniprot:feature_type]\n"
5053
+ "synonym: \"initiator methionine\" RELATED []\n" + "is_a: SO:0100011 ! cleaved_peptide_region\n\n";
51-
private String replace;
5254

5355
public Ontology readObo(String input) throws ParseException, IOException {
5456
parser = new OboParser();
@@ -62,20 +64,19 @@ public Ontology readObo(String input) throws ParseException, IOException {
6264
@Test
6365
public void testNamespace() throws IOException, ParseException {
6466
Ontology ontology = readObo(testTermEntry);
65-
6667
Set<Term> keys = ontology.getTerms();
67-
6868
assertTrue(keys.size() > 1);
6969
assertTrue(getAnnotationForTerm(ontology).containsProperty(NAMESPACE));
7070
assertEquals("sequence", getAnnotationForTerm(ontology).getProperty(NAMESPACE));
71+
//#964
7172
assertTrue(getAnnotationForTerm(ontology).getProperty(ALT_ID) instanceof List);
7273
}
7374

7475
@Test
7576
public void testMultipleAltIds() throws IOException, ParseException {
7677

77-
String replace = testTermEntry.replace("BS:00067", "BS:00067\nalt_id: BS:00068");
78-
Ontology ontology = readObo(replace);
78+
String oboWith2AltIds = testTermEntry.replace("BS:00067", "BS:00067\nalt_id: BS:00068");
79+
Ontology ontology = readObo(oboWith2AltIds);
7980
List<String> altIds = (List<String>) getAnnotationForTerm(ontology).getProperty(ALT_ID);
8081
assertEquals(2, altIds.size());
8182
assertEquals("BS:00067", altIds.get(0));

0 commit comments

Comments
 (0)