rbbt 1.2.5 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (88) hide show
  1. checksums.yaml +7 -0
  2. data/README.rdoc +2 -138
  3. metadata +69 -214
  4. data/LICENSE +0 -20
  5. data/bin/rbbt_config +0 -245
  6. data/install_scripts/classifier/R/classify.R +0 -36
  7. data/install_scripts/classifier/Rakefile +0 -140
  8. data/install_scripts/get_abner.sh +0 -2
  9. data/install_scripts/get_banner.sh +0 -25
  10. data/install_scripts/get_biocreative.sh +0 -72
  11. data/install_scripts/get_crf++.sh +0 -26
  12. data/install_scripts/get_entrez.sh +0 -4
  13. data/install_scripts/get_go.sh +0 -4
  14. data/install_scripts/get_polysearch.sh +0 -8
  15. data/install_scripts/ner/Rakefile +0 -206
  16. data/install_scripts/ner/config/default.rb +0 -52
  17. data/install_scripts/norm/Rakefile +0 -219
  18. data/install_scripts/norm/config/cue_default.rb +0 -10
  19. data/install_scripts/norm/config/tokens_default.rb +0 -86
  20. data/install_scripts/norm/functions.sh +0 -23
  21. data/install_scripts/organisms/Ath.Rakefile +0 -55
  22. data/install_scripts/organisms/Cal.Rakefile +0 -84
  23. data/install_scripts/organisms/Cel.Rakefile +0 -109
  24. data/install_scripts/organisms/Hsa.Rakefile +0 -140
  25. data/install_scripts/organisms/Mmu.Rakefile +0 -77
  26. data/install_scripts/organisms/Rakefile +0 -43
  27. data/install_scripts/organisms/Rno.Rakefile +0 -88
  28. data/install_scripts/organisms/Sce.Rakefile +0 -66
  29. data/install_scripts/organisms/Spo.Rakefile +0 -40
  30. data/install_scripts/organisms/rake-include.rb +0 -252
  31. data/install_scripts/wordlists/consonants +0 -897
  32. data/install_scripts/wordlists/stopwords +0 -1
  33. data/lib/rbbt.rb +0 -83
  34. data/lib/rbbt/bow/bow.rb +0 -88
  35. data/lib/rbbt/bow/classifier.rb +0 -116
  36. data/lib/rbbt/bow/dictionary.rb +0 -187
  37. data/lib/rbbt/ner/abner.rb +0 -34
  38. data/lib/rbbt/ner/banner.rb +0 -73
  39. data/lib/rbbt/ner/dictionaryNER.rb +0 -98
  40. data/lib/rbbt/ner/regexpNER.rb +0 -70
  41. data/lib/rbbt/ner/rner.rb +0 -227
  42. data/lib/rbbt/ner/rnorm.rb +0 -143
  43. data/lib/rbbt/ner/rnorm/cue_index.rb +0 -80
  44. data/lib/rbbt/ner/rnorm/tokens.rb +0 -217
  45. data/lib/rbbt/sources/biocreative.rb +0 -75
  46. data/lib/rbbt/sources/biomart.rb +0 -105
  47. data/lib/rbbt/sources/entrez.rb +0 -211
  48. data/lib/rbbt/sources/go.rb +0 -85
  49. data/lib/rbbt/sources/gscholar.rb +0 -74
  50. data/lib/rbbt/sources/organism.rb +0 -241
  51. data/lib/rbbt/sources/polysearch.rb +0 -117
  52. data/lib/rbbt/sources/pubmed.rb +0 -248
  53. data/lib/rbbt/util/arrayHash.rb +0 -266
  54. data/lib/rbbt/util/filecache.rb +0 -72
  55. data/lib/rbbt/util/index.rb +0 -47
  56. data/lib/rbbt/util/misc.rb +0 -106
  57. data/lib/rbbt/util/open.rb +0 -251
  58. data/lib/rbbt/util/rake.rb +0 -183
  59. data/lib/rbbt/util/simpleDSL.rb +0 -87
  60. data/lib/rbbt/util/tmpfile.rb +0 -35
  61. data/tasks/install.rake +0 -124
  62. data/test/rbbt/bow/test_bow.rb +0 -33
  63. data/test/rbbt/bow/test_classifier.rb +0 -72
  64. data/test/rbbt/bow/test_dictionary.rb +0 -91
  65. data/test/rbbt/ner/rnorm/test_cue_index.rb +0 -57
  66. data/test/rbbt/ner/rnorm/test_tokens.rb +0 -70
  67. data/test/rbbt/ner/test_abner.rb +0 -17
  68. data/test/rbbt/ner/test_banner.rb +0 -17
  69. data/test/rbbt/ner/test_dictionaryNER.rb +0 -122
  70. data/test/rbbt/ner/test_regexpNER.rb +0 -33
  71. data/test/rbbt/ner/test_rner.rb +0 -126
  72. data/test/rbbt/ner/test_rnorm.rb +0 -47
  73. data/test/rbbt/sources/test_biocreative.rb +0 -38
  74. data/test/rbbt/sources/test_biomart.rb +0 -31
  75. data/test/rbbt/sources/test_entrez.rb +0 -49
  76. data/test/rbbt/sources/test_go.rb +0 -24
  77. data/test/rbbt/sources/test_organism.rb +0 -59
  78. data/test/rbbt/sources/test_polysearch.rb +0 -27
  79. data/test/rbbt/sources/test_pubmed.rb +0 -39
  80. data/test/rbbt/util/test_arrayHash.rb +0 -257
  81. data/test/rbbt/util/test_filecache.rb +0 -37
  82. data/test/rbbt/util/test_index.rb +0 -31
  83. data/test/rbbt/util/test_misc.rb +0 -20
  84. data/test/rbbt/util/test_open.rb +0 -110
  85. data/test/rbbt/util/test_simpleDSL.rb +0 -57
  86. data/test/rbbt/util/test_tmpfile.rb +0 -21
  87. data/test/test_helper.rb +0 -4
  88. data/test/test_rbbt.rb +0 -11
