-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bio array tests #101
Add bio array tests #101
Changes from all commits
7f7b4af
3af73d6
6d5fba5
3c49b37
c921a85
bbfa8fd
6c5361c
a0cb998
21dcc2b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,6 +127,69 @@ 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." | ||
) | ||
|
||
testCase "toString" (fun () -> | ||
Expect.equal | ||
(aminoAcidSetArray |> BioArray.toString) | ||
"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" | ||
) | ||
|
||
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" | ||
) | ||
|
||
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" | ||
) | ||
|
||
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" | ||
) | ||
|
||
testCase "toCompositionVector" (fun () -> | ||
let testCompVec = Array.zeroCreate 26 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this test you are also dependent on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To add changes to this PR, the only thing you have to do is add new commits to your branch, they will be automatically added to the PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @kMutagene, Thanks for the suggestions. I updated the code to no longer be dependent on BioItem.symbol and committed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Awesome! |
||
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 | ||
Expect.equal | ||
(testProt |> BioArray.toCompositionVector) | ||
testCompVec | ||
"BioArray.toCompositionVector did not return correct vector" | ||
) | ||
] | ||
|
||
testList "BioList" [ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also like that you included sources here, so when we have to revisit these tests we have the references in the code.