bio 1.6.0.pre.20181210 → 2.0.3

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.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +32 -34
  3. data/ChangeLog +1462 -8
  4. data/Gemfile +0 -2
  5. data/KNOWN_ISSUES.rdoc +4 -10
  6. data/LEGAL +0 -10
  7. data/README.rdoc +31 -80
  8. data/README_DEV.rdoc +5 -5
  9. data/RELEASE_NOTES.rdoc +171 -18
  10. data/Rakefile +0 -34
  11. data/appveyor.yml +15 -7
  12. data/bioruby.gemspec +13 -4
  13. data/bioruby.gemspec.erb +0 -1
  14. data/gemfiles/Gemfile.travis-rbx +0 -2
  15. data/gemfiles/Gemfile.travis-ruby1.8 +0 -2
  16. data/gemfiles/Gemfile.travis-ruby1.9 +0 -2
  17. data/gemfiles/Gemfile.windows +6 -0
  18. data/lib/bio/appl/blast/report.rb +40 -8
  19. data/lib/bio/appl/iprscan/report.rb +3 -3
  20. data/lib/bio/appl/sosui/report.rb +1 -1
  21. data/lib/bio/db/embl/uniprotkb.rb +1 -1
  22. data/lib/bio/db/gff.rb +3 -1
  23. data/lib/bio/db/go.rb +2 -2
  24. data/lib/bio/db/kegg/common.rb +14 -0
  25. data/lib/bio/db/kegg/genes.rb +26 -0
  26. data/lib/bio/db/kegg/pathway.rb +5 -11
  27. data/lib/bio/sequence/common.rb +112 -0
  28. data/lib/bio/sequence/format.rb +1 -0
  29. data/lib/bio/tree.rb +1 -1
  30. data/lib/bio/version.rb +3 -3
  31. data/sample/color_scheme_aa.rb +82 -0
  32. data/sample/color_scheme_na.rb +5 -6
  33. data/sample/fastq2html.cwl +23 -0
  34. data/sample/fastq2html.rb +94 -0
  35. data/sample/fastq2html.testdata.yaml +5 -0
  36. data/sample/na2aa.cwl +23 -0
  37. data/sample/na2aa.rb +11 -25
  38. data/sample/na2aa.testdata.yaml +7 -0
  39. data/sample/rev_comp.cwl +23 -0
  40. data/sample/rev_comp.rb +20 -0
  41. data/sample/rev_comp.testdata.yaml +7 -0
  42. data/test/network/bio/db/kegg/test_genes_hsa7422.rb +91 -0
  43. data/test/unit/bio/appl/blast/test_report.rb +4 -4
  44. data/test/unit/bio/db/test_gff.rb +5 -0
  45. data/test/unit/bio/sequence/test_ruby3.rb +462 -0
  46. metadata +17 -8
  47. data/lib/bio/appl/blast/xmlparser.rb +0 -236
  48. data/setup.rb +0 -1600
data/sample/na2aa.cwl ADDED
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env cwl-runner
2
+
3
+ cwlVersion: v1.0
4
+ class: CommandLineTool
5
+ baseCommand: [ruby]
6
+
7
+ inputs:
8
+ - id: script
9
+ type: File
10
+ default:
11
+ class: File
12
+ location: na2aa.rb
13
+ inputBinding:
14
+ position: -1
15
+ - id: seqFile
16
+ type: File[]
17
+ inputBinding:
18
+ position: 1
19
+
20
+ outputs:
21
+ - id: out
22
+ type: stdout
23
+ stdout: $(inputs.script.nameroot)-$(inputs.seqFile[0].nameroot).fst
data/sample/na2aa.rb CHANGED
@@ -1,34 +1,20 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
- # translate.rb - translate any NA input into AA FASTA format
3
+ # na2aa.rb - translate any NA input into AA FASTA format
4
4
  #
5
- # Copyright (C) 2008 KATAYAMA Toshiaki <k@bioruby.org> & Pjotr Prins
6
- #
7
- # This program is free software; you can redistribute it and/or modify
8
- # it under the terms of the GNU General Public License as published by
9
- # the Free Software Foundation; either version 2 of the License, or
10
- # (at your option) any later version.
11
- #
12
- # This program is distributed in the hope that it will be useful,
13
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- # GNU General Public License for more details.
16
- #
17
- # $Id: na2aa.rb,v 1.1 2008/02/06 16:25:53 pjotr Exp $
5
+ # Copyright:: Copyright (C) 2019 BioRuby Project
6
+ # License:: The Ruby License
18
7
  #
19
8
 
