Skip to content

Commit

Permalink
Add Amino Acid name and symbol tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kMutagene committed Jul 21, 2020
1 parent 412d14c commit d1cf06b
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

<ItemGroup>
<Compile Include="Utils.fs" />
<Compile Include="BioFSharp\AminoAcidTests.fs" />
<Compile Include="BioFSharp\DigestionTests.fs" />
<Compile Include="BioFSharp\BioCollections.fs" />
<Compile Include="BioFSharp\BioItemTests.fs" />
Expand Down
60 changes: 60 additions & 0 deletions tests/BioFSharp.Tests.NetCore/BioFSharp/AminoAcidTests.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
module AminoAcidTests

open BioFSharp
open AminoAcids
open Expecto

let allSymbols = ['A';'C';'D';'E';'F';'G';'H';'I';'K';'L';'M';'N';'O';'P';'Q';'R';'S';'T';'U';'U';'V';'W';'Y';'X';'J';'Z';'B';'-';'*']

let allNames = [
"Alanine" ; "Cysteine" ; "Aspartic Acid" ; "Glutamic Acid"
"Phenylalanine" ; "Glycine" ; "Histidine" ; "Isoleucine"
"Lysine" ; "Leucine" ; "Methionine" ; "Asparagine"
"Pyrrolysine" ; "Proline" ; "Glutamine" ; "Arginine"
"Serine" ; "Threonine" ; "Selenocysteine" ; "Selenocysteine" ; "Valine"
"Tryptophan" ; "Tyrosine" ; "Unspecified" ; "Leucine/Isoleucine"
"Glutamine/glutamic acid" ; "Asparagine/aspartic acid" ; "Gap" ; "Ter"
]

let testModifiedAA = AminoAcid.Mod (AminoAcid.Ala,[ModificationInfo.Table.N15])

let allAAs = [
AminoAcid.Ala; AminoAcid.Cys; AminoAcid.Asp; AminoAcid.Glu
AminoAcid.Phe; AminoAcid.Gly; AminoAcid.His; AminoAcid.Ile
AminoAcid.Lys; AminoAcid.Leu; AminoAcid.Met; AminoAcid.Asn
AminoAcid.Pyl; AminoAcid.Pro; AminoAcid.Gln; AminoAcid.Arg
AminoAcid.Ser; AminoAcid.Thr; AminoAcid.Sel; AminoAcid.Sec; AminoAcid.Val
AminoAcid.Trp; AminoAcid.Tyr; AminoAcid.Xaa; AminoAcid.Xle
AminoAcid.Glx; AminoAcid.Asx; AminoAcid.Gap; AminoAcid.Ter
]

[<Tests>]
let aminoAcidTests =
testList "AminoAcids" [
testCase "symbol" (fun () ->
let testSymbols = allAAs |> List.map (fun aa -> AminoAcids.symbol aa)
Expect.sequenceEqual
testSymbols
allSymbols
"AminoAcids.symbol did not return the correct symbols for all AminoAcids"
)
testCase "symbolModifiedAA" (fun () ->
Expect.equal
(testModifiedAA |> AminoAcids.symbol)
'a'
"AminoAcids.symbol did not return the correct symbols for a 15N modified Alanine"
)
testCase "name" (fun () ->
let testNames = allAAs |> List.map (fun aa -> AminoAcids.name aa)
Expect.sequenceEqual
testNames
allNames
"AminoAcids.name did not return the correct name for all AminoAcids"
)
testCase "nameModifiedAA" (fun () ->
Expect.equal
(testModifiedAA |> AminoAcids.name)
"Alanine[#N15]"
"AminoAcids.symbol did not return the correct symbols for a 15N modified Alanine"
)
]
4 changes: 4 additions & 0 deletions tests/BioFSharp.Tests.NetCore/Main.fs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ let main argv =
Tests.runTestsWithCLIArgs [] argv BioItemTests.testIBioItem |> ignore
Tests.runTestsWithCLIArgs [] argv BioItemTests.testTaggedSequence |> ignore
Tests.runTestsWithCLIArgs [] argv BioItemTests.testIsotopicDistribution |> ignore

Tests.runTestsWithCLIArgs [] argv BioCollectionsTests.bioCollectionsTests |> ignore

Tests.runTestsWithCLIArgs [] argv DigestionTests.digestionTests |> ignore

Tests.runTestsWithCLIArgs [] argv AminoAcidTests.aminoAcidTests |> ignore

0

1 comment on commit d1cf06b

@kMutagene
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#30

Please sign in to comment.