@@ -1,31 +0,0 @@
1
- require File.dirname(__FILE__) + '/../../test_helper'
2
- require 'rbbt/util/index'
3
- require 'test/unit'
4
-
5
- class TestIndex < Test::Unit::TestCase
6
-
7
-
8
- def test_index
9
- require 'rbbt/util/tmpfile'
10
- require 'rbbt/util/open'
11
-
12
- tmp = TmpFile.tmp_file('test_open-')
13
- data =<<-EOD
14
- S000006236 856144 YPR032W YPR032W NP_015357 SNI1_YEAST Q12038|Q12038 CAA95028|CAA89286 SRO7
15
- S000001262 856629 YHR219W YHR219W NP_012091 YH19_YEAST P38900 AAB69742 YHR219W
16
- EOD
17
- Open.write(tmp,data)
18
-
19
- index = Index.index(tmp,:sep => " |\\|")
20
- assert(index['AAB69742'] == 'S000001262' )
21
- assert(index['Q12038'] == 'S000006236' )
22
-
23
- FileUtils.rm tmp
24
-
25
- end
26
-
27
-
28
-
29
- end
30
-
31
-
@@ -1,20 +0,0 @@
1
- require File.dirname(__FILE__) + '/../../test_helper'
2
- require 'rbbt/util/misc'
3
- require 'test/unit'
4
-
5
- class TestIndex < Test::Unit::TestCase
6
-
7
-
8
- def test_chunk
9
- a = %w(a b c d e f g h i j k l m)
10
- assert_equal([["a", "d", "g", "j", "m"], ["b", "e", "h", "k"], ["c", "f", "i", "l"]], a.chunk(3))
11
- end
12
-
13
- def test_special
14
- assert "BRC".is_special?
15
- assert !"bindings".is_special?
16
- end
17
-
18
- end
19
-
20
-
@@ -1,110 +0,0 @@
1
- require File.dirname(__FILE__) + '/../../test_helper'
2
- require File.dirname(__FILE__) + '/../../test_helper'
3
- require 'rbbt/util/open'
4
- require 'test/unit'
5
-
6
- class TestOpen < Test::Unit::TestCase
7
-
8
- def test_remote
9
-
10
- assert( Open.remote("http://localhost:20002/asdf.html"))
11
- assert(! Open.remote("/tmp/foo.xml"))
12
-
13
- end
14
-
15
- def test_gziped
16
- assert(Open.gziped("/tmp/foo.xml.gz"))
17
- assert(Open.gziped("http://cvsweb.geneontology.org/cgi-bin/cvsweb.cgi/go/gene-associations/gene_association.goa_human.gz?rev=HEAD"))
18
- assert(Open.gziped("http://cvsweb.geneontology.org/cgi-bin/cvsweb.cgi/go/gene-associations/gene_association.goa_human.gz"))
19
- end
20
-
21
- def test_read_write
22
- require 'rbbt/util/tmpfile'
23
- require 'fileutils'
24
-
25
- tmp = TmpFile.tmp_file('test-')
26
-
27
- content = "test content"
28
-
29
- Open.write(tmp, content)
30
- assert(Open.read(tmp) == content)
31
-
32
- assert_equal("tast contant", Open.read(IO::popen("cat #{ tmp }|tr 'e' 'a'")))
33
-
34
- FileUtils.rm(tmp)
35
- end
36
-
37
- def test_append
38
- require 'rbbt/util/tmpfile'
39
- require 'fileutils'
40
-
41
- tmp = TmpFile.tmp_file('test-')
42
- content1 = "test content1"
43
- content2 = "test content2"
44
-
45
- Open.write(tmp, content1)
46
- Open.append(tmp, content2)
47
- assert(Open.read(tmp) == content1 + content2)
48
- FileUtils.rm(tmp)
49
- end
50
-
51
-
52
- def test_read_remote
53
- url ="http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&retmode=xml&id=16438716"
54
-
55
- assert(Open.read(url, :quiet =>true) =~ /Discovering semantic features in the literature: a foundation for building functional associations./)
56
- end
57
-
58
- def test_to_hash
59
- require 'rbbt/util/tmpfile'
60
-
61
- tmp = TmpFile.tmp_file('test_open-')
62
- data =<<-EOD
63
- row1 a b 3
64
- row1 aa bb 33
65
- row2 a d e r
66
- EOD
67
- Open.write(tmp,data)
68
-
69
- data = Open.to_hash(tmp, :native => 1,:extra => [2,3],:sep => " ")
70
- assert(data['a'][0].include?('b'))
71
- assert(data['a'][0].include?('d'))
72
-
73
- data = Open.to_hash(tmp,:native => 1, :sep => " ")
74
- assert(data['a'][1].include?('b') && data['a'][1].include?('d'))
75
-
76
- data = Open.to_hash(tmp,:native => 1, :sep => " ", :flatten => true)
77
- assert(["row1", "bb", "33"].sort, data["aa"].sort)
78
- assert(["row1", "row2", "b", "d", "3", "e", "r"].sort, data["a"].sort)
79
-
80
- data = Open.to_hash(tmp,:native => 1, :sep => " ", :single => true)
81
- assert_equal({"aa"=>"row1", "a"=>"row1"}, data)
82
-
83
- FileUtils.rm tmp
84
- end
85
-
86
- def test_fields
87
- assert_equal(["1","2"] , Open.fields("1\t2") )
88
- assert_equal(["1","2",""] , Open.fields("1\t2\t") )
89
- assert_equal(["","",""] , Open.fields("\t\t") )
90
- end
91
-
92
- def test_select_field
93
- data =<<-EOD
94
- row1 a b 3
95
- row1 aa bb 33
96
- row2 a d e r
97
- EOD
98
-
99
- TmpFile.with_file(data) do |file|
100
- data = Open.to_hash(file, :select => Open.func_match_field(%w(row1), :sep => " "), :sep => " ")
101
- assert ! data.include?('row2')
102
- assert data.include?('row1')
103
- end
104
- end
105
-
106
-
107
-
108
- end
109
-
110
-
@@ -1,57 +0,0 @@
1
- require File.dirname(__FILE__) + '/../../test_helper'
2
- require 'rbbt/util/simpleDSL'
3
- require 'test/unit'
4
-
5
- class TestDSL < Test::Unit::TestCase
6
- class Test < SimpleDSL
7
-
8
- def action(name, *args, &block)
9
- @actions[name] = args.first
10
- end
11
-
12
- def initialize(file=nil,&block)
13
- @actions = {}
14
- super(:action, file, &block)
15
- end
16
-
17
- def actions
18
- @actions
19
- end
20
-
21
- end
22
-
23
- def setup
24
-
25
- @parser = Test.new do
26
- action1 "Hello"
27
- action2 "Good bye"
28
- end
29
- end
30
-
31
- def test_config
32
- config = <<-EOC
33
- action1("Hello")
34
- action2("Good bye")
35
- EOC
36
-
37
- assert_equal(@parser.config(:action),config)
38
- end
39
-
40
- def test_actions
41
- assert_equal({:action1=>"Hello", :action2=>"Good bye"}, @parser.actions)
42
- end
43
-
44
- def test_method_missing
45
- assert_raise(NoMethodError){@parser.cues}
46
- end
47
-
48
- def test_parse
49
- @parser.parse :action do
50
- action3 "Back again"
51
- end
52
-
53
- assert_equal({:action1 =>"Hello", :action2 =>"Good bye", :action3 =>"Back again"}, @parser.actions)
54
-
55
- end
56
-
57
- end
@@ -1,21 +0,0 @@
1
- require File.dirname(__FILE__) + '/../../test_helper'
2
- require 'rbbt/util/tmpfile'
3
- require 'test/unit'
4
-
5
- class TestTmpFile < Test::Unit::TestCase
6
-
7
- def test_tmp_file
8
- assert(TmpFile.tmp_file("test") =~ /tmp\/test\d+$/)
9
- end
10
-
11
- def test_do_tmp_file
12
- content = "Hello World!"
13
- TmpFile.with_file(content) do |file|
14
- assert_equal content, File.open(file).read
15
- end
16
- end
17
-
18
-
19
- end
20
-
21
-
@@ -1,4 +0,0 @@
1
- require 'test/unit'
2
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
3
- $LOAD_PATH.unshift(File.dirname(__FILE__))
4
-
@@ -1,11 +0,0 @@
1
- require File.dirname(__FILE__) + '/test_helper.rb'
2
-
3
- class TestRbbt < Test::Unit::TestCase
4
-
5
- def setup
6
- end
7
-
8
- def test_truth
9
- assert true
10
- end
11
- end