20
9
  require 'bio'
21
- require 'pp'
22
10
 
23
- include Bio
24
-
25
- ARGV.each do | fn |
26
- Bio::FlatFile.auto(fn).each do | item |
27
- seq = Sequence::NA.new(item.data)
28
- aa = seq.translate
29
- aa.gsub!(/X/,'-')
30
- rec = Bio::FastaFormat.new('> '+item.definition+"\n"+aa)
31
- print rec
11
+ ARGV.each do |fn|
12
+ Bio::FlatFile.open(fn) do |ff|
13
+ ff.each do |entry|
14
+ next if /\A\s*\z/ =~ ff.entry_raw.to_s
15
+ na = entry.naseq
16
+ aa = na.translate
17
+ print aa.to_fasta(entry.definition, 70)
18
+ end
32
19
  end
33
20
  end
34
-
@@ -0,0 +1,7 @@
1
+ seqFile:
2
+ - class: File
3
+ location: ../test/data/fasta/example1.txt
4
+ - class: File
5
+ location: ../test/data/fasta/example2.txt
6
+ - class: File
7
+ location: ../test/data/genbank/SCU49845.gb
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env cwl-runner
2
+
3
+ cwlVersion: v1.0
4
+ class: CommandLineTool
5
+ baseCommand: [ruby]
6
+
7
+ inputs:
8
+ - id: script
9
+ type: File
10
+ default:
11
+ class: File
12
+ location: rev_comp.rb
13
+ inputBinding:
14
+ position: -1
15
+ - id: seqFile
16
+ type: File[]
17
+ inputBinding:
18
+ position: 1
19
+
20
+ outputs:
21
+ - id: out
22
+ type: stdout
23
+ stdout: $(inputs.script.nameroot)-$(inputs.seqFile[0].nameroot).fst
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # rev_comp.rb - Reverse complement DNA sequences
4
+ #
5
+ # Copyright:: Copyright (C) 2019 BioRuby Project
6
+ # License:: The Ruby License
7
+ #
8
+
9
+ require 'bio'
10
+
11
+ ARGV.each do |fn|
12
+ Bio::FlatFile.open(fn) do |ff|
13
+ ff.each do |entry|
14
+ next if /\A\s*\z/ =~ ff.entry_raw.to_s
15
+ na = entry.naseq
16
+ revcomp = na.reverse_complement
17
+ print revcomp.to_fasta("complement(#{entry.entry_id}) " + entry.definition, 70)
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,7 @@
1
+ seqFile:
2
+ - class: File
3
+ location: ../test/data/fasta/example2.txt
4
+ - class: File
5
+ location: ../test/data/fasta/example1.txt
6
+ - class: File
7
+ location: ../test/data/genbank/SCU49845.gb
@@ -0,0 +1,91 @@
1
+ #
2
+ # test/network/bio/db/kegg/test_genes_hsa7422.rb - Unit test for Bio::KEGG::GENES
3
+ #
4
+ # Copyright:: Copyright (C) 2019 BioRuby Project <staff@bioruby.org>
5
+ # License:: The Ruby License
6
+ # Contributor:: kojix2 <2xijok@gmail.com>
7
+ #
8
+
9
+ # loading helper routine for testing bioruby
10
+ require 'pathname'
11
+ load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4,
12
+ 'bioruby_test_helper.rb')).cleanpath.to_s
13
+
14
+ # libraries needed for the tests
15
+ require 'test/unit'
16
+ require 'bio/db/kegg/genes'
17
+ require 'bio/io/togows'
18
+
19
+ module Bio
20
+
21
+ # This test is moved from test/unit/bio/db/kegg/test_genes.rb
22
+ # and modified to get sample data from the internet
23
+ # because of KEGG data license issue.
24
+ #
25
+ # Note that this test may fail due to the data entry updates in KEGG.
26
+ class TestBioKEGGGENES_hsa7422 < Test::Unit::TestCase
27
+
28
+ str = Bio::TogoWS::REST.entry("kegg-genes", "hsa:7422")
29
+ DATA = str.freeze
30
+
31
+ def setup
32
+ #filename = File.join(BioRubyTestDataPath, 'KEGG/hsa7422.gene')
33
+ @obj = Bio::KEGG::GENES.new(DATA)
34
+ end
35
+
36
+ def test_diseases_as_strings
37
+ expected = ["H01456 Diabetic nephropathy",
38
+ "H01457 Diabetic retinopathy",
39
+ "H01459 Diabetic neuropathy",
40
+ "H01529 Avascular necrosis of femoral head",
41
+ "H01709 Glucocorticoid-induced osteonecrosis"]
42
+
43
+ assert_equal(expected, @obj.diseases_as_strings)
44
+ end
45
+
46
+ def test_diseases_as_hash
47
+ expected = {"H01456"=>"Diabetic nephropathy",
48
+ "H01457"=>"Diabetic retinopathy",
49
+ "H01459"=>"Diabetic neuropathy",
50
+ "H01529"=>"Avascular necrosis of femoral head",
51
+ "H01709"=>"Glucocorticoid-induced osteonecrosis"}
52
+ assert_equal(expected, @obj.diseases_as_hash)
53
+ end
54
+
55
+ def test_drug_targets_as_strings
56
+ expected = ["Abicipar pegol: D11517",
57
+ "Aflibercept: D09574",
58
+ "Aflibercept beta: D10819",
59
+ "Bevacizumab: D06409",
60
+ "Bevasiranib sodium: D08874",
61
+ "Brolucizumab: D11083",
62
+ "Faricimab: D11516",
63
+ "Navicixizumab: D11126",
64
+ "Pegaptanib: D05386",
65
+ "Ranibizumab: D05697",
66
+ "Vanucizumab: D11244"]
67
+ assert_equal(expected, @obj.drug_targets_as_strings)
68
+ end
69
+
70
+ def test_networks_as_strings
71
+ expected = ["nt06114 PI3K signaling (virus)",
72
+ "nt06124 Chemokine signaling (virus)",
73
+ "nt06164 Kaposi sarcoma-associated herpesvirus (KSHV)",
74
+ "nt06214 PI3K signaling",
75
+ "nt06219 JAK-STAT signaling",
76
+ "nt06224 CXCR signaling",
77
+ "nt06225 HIF-1 signaling",
78
+ "nt06262 Pancreatic cancer",
79
+ "nt06264 Renal cell carcinoma",
80
+ "N00079 HIF-1 signaling pathway",
81
+ "N00080 Loss of VHL to HIF-1 signaling pathway",
82
+ "N00081 Mutation-inactivated VHL to HIF-1 signaling pathway",
83
+ "N00095 ERBB2-overexpression to EGF-Jak-STAT signaling pathway",
84
+ "N00157 KSHV vGPCR to GNB/G-ERK signaling pathway",
85
+ "N00179 KSHV K1 to PI3K-NFKB signaling pathway"]
86
+ assert_equal(expected, @obj.networks_as_strings)
87
+ end
88
+
89
+ end #class TestBioKEGGGENES_hsa7422
90
+
91
+ end #module Bio
@@ -479,7 +479,7 @@ module Bio
479
479
  include TemplateTestBlastReportHsp
