Skip to content

Commit 6253f10

Browse files
authored
Add full frequency table for every possible k-mer (named integer vector or matrix with all 4^k entries). Similar to Biostrings (oligonucleotideFrequency family). (#7)
Add #gtoolkit baseline spec.
1 parent 2d75c68 commit 6253f10

5 files changed

Lines changed: 317 additions & 62 deletions

File tree

repository/BaselineOfBioSmalltalk/BaselineOfBioSmalltalk.class.st

Lines changed: 42 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,31 @@ Class {
2020

2121
{ #category : 'baselines' }
2222
BaselineOfBioSmalltalk >> baseline: spec [
23-
<baseline>
2423

25-
spec for: #'common' do: [
26-
spec blessing: #'baseline'.
27-
28-
spec preLoadDoIt: #preLoad.
29-
spec postLoadDoIt: #'postLoad'.
30-
31-
self
32-
projectSpecForCommonUtils: spec;
33-
projectSpecForDataDrameInspector: spec;
34-
"projectSpecForProjectFramework: spec;"
35-
projectSpecForStringExtensions: spec;
36-
projectSpecForFileDialog: spec;
37-
projectSpecForPolyMath: spec;
38-
projectSpecForDataFrame: spec;
39-
projectSpecForINIParser: spec;
40-
projectSpecForPetitParser: spec;
41-
projectSpecForNeedlemanWunsch: spec.
24+
<baseline>
25+
spec for: #common do: [
26+
spec blessing: #baseline.
27+
28+
spec preLoadDoIt: #preLoad.
29+
spec postLoadDoIt: #postLoad.
30+
31+
self
32+
projectSpecForCommonUtils: spec;
33+
projectSpecForDataDrameInspector: spec;
34+
"projectSpecForProjectFramework: spec;"
35+
projectSpecForStringExtensions: spec;
36+
projectSpecForFileDialog: spec;
37+
projectSpecForPolyMath: spec;
38+
projectSpecForDataFrame: spec;
39+
projectSpecForINIParser: spec;
40+
projectSpecForPetitParser: spec;
41+
projectSpecForNeedlemanWunsch: spec.
4242
"projectSpecForRoassal2: spec."
4343

44-
self baselineOSDeps: spec.
45-
self baselineCommonPackages: spec.
46-
self baselineGroups: spec ].
47-
48-
self baselinePharo: spec.
44+
self baselineCommonPackages: spec.
45+
self baselineGroups: spec ].
4946

47+
self baselinePharo: spec
5048
]
5149

5250
{ #category : 'groups' }
@@ -170,26 +168,34 @@ BaselineOfBioSmalltalk >> baselineOSDeps: spec [
170168
{ #category : 'baselines' }
171169
BaselineOfBioSmalltalk >> baselinePharo: spec [
172170

171+
spec for: #( #gtoolkit ) do: [
172+
self projectSpecForXMLPharo12: spec.
173+
self commonPackagesForPharo7onWards: spec ].
174+
173175
spec for: #( #'pharo4.x' #'pharo5.x' #'pharo6.x' ) do: [
174-
self projectSpecForXMLPharo7: spec.
175-
spec
176-
package: 'BioTools' with: [ spec includes: #( 'BioPharo4' ) ];
177-
package: 'BioPharo4' with: [ spec requires: #( 'BioTools' ) ];
178-
group: 'Basic' with: #( 'BioPharo4' ) ].
176+
self baselineOSDeps: spec.
177+
self projectSpecForXMLPharo7: spec.
178+
spec
179+
package: 'BioTools' with: [ spec includes: #( 'BioPharo4' ) ];
180+
package: 'BioPharo4' with: [ spec requires: #( 'BioTools' ) ];
181+
group: 'Basic' with: #( 'BioPharo4' ) ].
179182

180183
spec for: #'pharo7.x' do: [
181-
self projectSpecForXMLPharo7: spec.
182-
self commonPackagesForPharo7onWards: spec ].
184+
self baselineOSDeps: spec.
185+
self projectSpecForXMLPharo7: spec.
186+
self commonPackagesForPharo7onWards: spec ].
183187

184188
spec
185189
for: #( #'pharo8.x' #'pharo9.x' #'pharo10.x' #'pharo11.x' )
186190
do: [
187-
self projectSpecForXMLPharo8: spec.
188-
self commonPackagesForPharo7onWards: spec ].
189-
190-
spec for: #( #'pharo12.x' #'pharo13.x' #'pharo14.x') do: [
191-
self projectSpecForXMLPharo12: spec.
192-
self commonPackagesForPharo7onWards: spec ]
191+
self baselineOSDeps: spec.
192+
self projectSpecForXMLPharo8: spec.
193+
self commonPackagesForPharo7onWards: spec ].
194+
195+
spec for: #( #'pharo12.x' #'pharo13.x' #'pharo14.x' ) do: [
196+
self baselineOSDeps: spec.
197+
self projectSpecForXMLPharo12: spec.
198+
self commonPackagesForPharo7onWards: spec ]
193199
]
194200

195201
{ #category : 'baselines' }

repository/BioTools-Tests/BioAlphabetTest.class.st

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Class {
22
#name : 'BioAlphabetTest',
33
#superclass : 'BioAbstractTest',
4-
#category : 'BioTools-Tests-Alphabets',
5-
#package : 'BioTools-Tests',
6-
#tag : 'Alphabets',
74
#instVars : [
85
'alphabet'
9-
]
6+
],
7+
#category : 'BioTools-Tests-Alphabets',
8+
#package : 'BioTools-Tests',
9+
#tag : 'Alphabets'
1010
}
1111

1212
{ #category : 'testing' }

repository/BioTools-Tests/BioGenomicRangesTest.class.st

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,13 +223,15 @@ BioGenomicRangesTest >> testFromGFF [
223223

224224
{ #category : 'tests' }
225225
BioGenomicRangesTest >> testIRangesRejectNegativeWidth [
226-
self should: [ BioIRanges starts: #(5) ends: #(4) ] raise: Error
226+
227+
self should: [ BioIRanges starts: #( 5 ) ends: #( 4 ) ] raise: Error
227228
]
228229

229230
{ #category : 'tests' }
230231
BioGenomicRangesTest >> testIRangesWidth [
232+
231233
| ir |
232-
ir := BioIRanges starts: #(2 10) ends: #(4 12).
234+
ir := BioIRanges starts: #( 2 10 ) ends: #( 4 12 ).
233235
self assert: (ir width at: 1) equals: 3.
234236
self assert: (ir width at: 2) equals: 3
235237
]
@@ -251,27 +253,49 @@ BioGenomicRangesTest >> testMetadataCanContainObjects [
251253

252254
{ #category : 'tests' }
253255
BioGenomicRangesTest >> testOverlapWith [
256+
254257
| a b c |
255-
a := BioGenomicRanges seqnames: #('chr1' 'chr1') starts: #(1 50) ends: #(10 60) strands: #('+' '+') metadata: Dictionary new.
256-
b := BioGenomicRanges seqnames: #('chr1') starts: #(5) ends: #(15) strands: #('+') metadata: Dictionary new.
258+
a := BioGenomicRanges
259+
seqnames: #( 'chr1' 'chr1' )
260+
starts: #( 1 50 )
261+
ends: #( 10 60 )
262+
strands: #( '+' '+' )
263+
metadata: Dictionary new.
264+
b := BioGenomicRanges
265+
seqnames: #( 'chr1' )
266+
starts: #( 5 )
267+
ends: #( 15 )
268+
strands: #( '+' )
269+
metadata: Dictionary new.
257270
c := a overlapWith: b.
258271
self assert: c size equals: 1.
259272
self assert: (c start at: 1) equals: 1
260273
]
261274

262275
{ #category : 'tests' }
263276
BioGenomicRangesTest >> testReduceKeepsStrandSeparate [
277+
264278
| gr red |
265-
gr := BioGenomicRanges seqnames: #('chr1' 'chr1') starts: #(1 2) ends: #(5 6) strands: #('+' '-') metadata: Dictionary new.
279+
gr := BioGenomicRanges
280+
seqnames: #( 'chr1' 'chr1' )
281+
starts: #( 1 2 )
282+
ends: #( 5 6 )
283+
strands: #( '+' '-' )
284+
metadata: Dictionary new.
266285
red := gr reduce.
267286
self assert: red size equals: 2
268-
269287
]
270288

271289
{ #category : 'tests' }
272290
BioGenomicRangesTest >> testReduceMergesAdjacent [
291+
273292
| gr red |
274-
gr := BioGenomicRanges seqnames: #('chr1' 'chr1') starts: #(1 6) ends: #(5 10) strands: #('+' '+') metadata: Dictionary new.
293+
gr := BioGenomicRanges
294+
seqnames: #( 'chr1' 'chr1' )
295+
starts: #( 1 6 )
296+
ends: #( 5 10 )
297+
strands: #( '+' '+' )
298+
metadata: Dictionary new.
275299
red := gr reduce.
276300
self assert: red size equals: 1.
277301
self assert: (red start at: 1) equals: 1.

0 commit comments

Comments
 (0)