Skip to content
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

Decoupling findorfs method #27

Merged
merged 18 commits into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
bc999a0
Comment some ideas for new implementations
camilogarciabotero Feb 14, 2024
e870886
Merge branch 'main' of https://github.com/camilogarciabotero/GeneFind…
camilogarciabotero Mar 29, 2024
bf77810
Move get_orfs* methods to its own file
camilogarciabotero Mar 29, 2024
6187202
Update Julia version and package dependencies
camilogarciabotero Mar 29, 2024
de55589
Main step of decoupling. The `findorfs` method now gains a `::Functio…
camilogarciabotero Mar 29, 2024
3f0246e
Update exports to file level
camilogarciabotero Mar 29, 2024
be321ca
Update ORF outputs in docs and README
camilogarciabotero Mar 29, 2024
b2080ab
Add todos in getindex
camilogarciabotero Mar 29, 2024
963764a
Refactor naivefinder function and include getindextest.jl
camilogarciabotero Mar 29, 2024
9176137
Refactor naivefinder function to improve readability and performance
camilogarciabotero Mar 29, 2024
9dea1ce
Fix return type annotation in findorfs function
camilogarciabotero Mar 29, 2024
ab25b99
Update .gitignore and add test Project.toml
camilogarciabotero Mar 29, 2024
78434d0
Remove FASTX methods and make it lighter
camilogarciabotero Mar 29, 2024
065c61d
Reduce precompilation workload
camilogarciabotero Mar 29, 2024
2fdae66
Remove commented out code and unused function
camilogarciabotero Mar 29, 2024
2b5c8fc
Remove unused function from utils.jl
camilogarciabotero Mar 29, 2024
80a8918
Fix score field declaration in Gene and ORF structs
camilogarciabotero Mar 29, 2024
92b0e22
Add findermethod parameter to get_orfs_dna and get_orfs_aa functions
camilogarciabotero Mar 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
/docs/build/
.travis.yml
/docs/src/*_cache
/docs/src/*_files
/docs/src/*_files
/test/Manifest.toml
51 changes: 6 additions & 45 deletions Manifest.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
# This file is machine-generated - editing it directly is not advised

julia_version = "1.10.0"
julia_version = "1.10.2"
manifest_format = "2.0"
project_hash = "4f6774eaeaec568c8cb7a865a84c0c7d9a180727"

[[deps.Automa]]
deps = ["PrecompileTools", "TranscodingStreams"]
git-tree-sha1 = "588e0d680ad1d7201d4c6a804dcb1cd9cba79fbb"
uuid = "67c07d97-cdcb-5c2c-af73-a7f9c32a568b"
version = "1.0.3"

[[deps.BioGenerics]]
deps = ["TranscodingStreams"]
git-tree-sha1 = "7bbc085aebc6faa615740b63756e4986c9e85a70"
uuid = "47718e42-2ac5-11e9-14af-e5595289c2ea"
version = "0.1.4"
project_hash = "0426921543f1f35e1faa99ad2688f4a61508977b"

[[deps.BioSequences]]
deps = ["BioSymbols", "PrecompileTools", "Random", "Twiddle"]
Expand All @@ -32,32 +20,22 @@ version = "5.1.3"
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"

[[deps.FASTX]]
deps = ["Automa", "BioGenerics", "PrecompileTools", "StringViews", "TranscodingStreams"]
git-tree-sha1 = "bff5d62bf5e1c382a370ac701bcaea9a24115ac6"
uuid = "c2308a5c-f048-11e8-3e8a-31650f418d12"
version = "2.1.4"
weakdeps = ["BioSequences"]

[deps.FASTX.extensions]
BioSequencesExt = "BioSequences"

[[deps.IterTools]]
git-tree-sha1 = "42d5f897009e7ff2cf88db414a389e5ed1bdd023"
uuid = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
version = "1.10.0"

[[deps.PrecompileTools]]
deps = ["Preferences"]
git-tree-sha1 = "03b4c25b43cb84cee5c90aa9b5ea0a78fd848d2f"
git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f"
uuid = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
version = "1.2.0"
version = "1.2.1"

[[deps.Preferences]]
deps = ["TOML"]
git-tree-sha1 = "00805cd429dcb4870060ff49ef443486c262e38e"
git-tree-sha1 = "9306f6085165d270f7e3db02af26a400d580f5c6"
uuid = "21216c6a-2e73-6563-6e65-726566657250"
version = "1.4.1"
version = "1.4.3"

[[deps.Printf]]
deps = ["Unicode"]
Expand All @@ -71,28 +49,11 @@ uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
version = "0.7.0"

[[deps.StringViews]]
git-tree-sha1 = "f7b06677eae2571c888fd686ba88047d8738b0e3"
uuid = "354b36f9-a18e-4713-926e-db85100087ba"
version = "1.3.3"

[[deps.TOML]]
deps = ["Dates"]
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
version = "1.0.3"

[[deps.TranscodingStreams]]
git-tree-sha1 = "54194d92959d8ebaa8e26227dbe3cdefcdcd594f"
uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
version = "0.10.3"

[deps.TranscodingStreams.extensions]
TestExt = ["Test", "Random"]

[deps.TranscodingStreams.weakdeps]
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[[deps.Twiddle]]
git-tree-sha1 = "29509c4862bfb5da9e76eb6937125ab93986270a"
uuid = "7200193e-83a8-5a55-b20d-5d36d44a0795"
Expand Down
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@ version = "0.2.0"

[deps]
BioSequences = "7e6ae17a-c86d-528c-b3b9-7f778a29fe59"
FASTX = "c2308a5c-f048-11e8-3e8a-31650f418d12"
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"

[compat]
BioSequences = "3"
FASTX = "2"
IterTools = "1.4"
PrecompileTools = "1"
julia = "1"
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ Now lest us find the ORFs
findorfs(seq)

12-element Vector{ORF}:
ORF(29:40, '+', 2)
ORF(137:145, '+', 2)
ORF(164:184, '+', 2)
ORF(173:184, '+', 2)
ORF(236:241, '+', 2)
ORF(248:268, '+', 2)
ORF(362:373, '+', 2)
ORF(470:496, '+', 2)
ORF(551:574, '+', 2)
ORF(569:574, '+', 2)
ORF(581:601, '+', 2)
ORF(695:706, '+', 2)
ORF(29:40, '+', 2, 0.0)
ORF(137:145, '+', 2, 0.0)
ORF(164:184, '+', 2, 0.0)
ORF(173:184, '+', 2, 0.0)
ORF(236:241, '+', 2, 0.0)
ORF(248:268, '+', 2, 0.0)
ORF(362:373, '+', 2, 0.0)
ORF(470:496, '+', 2, 0.0)
ORF(551:574, '+', 2, 0.0)
ORF(569:574, '+', 2, 0.0)
ORF(581:601, '+', 2, 0.0)
ORF(695:706, '+', 2, 0.0)
```