480
480
  end
481
481
 
482
- if defined? XMLParser then
482
+ if Bio::Blast::Report.private_method_defined? :xmlparser_parse then
483
483
 
484
484
  class TestBlastReportXMLParser < Test::Unit::TestCase
485
485
  include TemplateTestBlastReport
@@ -497,7 +497,7 @@ module Bio
497
497
  include TemplateTestBlastReportHsp
498
498
  end
499
499
 
500
- end #if defined? XMLParser
500
+ end #if
501
501
 
502
502
  class TestBlastReportDefault < Test::Unit::TestCase
503
503
  include TemplateTestBlastReport
@@ -1294,7 +1294,7 @@ module Bio
1294
1294
  end
1295
1295
 
1296
1296
  # Tests for XMLParser version
1297
- if defined? XMLParser then
1297
+ if Bio::Blast::Report.private_method_defined? :xmlparser_parse then
1298
1298
 
1299
1299
  class TestBlastReportMultiXMLParser < Test::Unit::TestCase
1300
1300
  include TemplateTestBlastReportMulti
@@ -1312,6 +1312,6 @@ module Bio
1312
1312
  include TemplateTestBlastReportHspMulti
1313
1313
  end
1314
1314
 
1315
- end #if defined? XMLParser
1315
+ end #if
1316
1316
 
1317
1317
  end # module Bio
@@ -182,6 +182,11 @@ END_OF_DATA
182
182
  assert_equal(str, @obj.to_s)
183
183
  end
184
184
 
185
+ def test_self_parse
186
+ obj2 = Bio::GFF::GFF2::Record.parse(@obj.to_s)
187
+ assert_equal(@obj, obj2)
188
+ end
189
+
185
190
  def test_eqeq
186
191
  obj2 = Bio::GFF::GFF2::Record.new(@obj.to_s)
187
192
  assert_equal(true, @obj == obj2)