Skip to content

Commit 14c6a55

Browse files
author
Hernan Morales
committed
Add BioDatabases, BioOntology and Features Viewer
BioPathway enhacements.
1 parent c40850b commit 14c6a55

38 files changed

Lines changed: 8381 additions & 20 deletions

repository/BaselineOfBioSmalltalk/BaselineOfBioSmalltalk.class.st

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@ BaselineOfBioSmalltalk >> baselineTestsGroup: spec [
248248
'BioClassifierTests'
249249
"'BioProjectTests'"
250250
'BioArlequin-Tests'
251-
'BioSummarizedExperiment-Tests' )
251+
'BioSummarizedExperiment-Tests'
252+
'BioPlots-Tests' )
252253
]
253254

254255
{ #category : 'baselines' }
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
Class {
2+
#name : 'BioDatabasesTest',
3+
#superclass : 'BioAbstractTest',
4+
#category : 'BioDatabases-Tests',
5+
#package : 'BioDatabases-Tests'
6+
}
7+
8+
{ #category : 'tests' }
9+
BioDatabasesTest >> testAddAndRemoveDatabase [ | db testDB | db := BioDatabases new. testDB := BioDatabase type: #tertiary category: 'Test' name: 'TestDB' description: 'Test'. db addDatabase: testDB. self assert: db size equals: 1. db removeDatabase: testDB. self assert: db size equals: 0
10+
]
11+
12+
{ #category : 'tests' }
13+
BioDatabasesTest >> testAllDatabases [ | db | db := BioDatabases withAllDatabases. self assert: db size > 300. self assert: db size = 654
14+
]
15+
16+
{ #category : 'tests' }
17+
BioDatabasesTest >> testBioDatabaseCreation [ | db | db := BioDatabase type: #primary category: 'Test' name: 'TestDB' description: 'A test database'. self assert: db type equals: #primary. self assert: db category equals: 'Test'. self assert: db name equals: 'TestDB'. self assert: db description equals: 'A test database'. self assert: db url isNil. self assert: db status isNil
18+
]
19+
20+
{ #category : 'tests' }
21+
BioDatabasesTest >> testBioDatabasePrintOn [ | db str | db := BioDatabase type: #primary category: 'Test' name: 'MyDB' description: 'Desc'. str := String streamContents: [ :s | db printOn: s ]. self assert: (str includesSubstring: 'MyDB')
22+
]
23+
24+
{ #category : 'tests' }
25+
BioDatabasesTest >> testCategories [ | db | db := BioDatabases withAllDatabases. self assert: db categories size >= 30. self assert: (db categories includes: 'Protein'). self assert: (db categories includes: 'Immunogenetics')
26+
]
27+
28+
{ #category : 'tests' }
29+
BioDatabasesTest >> testCategorySelectors [ | sels | sels := BioDatabases categorySelectors. self assert: sels size >= 30. self assert: (sels includes: #proteinDatabases). self assert: (sels includes: #immunogeneticsDatabases). self deny: (sels includes: #allDatabases)
30+
]
31+
32+
{ #category : 'tests' }
33+
BioDatabasesTest >> testDatabaseUrls [ "All databases should have a URL." | db | db := BioDatabases withAllDatabases. db databases do: [ :d | self assert: d url notNil. self assert: d url notEmpty ]
34+
]
35+
36+
{ #category : 'tests' }
37+
BioDatabasesTest >> testFilterByCategories [ | db | db := BioDatabases withAllDatabases. self assert: (db byCategories: #('Protein' 'RNA')) size >= 40. self assert: (db byCategories: #('Nonexistent')) size = 0
38+
]
39+
40+
{ #category : 'tests' }
41+
BioDatabasesTest >> testFilterByCategory [ | db | db := BioDatabases withAllDatabases. self assert: (db byCategory: 'Protein') size >= 25. self assert: (db byCategory: 'RNA') size >= 15. self assert: (db byCategory: 'Nonexistent') size = 0
42+
]
43+
44+
{ #category : 'tests' }
45+
BioDatabasesTest >> testFilterByType [ | db | db := BioDatabases withAllDatabases. self assert: (db byType: #primary) size > 400. self assert: (db byType: #secondary) size > 100. self assert: (db byType: #tertiary) size = 0
46+
]
47+
48+
{ #category : 'tests' }
49+
BioDatabasesTest >> testFilterByTypes [ | db | db := BioDatabases withAllDatabases. self assert: ((db byTypes: #(primary secondary)) size) = db size. self assert: (db byTypes: #(tertiary)) size = 0
50+
]
51+
52+
{ #category : 'tests' }
53+
BioDatabasesTest >> testPrimaryDatabases [ | db | db := BioDatabases withPrimaryDatabases. self assert: db size > 400. self assert: (db databases allSatisfy: [ :d | d type = #primary ])
54+
]
55+
56+
{ #category : 'tests' }
57+
BioDatabasesTest >> testSearchByKeyword [ | db | db := BioDatabases withAllDatabases. self assert: (db searchKeyword: 'malaria') size >= 1. self assert: (db searchKeyword: 'Malaria') size >= 1. self assert: (db searchKeyword: 'nonexistent') size = 0
58+
]
59+
60+
{ #category : 'tests' }
61+
BioDatabasesTest >> testSearchByName [ | db | db := BioDatabases withAllDatabases. self assert: (db searchName: 'PDB') size >= 1. self assert: (db byName: 'PDB') size >= 1. self assert: (db searchName: 'zzzzzzzzzzz') size = 0
62+
]
63+
64+
{ #category : 'tests' }
65+
BioDatabasesTest >> testSecondaryDatabases [ | db | db := BioDatabases withSecondaryDatabases. self assert: db size > 100. self assert: (db databases allSatisfy: [ :d | d type = #secondary ])
66+
]
67+
68+
{ #category : 'tests' }
69+
BioDatabasesTest >> testTypes [ | db | db := BioDatabases withAllDatabases. self assert: (db types includes: #primary). self assert: (db types includes: #secondary)
70+
]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Package { #name : 'BioDatabases-Tests' }
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
Class {
2+
#name : 'BioDatabase',
3+
#superclass : 'Object',
4+
#instVars : [
5+
'type',
6+
'category',
7+
'name',
8+
'description',
9+
'url',
10+
'status'
11+
],
12+
#category : 'BioDatabases',
13+
#package : 'BioDatabases'
14+
}
15+
16+
{ #category : 'as yet unclassified' }
17+
BioDatabase class >> type: aType category: aCat name: aName description: aDesc [
18+
19+
^ self new
20+
type: aType;
21+
category: aCat;
22+
name: aName;
23+
description: aDesc;
24+
yourself
25+
]
26+
27+
{ #category : 'as yet unclassified' }
28+
BioDatabase class >> type: aType category: aCat name: aName description: aDesc url: aUrl [ ^ self new type: aType; category: aCat; name: aName; description: aDesc; url: aUrl; yourself
29+
]
30+
31+
{ #category : 'accessing' }
32+
BioDatabase >> category [
33+
34+
^ category
35+
]
36+
37+
{ #category : 'accessing' }
38+
BioDatabase >> category: aString [
39+
40+
category := aString
41+
]
42+
43+
{ #category : 'accessing' }
44+
BioDatabase >> description [
45+
46+
^ description
47+
]
48+
49+
{ #category : 'accessing' }
50+
BioDatabase >> description: aString [
51+
52+
description := aString
53+
]
54+
55+
{ #category : 'accessing' }
56+
BioDatabase >> name [
57+
58+
^ name
59+
]
60+
61+
{ #category : 'accessing' }
62+
BioDatabase >> name: aString [
63+
64+
name := aString
65+
]
66+
67+
{ #category : 'printing' }
68+
BioDatabase >> printOn: aStream [
69+
70+
super printOn: aStream.
71+
aStream nextPutAll: ' ('.
72+
name ifNotNil: [ aStream nextPutAll: name ].
73+
aStream nextPutAll: ')'
74+
]
75+
76+
{ #category : 'accessing' }
77+
BioDatabase >> status [ ^ status
78+
]
79+
80+
{ #category : 'accessing' }
81+
BioDatabase >> status: anObject [
82+
83+
status := anObject
84+
]
85+
86+
{ #category : 'accessing' }
87+
BioDatabase >> type [
88+
89+
^ type
90+
]
91+
92+
{ #category : 'accessing' }
93+
BioDatabase >> type: aSymbol [
94+
95+
type := aSymbol
96+
]
97+
98+
{ #category : 'accessing' }
99+
BioDatabase >> url [
100+
101+
^ url
102+
]
103+
104+
{ #category : 'accessing' }
105+
BioDatabase >> url: aString [
106+
107+
url := aString
108+
]

0 commit comments

Comments
 (0)