trackler 2.0.8.3 → 2.0.8.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/tracks/go/config.json +5 -2
- data/tracks/go/exercises/strain/example.go +2 -0
- data/tracks/go/exercises/strain/strain_test.go +8 -0
- data/tracks/idris/config.json +8 -0
- data/tracks/idris/exercises/hamming/Hamming.ipkg +5 -0
- data/tracks/idris/exercises/hamming/Makefile +23 -0
- data/tracks/idris/exercises/hamming/src/Hamming.idr +10 -0
- data/tracks/idris/exercises/hamming/src/Test/Hamming.idr +66 -0
- data/tracks/idris/exercises/hamming/src/example.idr +19 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 057df974f1cb8cbe89eb10ab81dc89e9eac54905
|
4
|
+
data.tar.gz: cfef594bcbd45d09c177baec8bfaa6faf2cfa83d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43581a5b366c4c07936515ed2ce716d4c6e358dc96f1eafb5b26bc89a75d5624d3e69e864a38497e83d88719bf881536cd42b8f4c07320cdb754285c4895df9b
|
7
|
+
data.tar.gz: 9177f3b84ea412493fe66da72d52b774c474a738091441293a843321fa7316c67160735ec893719a28127995c0b544e46be5dec38407f8cc67a14f3cd0c5fdae
|
data/lib/trackler/version.rb
CHANGED
data/tracks/go/config.json
CHANGED
@@ -19,6 +19,14 @@ import (
|
|
19
19
|
"testing"
|
20
20
|
)
|
21
21
|
|
22
|
+
const targetTestVersion = 1
|
23
|
+
|
24
|
+
func TestTestVersion(t *testing.T) {
|
25
|
+
if testVersion != targetTestVersion {
|
26
|
+
t.Fatalf("Found testVersion = %v, want %v", testVersion, targetTestVersion)
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
22
30
|
func lt10(x int) bool { return x < 10 }
|
23
31
|
func gt10(x int) bool { return x > 10 }
|
24
32
|
func odd(x int) bool { return x&1 == 1 }
|
data/tracks/idris/config.json
CHANGED
@@ -0,0 +1,23 @@
|
|
1
|
+
idris ?= idris
|
2
|
+
pkg := Hamming
|
3
|
+
|
4
|
+
.PHONY: build clean clobber install rebuild test
|
5
|
+
|
6
|
+
all: build
|
7
|
+
|
8
|
+
build:
|
9
|
+
@ ${idris} --build ${pkg}.ipkg
|
10
|
+
|
11
|
+
clean:
|
12
|
+
@ ${idris} --clean ${pkg}.ipkg
|
13
|
+
|
14
|
+
clobber: clean
|
15
|
+
@ find . -name '*.ibc' -delete
|
16
|
+
|
17
|
+
install:
|
18
|
+
@ ${idris} --install ${pkg}.ipkg
|
19
|
+
|
20
|
+
rebuild: clean build
|
21
|
+
|
22
|
+
test:
|
23
|
+
@ ${idris} --testpkg ${pkg}.ipkg
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module Hamming
|
2
|
+
|
3
|
+
import Data.Vect
|
4
|
+
|
5
|
+
-- Add the correct export modifier here...
|
6
|
+
data Nucleotide -- insert definition here
|
7
|
+
|
8
|
+
-- Add the correct export modifier here...
|
9
|
+
hamming_distance : Vect n Nucleotide -> Vect n Nucleotide -> Nat
|
10
|
+
hamming_distance s1 s2 = ?hamming_distance_rhs
|
@@ -0,0 +1,66 @@
|
|
1
|
+
module Test.Hamming
|
2
|
+
|
3
|
+
import Data.Vect
|
4
|
+
import Hamming
|
5
|
+
|
6
|
+
%access export
|
7
|
+
|
8
|
+
assertEq : Eq a => (given : a) -> (expected : a) -> IO ()
|
9
|
+
assertEq g e = putStrLn $ if g == e then "Test Passed" else "Test Failed"
|
10
|
+
|
11
|
+
testIdenticalStrands : IO ()
|
12
|
+
testIdenticalStrands = assertEq (hamming_distance [A] [A]) 0
|
13
|
+
|
14
|
+
testLongIdenticalStrands : IO ()
|
15
|
+
testLongIdenticalStrands = assertEq (hamming_distance [G,G,A,C,T,G,A] [G,G,A,C,T,G,A]) 0
|
16
|
+
|
17
|
+
testDifferentSingleNucleotideStrands : IO ()
|
18
|
+
testDifferentSingleNucleotideStrands = assertEq (hamming_distance [A] [G]) 1
|
19
|
+
|
20
|
+
testMaximumDistanceInSmallNucleotideStrands : IO ()
|
21
|
+
testMaximumDistanceInSmallNucleotideStrands = assertEq (hamming_distance [A,G] [C,T]) 2
|
22
|
+
|
23
|
+
testSmallDifferenceInSmallNucleotideStrands : IO ()
|
24
|
+
testSmallDifferenceInSmallNucleotideStrands = assertEq (hamming_distance [A,T] [C,T]) 1
|
25
|
+
|
26
|
+
testSmallDistance : IO ()
|
27
|
+
testSmallDistance = assertEq (hamming_distance [G,G,A,C,G] [G,G,T,C,G]) 1
|
28
|
+
|
29
|
+
testSmallDistanceInLongStrands : IO ()
|
30
|
+
testSmallDistanceInLongStrands = assertEq (hamming_distance [A,C,C,A,G,G,G] [A,C,T,A,T,G,G]) 2
|
31
|
+
|
32
|
+
testNonUniqueCharacterInFirstStrand : IO ()
|
33
|
+
testNonUniqueCharacterInFirstStrand = assertEq (hamming_distance [A,G,A] [A,G,G]) 1
|
34
|
+
|
35
|
+
testNonUniqueCharacterInSecondStrand : IO ()
|
36
|
+
testNonUniqueCharacterInSecondStrand = assertEq (hamming_distance [A,G,G] [A,G,A]) 1
|
37
|
+
|
38
|
+
testSameNucleotidesInDifferentPositions : IO ()
|
39
|
+
testSameNucleotidesInDifferentPositions = assertEq (hamming_distance [T,A,G] [G,A,T]) 2
|
40
|
+
|
41
|
+
testLargeDistance : IO ()
|
42
|
+
testLargeDistance = assertEq (hamming_distance [G,A,T,A,C,A] [G,C,A,T,A,A]) 4
|
43
|
+
|
44
|
+
testLargeDistanceInOffByOneStrand : IO ()
|
45
|
+
testLargeDistanceInOffByOneStrand = assertEq (hamming_distance [G,G,A,C,G,G,A,T,T,C,T,G] [A,G,G,A,C,G,G,A,T,T,C,T]) 9
|
46
|
+
|
47
|
+
testEmptyStrands : IO ()
|
48
|
+
testEmptyStrands =
|
49
|
+
let empty = the (Vect _ Nucleotide) [] in
|
50
|
+
assertEq (hamming_distance empty empty) 0
|
51
|
+
|
52
|
+
runTests : IO ()
|
53
|
+
runTests = do
|
54
|
+
testIdenticalStrands
|
55
|
+
testLongIdenticalStrands
|
56
|
+
testDifferentSingleNucleotideStrands
|
57
|
+
testMaximumDistanceInSmallNucleotideStrands
|
58
|
+
testSmallDifferenceInSmallNucleotideStrands
|
59
|
+
testSmallDistance
|
60
|
+
testSmallDistanceInLongStrands
|
61
|
+
testNonUniqueCharacterInFirstStrand
|
62
|
+
testNonUniqueCharacterInSecondStrand
|
63
|
+
testSameNucleotidesInDifferentPositions
|
64
|
+
testLargeDistance
|
65
|
+
testLargeDistanceInOffByOneStrand
|
66
|
+
testEmptyStrands
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Hamming
|
2
|
+
|
3
|
+
import Data.Vect
|
4
|
+
|
5
|
+
public export
|
6
|
+
data Nucleotide = A | C | G | T
|
7
|
+
|
8
|
+
public export
|
9
|
+
implementation Eq Nucleotide where
|
10
|
+
A == A = True
|
11
|
+
C == C = True
|
12
|
+
G == G = True
|
13
|
+
T == T = True
|
14
|
+
_ == _ = False
|
15
|
+
|
16
|
+
export
|
17
|
+
hamming_distance : Eq a => Vect n a -> Vect n a -> Nat
|
18
|
+
hamming_distance s1 s2 =
|
19
|
+
fst $ filter ((/=) 0) $ map (\(n1,n2) => if n1 == n2 then 0 else 1) $ zip s1 s2
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trackler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.8.
|
4
|
+
version: 2.0.8.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katrina Owen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -3823,6 +3823,11 @@ files:
|
|
3823
3823
|
- tracks/idris/docs/RESOURCES.md
|
3824
3824
|
- tracks/idris/docs/TESTS.md
|
3825
3825
|
- tracks/idris/exercises/.keep
|
3826
|
+
- tracks/idris/exercises/hamming/Hamming.ipkg
|
3827
|
+
- tracks/idris/exercises/hamming/Makefile
|
3828
|
+
- tracks/idris/exercises/hamming/src/Hamming.idr
|
3829
|
+
- tracks/idris/exercises/hamming/src/Test/Hamming.idr
|
3830
|
+
- tracks/idris/exercises/hamming/src/example.idr
|
3826
3831
|
- tracks/idris/exercises/hello-world/HelloWorld.ipkg
|
3827
3832
|
- tracks/idris/exercises/hello-world/Makefile
|
3828
3833
|
- tracks/idris/exercises/hello-world/src/Test/HelloWorld.idr
|