Skip to content

Commit 04358df

Browse files
committed
Initial commit
0 parents  commit 04358df

File tree

6 files changed

+269
-0
lines changed

6 files changed

+269
-0
lines changed

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
*.jl.cov
2+
*.jl.*.cov
3+
*.jl.mem
4+
deps/deps.jl

Manifest.toml

+233
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
# This file is machine-generated - editing it directly is not advised
2+
3+
[[ArgTools]]
4+
git-tree-sha1 = "bdf73eec6a88885256f282d48eafcad25d7de494"
5+
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
6+
version = "1.1.1"
7+
8+
[[Artifacts]]
9+
deps = ["Pkg"]
10+
git-tree-sha1 = "c30985d8821e0cd73870b17b0ed0ce6dc44cb744"
11+
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
12+
version = "1.3.0"
13+
14+
[[Automa]]
15+
deps = ["DataStructures", "Printf", "Random", "Test", "TranscodingStreams"]
16+
git-tree-sha1 = "c81526bf5f6fb4616b4e22a3cd62ac20e255fd3c"
17+
uuid = "67c07d97-cdcb-5c2c-af73-a7f9c32a568b"
18+
version = "0.8.0"
19+
20+
[[Base64]]
21+
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
22+
23+
[[BioGenerics]]
24+
deps = ["TranscodingStreams"]
25+
git-tree-sha1 = "57deb413ca9f4c8bc7d4c6e98ebe217ff728c737"
26+
uuid = "47718e42-2ac5-11e9-14af-e5595289c2ea"
27+
version = "0.1.0"
28+
29+
[[BioSequences]]
30+
deps = ["BioGenerics", "BioSymbols", "Combinatorics", "IndexableBitVectors", "Printf", "Random", "StableRNGs", "Twiddle"]
31+
git-tree-sha1 = "093ccb9211bdc71924abf8e74a0790af11da35a7"
32+
uuid = "7e6ae17a-c86d-528c-b3b9-7f778a29fe59"
33+
version = "2.0.5"
34+
35+
[[BioSymbols]]
36+
deps = ["Automa"]
37+
git-tree-sha1 = "ec77888ac3e78f9d372c2b533bdb52668f9e2b09"
38+
uuid = "3c28c6f8-a34d-59c4-9654-267d177fcfa9"
39+
version = "4.0.4"
40+
41+
[[Combinatorics]]
42+
git-tree-sha1 = "08c8b6831dc00bfea825826be0bc8336fc369860"
43+
uuid = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
44+
version = "1.0.2"
45+
46+
[[Compat]]
47+
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
48+
git-tree-sha1 = "919c7f3151e79ff196add81d7f4e45d91bbf420b"
49+
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
50+
version = "3.25.0"
51+
52+
[[DataStructures]]
53+
deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
54+
git-tree-sha1 = "4437b64df1e0adccc3e5d1adbc3ac741095e4677"
55+
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
56+
version = "0.18.9"
57+
58+
[[Dates]]
59+
deps = ["Printf"]
60+
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
61+
62+
[[DelimitedFiles]]
63+
deps = ["Mmap"]
64+
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"
65+
66+
[[Distributed]]
67+
deps = ["Random", "Serialization", "Sockets"]
68+
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
69+
70+
[[Downloads]]
71+
deps = ["ArgTools", "LibCURL", "NetworkOptions"]
72+
git-tree-sha1 = "5de8c54d269fd7ab430656c27de73e63eb07a979"
73+
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
74+
version = "1.4.0"
75+
76+
[[FASTX]]
77+
deps = ["Automa", "BioGenerics", "BioSequences", "BioSymbols", "TranscodingStreams"]
78+
git-tree-sha1 = "a980d6ac14c84c3ed17d0d07a0963a1c6d074b34"
79+
uuid = "c2308a5c-f048-11e8-3e8a-31650f418d12"
80+
version = "1.1.3"
81+
82+
[[IndexableBitVectors]]
83+
deps = ["Random", "Test"]
84+
git-tree-sha1 = "b7f5e42dc867b8a8654a5f899064632dac05bc82"
85+
uuid = "1cb3b9ac-1ffd-5777-9e6b-a3d42300664d"
86+
version = "1.0.0"
87+
88+
[[InteractiveUtils]]
89+
deps = ["Markdown"]
90+
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
91+
92+
[[JLLWrappers]]
93+
git-tree-sha1 = "a431f5f2ca3f4feef3bd7a5e94b8b8d4f2f647a0"
94+
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
95+
version = "1.2.0"
96+
97+
[[LibCURL]]
98+
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
99+
git-tree-sha1 = "cdbe7465ab7b52358804713a53c7fe1dac3f8a3f"
100+
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
101+
version = "0.6.3"
102+
103+
[[LibCURL_jll]]
104+
deps = ["LibSSH2_jll", "Libdl", "MbedTLS_jll", "Pkg", "Zlib_jll", "nghttp2_jll"]
105+
git-tree-sha1 = "897d962c20031e6012bba7b3dcb7a667170dad17"
106+
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
107+
version = "7.70.0+2"
108+
109+
[[LibGit2]]
110+
deps = ["Printf"]
111+
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
112+
113+
[[LibSSH2_jll]]
114+
deps = ["Libdl", "MbedTLS_jll", "Pkg"]
115+
git-tree-sha1 = "717705533148132e5466f2924b9a3657b16158e8"
116+
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
117+
version = "1.9.0+3"
118+
119+
[[Libdl]]
120+
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
121+
122+
[[LinearAlgebra]]
123+
deps = ["Libdl"]
124+
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
125+
126+
[[Logging]]
127+
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
128+
129+
[[Markdown]]
130+
deps = ["Base64"]
131+
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
132+
133+
[[MbedTLS_jll]]
134+
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
135+
git-tree-sha1 = "0eef589dd1c26a3ac9d753fe1a8bcad63f956fa6"
136+
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
137+
version = "2.16.8+1"
138+
139+
[[Mmap]]
140+
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
141+
142+
[[MozillaCACerts_jll]]
143+
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
144+
git-tree-sha1 = "bbcac5afd9049834366c3b68d792971e3d981799"
145+
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
146+
version = "2020.10.14+0"
147+
148+
[[NetworkOptions]]
149+
git-tree-sha1 = "ed3157f48a05543cce9b241e1f2815f7e843d96e"
150+
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
151+
version = "1.2.0"
152+
153+
[[OrderedCollections]]
154+
git-tree-sha1 = "4fa2ba51070ec13fcc7517db714445b4ab986bdf"
155+
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
156+
version = "1.4.0"
157+
158+
[[Pkg]]
159+
deps = ["Dates", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "UUIDs"]
160+
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
161+
162+
[[Printf]]
163+
deps = ["Unicode"]
164+
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
165+
166+
[[REPL]]
167+
deps = ["InteractiveUtils", "Markdown", "Sockets"]
168+
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
169+
170+
[[Random]]
171+
deps = ["Serialization"]
172+
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
173+
174+
[[SHA]]
175+
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
176+
177+
[[Serialization]]
178+
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
179+
180+
[[SharedArrays]]
181+
deps = ["Distributed", "Mmap", "Random", "Serialization"]
182+
uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"
183+
184+
[[Sockets]]
185+
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
186+
187+
[[SparseArrays]]
188+
deps = ["LinearAlgebra", "Random"]
189+
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
190+
191+
[[StableRNGs]]
192+
deps = ["Random", "Test"]
193+
git-tree-sha1 = "b57c4216b6c163a3a9d674f6b9f7b99cdccdb959"
194+
uuid = "860ef19b-820b-49d6-a774-d7a799459cd3"
195+
version = "0.1.2"
196+
197+
[[Statistics]]
198+
deps = ["LinearAlgebra", "SparseArrays"]
199+
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
200+
201+
[[Test]]
202+
deps = ["Distributed", "InteractiveUtils", "Logging", "Random"]
203+
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
204+
205+
[[TranscodingStreams]]
206+
deps = ["Random", "Test"]
207+
git-tree-sha1 = "7c53c35547de1c5b9d46a4797cf6d8253807108c"
208+
uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa"
209+
version = "0.9.5"
210+
211+
[[Twiddle]]
212+
git-tree-sha1 = "29509c4862bfb5da9e76eb6937125ab93986270a"
213+
uuid = "7200193e-83a8-5a55-b20d-5d36d44a0795"
214+
version = "1.1.2"
215+
216+
[[UUIDs]]
217+
deps = ["Random", "SHA"]
218+
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
219+
220+
[[Unicode]]
221+
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
222+
223+
[[Zlib_jll]]
224+
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
225+
git-tree-sha1 = "320228915c8debb12cb434c59057290f0834dbf6"
226+
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
227+
version = "1.2.11+18"
228+
229+
[[nghttp2_jll]]
230+
deps = ["Libdl", "Pkg"]
231+
git-tree-sha1 = "8e2c44ab4d49ad9518f359ed8b62f83ba8beede4"
232+
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
233+
version = "1.40.0+2"

Project.toml

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[deps]
2+
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
3+
FASTX = "c2308a5c-f048-11e8-3e8a-31650f418d12"

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# BioFetch.jl
2+
Easily fetch biological sequences from online sources

src/BioFetch.jl

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module BioFetch
2+
3+
using Downloads
4+
using FASTX
5+
6+
const ENTREZ_BASE_URL = raw"https://eutils.ncbi.nlm.nih.gov/entrez/eutils/"
7+
8+
const ENTREZ_FETCH = "efetch.fcgi"
9+
10+
function fetch(ids::AbstractString...)
11+
url = ENTREZ_BASE_URL * ENTREZ_FETCH * "?db=nuccore&id=" * join(ids, ",") * "&rettype=fasta&retmode=text"
12+
path = Downloads.download(url)
13+
records = FASTA.Record[]
14+
open(FASTA.Reader, path) do reader
15+
record = FASTA.Record()
16+
while !eof(f)
17+
read!(f, record)
18+
push!(records, record)
19+
end
20+
end
21+
return records
22+
end
23+
24+
25+
end

0 commit comments

Comments
 (0)