bio-fastqc 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 953c27f12228958fe19b48fb0ed9f58fe5c44f82
4
- data.tar.gz: a4de37536fda8307419ca4307f6cde421dbe64a3
3
+ metadata.gz: 24e302a0001de21bb4e1ad93ef748b397a5758c9
4
+ data.tar.gz: a3fecf79186d42870c47aa5f03595dc62d5c15fc
5
5
  SHA512:
6
- metadata.gz: 09392571a463cdd925a67f0286e33109324fb42e2e5c5205eaccc10b57e6d8039159cce0e94edc742fb4411cb08832a04535e1da29a604b12f852778e7ff3564
7
- data.tar.gz: a0386cd5c8fc949c1b0e65955d5f6daf60db2e4abce1f4fe76fe35edde78532073ad120acba536ee627e763854d460fda139f67a0023593b041f7f43a811b941
6
+ metadata.gz: 93e3dff6270cd274089ac8cc0598ec66d04e5718ebd26f44ee2cfc01b19b7625f5d1a0bb40b81c18406fa91901f7975c2aab0dbea034782b073eae331cf185ab
7
+ data.tar.gz: 2441701ea9d0761bf2f9aac4ae5b9cdb7ab3d3f55270630d4ba9b1158f1dd26107b8812e8c97282541bf0f904df9e8f460047c97bf5c7a61ffe0b80c0ed40381
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.1
1
+ 0.5.2
data/lib/bio-fastqc.rb CHANGED
@@ -8,6 +8,7 @@
8
8
  #
9
9
  # In this file only require other files. Avoid other source code.
10
10
 
11
+ require 'bio/fastqc/io'
11
12
  require 'bio/fastqc/data'
12
13
  require 'bio/fastqc/cli'
13
14
  require 'bio/fastqc/parser'
@@ -0,0 +1,51 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ require 'rdf/turtle'
4
+
5
+ module Bio
6
+ module FastQC
7
+ class IO
8
+ def initialize(summary_json, id: nil)
9
+ @summary_json = summary_json
10
+ @id = id
11
+ end
12
+
13
+ def write(output_file, format)
14
+ case format
15
+ when "json"
16
+ write_json(output_file)
17
+ when "json-ld", "jsonld"
18
+ write_jsonld(output_file)
19
+ when "turtle", "ttl"
20
+ write_ttl(output_file)
21
+ when "tsv"
22
+ write_tsv(output_file)
23
+ end
24
+ end
25
+
26
+ def write_json(output_file)
27
+ json = Converter.new(@summary_json, id: @id).to_json
28
+ open(output_file, 'w'){|file| file.puts(json) }
29
+ end
30
+
31
+ def write_jsonld(output_file)
32
+ jsonld = Converter.new(@summary_json, id: @id).to_jsonld
33
+ open(output_file, 'w'){|file| file.puts(jsonld) }
34
+ end
35
+
36
+ def write_ttl(output_file)
37
+ semantics = Semantics.new(@summary_json, id: @id)
38
+ graph = semantics.turtle_graph
39
+ prefixes = semantics.turtle_prefixes
40
+ RDF::Turtle::Writer.open(output_file, prefixes: prefixes) do |writer|
41
+ writer << graph
42
+ end
43
+ end
44
+
45
+ def write_tsv(output_file)
46
+ tsv = Converter.new(@summary_json, id: @id).to_tsv
47
+ open(output_file, 'w'){|file| file.puts(tsv) }
48
+ end
49
+ end
50
+ end
51
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bio-fastqc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tazro Inutano Ohta
@@ -224,6 +224,7 @@ files:
224
224
  - lib/bio/fastqc/cli.rb
225
225
  - lib/bio/fastqc/converter.rb
226
226
  - lib/bio/fastqc/data.rb
227
+ - lib/bio/fastqc/io.rb
227
228
  - lib/bio/fastqc/parser.rb
228
229
  - lib/bio/fastqc/semantics.rb
229
230
  - spec/bio-fastqc_spec.rb