From 7f7b4af0edc187959d8ef6ed9ed41ad59493cc1f Mon Sep 17 00:00:00 2001 From: Graeme Vissers Date: Thu, 9 Jul 2020 17:55:16 -0700 Subject: [PATCH 1/9] add testCase 'isEqual' to BioArray testList --- tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs b/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs index 7e69e9e3..203d35a0 100644 --- a/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs +++ b/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs @@ -127,6 +127,12 @@ let bioCollectionsTests = "BioArray.translate did not translate the transcript correctly." ) + testCase "isEqual" (fun () -> + Expect.equal + (testTranscript |> BioArray.isEqual testTranscript) + 0 + "BioArray.isEqual did not return correct integer when transcripts were equal." + ) ] testList "BioList" [ From 3af73d660db674509e4fb8cd27ed06bdc2b3f04f Mon Sep 17 00:00:00 2001 From: Graeme Vissers Date: Sun, 12 Jul 2020 10:18:18 -0700 Subject: [PATCH 2/9] permission access for travis --- build.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 build.sh diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 From 6d5fba511f89f8b812cdbc40015911e99b45d34f Mon Sep 17 00:00:00 2001 From: Graeme Vissers Date: Sun, 12 Jul 2020 11:28:21 -0700 Subject: [PATCH 3/9] Add toString unit test for BioArray --- build.sh | 0 tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs | 7 +++++++ 2 files changed, 7 insertions(+) mode change 100755 => 100644 build.sh diff --git a/build.sh b/build.sh old mode 100755 new mode 100644 diff --git a/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs b/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs index 203d35a0..78740c98 100644 --- a/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs +++ b/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs @@ -133,6 +133,13 @@ let bioCollectionsTests = 0 "BioArray.isEqual did not return correct integer when transcripts were equal." ) + + testCase "toString" (fun () -> + Expect.equal + (aminoAcidSetArray |> BioArray.toString) + "ACDEFGHIKLMNOPQRSTUVWYXJZB" + "BioArray.toString did not return the correct string" + ) ] testList "BioList" [ From 3c49b37dde45f480e13aff495437416316efe9f8 Mon Sep 17 00:00:00 2001 From: Graeme Vissers Date: Sun, 12 Jul 2020 12:05:06 -0700 Subject: [PATCH 4/9] Add toMonoisotopicMass testCase to BioArray tests --- .../BioFSharp/BioCollections.fs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs b/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs index 78740c98..52ef3207 100644 --- a/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs +++ b/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs @@ -137,9 +137,18 @@ let bioCollectionsTests = testCase "toString" (fun () -> Expect.equal (aminoAcidSetArray |> BioArray.toString) - "ACDEFGHIKLMNOPQRSTUVWYXJZB" + "ACDEFGHIKLMNOPQRSTUVWYXJZB-*" "BioArray.toString did not return the correct string" ) + + testCase "toMonoisotopicMass" (fun () -> + Expect.floatClose + Accuracy.high + (testProt |> BioArray.toMonoisotopicMass) + // Masses obtained from University of Washington Proteomics Resource https://proteomicsresource.washington.edu/protocols06/masses.php + (131.04048 + 99.06841 + 113.08406) + "BioArray.toMonoisotopicMass did not return correct mass" + ) ] testList "BioList" [ From c921a851e0279a39f7ef56c229c5511c33a19a19 Mon Sep 17 00:00:00 2001 From: Graeme Vissers Date: Mon, 13 Jul 2020 10:41:35 -0700 Subject: [PATCH 5/9] Add toAverageMass unit test to BioArray testList --- .../BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs b/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs index 52ef3207..5fb088a8 100644 --- a/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs +++ b/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs @@ -149,6 +149,15 @@ let bioCollectionsTests = (131.04048 + 99.06841 + 113.08406) "BioArray.toMonoisotopicMass did not return correct mass" ) + + testCase "toAverageMass" (fun() -> + Expect.floatClose + Accuracy.medium // High accuracy was not passing test + (testProt |> BioArray.toAverageMass) + // Masses obtained from University of Washington Proteomics Resource https://proteomicsresource.washington.edu/protocols06/masses.php + (131.19606 + 99.13106 + 113.15764) + "BioArray.toAverageMass did not return correct mass" + ) ] testList "BioList" [ From bbfa8fd08e5d2d869b2a88d151f5ca16f0609b22 Mon Sep 17 00:00:00 2001 From: Graeme Vissers Date: Tue, 14 Jul 2020 13:14:41 -0700 Subject: [PATCH 6/9] add testCase toMonoisotopicMassWith --- .../BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs b/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs index 5fb088a8..4139dda1 100644 --- a/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs +++ b/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs @@ -158,6 +158,15 @@ let bioCollectionsTests = (131.19606 + 99.13106 + 113.15764) "BioArray.toAverageMass did not return correct mass" ) + + testCase "toMonoisotopicMassWith" (fun () -> + Expect.floatClose + Accuracy.high + (testProt |> BioArray.toMonoisotopicMassWith 18.0) // 18 = mass of one water molecule + // Masses obtained from University of Washington Proteomics Resource https://proteomicsresource.washington.edu/protocols06/masses.php + (131.04048 + 99.06841 + 113.08406 + 18.0) + "BioArray.toMonoisotopicMassWith did not return correct mass" + ) ] testList "BioList" [ From 6c5361c1d93aff9dbc7c50d029554f47036541c8 Mon Sep 17 00:00:00 2001 From: Graeme Vissers Date: Tue, 14 Jul 2020 13:15:49 -0700 Subject: [PATCH 7/9] add testCase toAverageMassWith --- .../BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs b/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs index 4139dda1..ac7d34df 100644 --- a/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs +++ b/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs @@ -167,6 +167,15 @@ let bioCollectionsTests = (131.04048 + 99.06841 + 113.08406 + 18.0) "BioArray.toMonoisotopicMassWith did not return correct mass" ) + + testCase "toAverageMassWith" (fun () -> + Expect.floatClose + Accuracy.medium + (testProt |> BioArray.toAverageMassWith 18.0) // 18 = mass of one water molecule + // Masses obtained from University of Washington Proteomics Resource https://proteomicsresource.washington.edu/protocols06/masses.php + (131.19606 + 99.13106 + 113.15764 + 18.0) + "BioArray.toAverageMassWith did not return correct mass" + ) ] testList "BioList" [ From a0cb99811e77a3370b4d810383c98e4cf6e20181 Mon Sep 17 00:00:00 2001 From: Graeme Vissers Date: Wed, 15 Jul 2020 17:13:35 -0700 Subject: [PATCH 8/9] add testCase toCompositionVector --- .../BioFSharp/BioCollections.fs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs b/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs index ac7d34df..cc5aa150 100644 --- a/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs +++ b/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs @@ -176,6 +176,20 @@ let bioCollectionsTests = (131.19606 + 99.13106 + 113.15764 + 18.0) "BioArray.toAverageMassWith did not return correct mass" ) + + testCase "toCompositionVector" (fun () -> + let testCompVec = Array.zeroCreate 26 + let metIndex = (int(BioItem.symbol Met)) - 65 + let valIndex = (int(BioItem.symbol Val)) - 65 + let leuIndex = (int(BioItem.symbol Leu)) - 65 + testCompVec.[metIndex] <- testCompVec.[metIndex] + 1 + testCompVec.[valIndex] <- testCompVec.[valIndex] + 1 + testCompVec.[leuIndex] <- testCompVec.[leuIndex] + 1 + Expect.equal + (testProt |> BioArray.toCompositionVector) + testCompVec + "BioArray.toCompositionVector did not return correct vector" + ) ] testList "BioList" [ From 21dcc2b41004559fc7da374ff2936974d6aa55d3 Mon Sep 17 00:00:00 2001 From: Graeme Vissers Date: Thu, 16 Jul 2020 11:37:50 -0700 Subject: [PATCH 9/9] Remove dependence on BioItem.symbol for test --- tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs b/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs index cc5aa150..e6d6b6e4 100644 --- a/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs +++ b/tests/BioFSharp.Tests.NetCore/BioFSharp/BioCollections.fs @@ -179,9 +179,9 @@ let bioCollectionsTests = testCase "toCompositionVector" (fun () -> let testCompVec = Array.zeroCreate 26 - let metIndex = (int(BioItem.symbol Met)) - 65 - let valIndex = (int(BioItem.symbol Val)) - 65 - let leuIndex = (int(BioItem.symbol Leu)) - 65 + let metIndex = 12 // Value of (int(BioItem.symbol Met)) - 65 + let valIndex = 21 // Value of (int(BioItem.symbol Val)) - 65 + let leuIndex = 11 // Value of (int(BioItem.symbol Leu)) - 65 testCompVec.[metIndex] <- testCompVec.[metIndex] + 1 testCompVec.[valIndex] <- testCompVec.[valIndex] + 1 testCompVec.[leuIndex] <- testCompVec.[leuIndex] + 1