Two other functions (`get_orfs_dna` and `get_orfs_aa`) are implemented to get the ORFs in DNA and amino acid sequences, respectively. They use the `findorfs` function to first get the ORFs and then get the correspondance array of `BioSequence` objects.
Expand Down
24 changes: 12 additions & 12 deletions docs/src/simplefinder.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ Now lest us find the ORFs
findorfs(seq)

12-element Vector{ORF}:
ORF(29:40, '+', 2)
ORF(137:145, '+', 2)
ORF(164:184, '+', 2)
ORF(173:184, '+', 2)
ORF(236:241, '+', 2)
ORF(248:268, '+', 2)
ORF(362:373, '+', 2)
ORF(470:496, '+', 2)
ORF(551:574, '+', 2)
ORF(569:574, '+', 2)
ORF(581:601, '+', 2)
ORF(695:706, '+', 2)
ORF(29:40, '+', 2, 0.0)
ORF(137:145, '+', 2, 0.0)
ORF(164:184, '+', 2, 0.0)
ORF(173:184, '+', 2, 0.0)
ORF(236:241, '+', 2, 0.0)
ORF(248:268, '+', 2, 0.0)
ORF(362:373, '+', 2, 0.0)
ORF(470:496, '+', 2, 0.0)
ORF(551:574, '+', 2, 0.0)
ORF(569:574, '+', 2, 0.0)
ORF(581:601, '+', 2, 0.0)
ORF(695:706, '+', 2, 0.0)
```

Two other functions (`get_orfs_dna` and `get_orfs_aa`) are implemented to get the ORFs in DNA and amino acid sequences, respectively. They use the `findorfs` function to first get the ORFs and then get the correspondance array of `BioSequence` objects.
Expand Down
16 changes: 4 additions & 12 deletions src/GeneFinder.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,16 @@ using BioSequences:
ncbi_trans_table,
translate

using FASTX: FASTAReader, FASTARecord, description, sequence
# using FASTX: FASTAReader, FASTARecord, description, sequence
using IterTools: takewhile, iterated
using PrecompileTools: @setup_workload, @compile_workload

include("algorithms/naivefinder.jl")
include("types.jl")
export ORF

include("algorithms/findorfs.jl")
export locationiterator, findorfs, get_orfs_dna, get_orfs_aa, record_orfs_fna, record_orfs_faa

include("findorfs.jl")
include("getorfs.jl")
include("io.jl")
export write_orfs_fna, write_orfs_faa, write_orfs_bed, write_orfs_gff

include("utils.jl")
export fasta_to_dna, hasprematurestop

include("extended.jl")

@setup_workload begin
Expand All @@ -46,8 +40,6 @@ include("extended.jl")
# all calls in this block will be precompiled, regardless of whether
# they belong to your package or not (on Julia 1.8 and higher)
findorfs(seq)
get_orfs_dna(seq)
get_orfs_aa(seq)
end
end

Expand Down
Loading
Loading