mizlab 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mizlab/version.rb +1 -1
- data/lib/mizlab.rb +14 -17
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66e83019b3716a3b8bdb55bd6d14df9764821fe394547f3d54e34f26ca5bab06
|
4
|
+
data.tar.gz: 794444eaeff6a46f8e3cddc1e6173b746df7eab24a7b1fd1454dac8c4e4bc79d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bd7ab8e6be7264a6ba6a392685a271755320c555a459b1554797577f57ab387ce5e45762cd20341fa6749dc9117f4ac216d1a62d388d8386e2fd7b17a526761
|
7
|
+
data.tar.gz: fa475f06c3d361eff8bd3c19787e26ec973daca6a73e66f6bdccb414e4ddba5abe10a544ca2eb002f9c26eee6c532b4dbb964ea6eac6a66fa9f28a4ef69a2514
|
data/lib/mizlab/version.rb
CHANGED
data/lib/mizlab.rb
CHANGED
@@ -7,25 +7,22 @@ require "stringio"
|
|
7
7
|
|
8
8
|
module Mizlab
|
9
9
|
class << self
|
10
|
-
# Fetch data via genbank
|
11
|
-
# @param [String]
|
10
|
+
# Fetch data via genbank. You can also give a block.
|
11
|
+
# @param [String/Array] accessions Accession numbers Like ["NC_012920", ...].
|
12
12
|
# @param [Bool] is_protein wheather the accession is protein. Default to true.
|
13
13
|
# @return [Bio::GenBank] GenBank object.
|
14
|
-
def getobj(
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
ret = is_protein ? fetch_protein(accessions) : fetch_nucleotide(accessions)
|
27
|
-
parse(ret) do |o|
|
28
|
-
yield o
|
14
|
+
def getobj(accessions, is_protein = false)
|
15
|
+
accessions = accessions.is_a?(String) ? [accessions] : accessions
|
16
|
+
accessions.each do |acc|
|
17
|
+
ret = is_protein ? fetch_protein(acc) : fetch_nucleotide(acc)
|
18
|
+
parse(ret) do |o|
|
19
|
+
if block_given?
|
20
|
+
yield o
|
21
|
+
else
|
22
|
+
return o
|
23
|
+
end
|
24
|
+
end
|
25
|
+
sleep(0.37) # Using 0.333... seconds, sometimes hit the NCBI rate limit
|
29
26
|
end
|
30
27
|
end
|
31
28
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mizlab
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Omochice
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: The tools for our laboratory
|
14
14
|
email:
|