-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#95: Add Conversion extensions for BioCollections
- Loading branch information
Showing
4 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
namespace BioFSharp | ||
|
||
open BioSeq | ||
open BioArray | ||
open BioList | ||
|
||
[<AutoOpen>] | ||
module BioCollectionsExtensions = | ||
module BioSeq = | ||
|
||
[<CompiledName("ToBioArray")>] | ||
let toBioArray (bioSeq:BioSeq<_>) : BioArray<_> = Seq.toArray bioSeq | ||
[<CompiledName("ToBioList")>] | ||
let toBioList (bioSeq:BioSeq<_>) : BioList<_> = Seq.toList bioSeq | ||
|
||
[<CompiledName("OfBioArray")>] | ||
let ofBioArray (bioArray:BioArray<_>) : BioSeq<_> = Seq.ofArray bioArray | ||
[<CompiledName("OfBioList")>] | ||
let ofBioList (bioList :BioList<_>) : BioSeq<_> = Seq.ofList bioList | ||
|
||
module BioList = | ||
|
||
[<CompiledName("ToBioArray")>] | ||
let toBioArray (bioList:BioList<_>) : BioArray<_> = List.toArray bioList | ||
[<CompiledName("ToBioSeq")>] | ||
let toBioSeq (bioList:BioList<_>) : BioSeq<_> = List.toSeq bioList | ||
|
||
[<CompiledName("OfBioArray")>] | ||
let ofBioArray (bioArray:BioArray<_>) : BioList<_> = List.ofArray bioArray | ||
[<CompiledName("OfBioSeq")>] | ||
let ofBioSeq (bioSeq:BioSeq<_>) : BioList<_> = List.ofSeq bioSeq | ||
|
||
module BioArray = | ||
|
||
[<CompiledName("ToBioList")>] | ||
let toBioList (bioArray:BioArray<_>) : BioList<_> = Array.toList bioArray | ||
[<CompiledName("ToBioSeq")>] | ||
let toBioSeq (bioArray:BioArray<_>) : BioSeq<_> = Array.toSeq bioArray | ||
|
||
[<CompiledName("OfBioList")>] | ||
let ofBioList (bioList :BioList<_>) : BioArray<_> = Array.ofList bioList | ||
[<CompiledName("OfBioSeq")>] | ||
let ofBioSeq (bioSeq :BioSeq<_>) : BioArray<_> = Array.ofSeq bioSeq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#r "../../../packages/FSharpAux/lib/netstandard2.0/FSharpAux.dll" | ||
|
||
#load "../PhysicalConstants.fs" | ||
#load "../BioID.fs" | ||
#load "../Isotopes.fs" | ||
#load "../Elements.fs" | ||
#load "../Formula.fs" | ||
#load "../Mass.fs" | ||
#load "../IBioItem.fs" | ||
#load "../TaggedSequence.fs" | ||
#load "../IsotopicDistribution.fs" | ||
#load "../ModificationInfo.fs" | ||
#load "../AminoAcidSymbols.fs" | ||
#load "../AminoAcids.fs" | ||
#load "../Nucleotides.fs" | ||
#load "../GlobalModificationInfo.fs" | ||
#load "../BioItemsConverter.fs" | ||
#load "../BioSeq.fs" | ||
#load "../BioArray.fs" | ||
#load "../BioList.fs" | ||
#load "../BioCollectionsExtensions.fs" | ||
|
||
open BioFSharp | ||
|
||
let testSeq = | ||
BioSeq.ofAminoAcidString "TESTESTESTLUL" | ||
|
||
testSeq |> BioSeq.toString | ||
|
||
let meem = | ||
|
||
testSeq | ||
|
||
|> BioList.ofBioSeq | ||
|> BioSeq.toBioList | ||
|
||
|> BioArray.ofBioList | ||
|> BioArray.toBioList | ||
|
||
|> BioSeq.ofBioList | ||
|> BioSeq.toBioArray | ||
|
||
|> BioList.ofBioArray | ||
|> BioList.toBioArray | ||
|
||
|> BioSeq.ofBioArray | ||
|> BioSeq.toBioList | ||
|
||
|> BioList.toBioSeq | ||
|> BioArray.ofBioSeq | ||
|> BioArray.toBioSeq | ||
|
||
(BioSeq.isEqual testSeq meem ) = 0 |