bio 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. data/COPYING +56 -0
  2. data/COPYING.ja +51 -0
  3. data/ChangeLog +540 -0
  4. data/GPL +340 -0
  5. data/LEGAL +141 -0
  6. data/LGPL +504 -0
  7. data/README.rdoc +4 -2
  8. data/Rakefile +2 -2
  9. data/bioruby.gemspec +17 -29
  10. data/doc/Tutorial.rd +118 -90
  11. data/doc/Tutorial.rd.html +124 -87
  12. data/lib/bio/appl/blast.rb +2 -2
  13. data/lib/bio/appl/blast/format0.rb +1 -1
  14. data/lib/bio/appl/fasta.rb +5 -12
  15. data/lib/bio/appl/fasta/format10.rb +96 -6
  16. data/lib/bio/appl/gcg/msf.rb +11 -14
  17. data/lib/bio/appl/pts1.rb +0 -4
  18. data/lib/bio/appl/sim4/report.rb +50 -17
  19. data/lib/bio/db/biosql/biosql_to_biosequence.rb +10 -0
  20. data/lib/bio/db/biosql/sequence.rb +234 -298
  21. data/lib/bio/db/embl/embl.rb +0 -3
  22. data/lib/bio/db/genbank/common.rb +3 -1
  23. data/lib/bio/io/biosql/ar-biosql.rb +257 -0
  24. data/lib/bio/io/biosql/biosql.rb +39 -0
  25. data/lib/bio/io/biosql/config/database.yml +5 -4
  26. data/lib/bio/io/ncbirest.rb +12 -5
  27. data/lib/bio/io/pubmed.rb +5 -1
  28. data/lib/bio/io/sql.rb +43 -150
  29. data/lib/bio/sequence/compat.rb +5 -1
  30. data/lib/bio/util/restriction_enzyme/range/sequence_range/calculated_cuts.rb +6 -4
  31. data/lib/bio/version.rb +1 -1
  32. data/test/data/gcg/pileup-aa.msf +67 -0
  33. data/test/data/sim4/complement-A4.sim4 +43 -0
  34. data/test/data/sim4/simple-A4.sim4 +25 -0
  35. data/test/data/sim4/simple2-A4.sim4 +25 -0
  36. data/test/functional/bio/io/test_pubmed.rb +129 -0
  37. data/test/unit/bio/appl/bl2seq/test_report.rb +5 -5
  38. data/test/unit/bio/appl/gcg/test_msf.rb +154 -0
  39. data/test/unit/bio/appl/hmmer/test_report.rb +2 -2
  40. data/test/unit/bio/appl/sim4/test_report.rb +869 -0
  41. data/test/unit/bio/appl/test_blast.rb +1 -1
  42. data/test/unit/bio/db/biosql/tc_biosql.rb +110 -0
  43. data/test/unit/bio/db/biosql/ts_suite_biosql.rb +8 -0
  44. data/test/unit/bio/test_feature.rb +18 -17
  45. data/test/unit/bio/test_reference.rb +18 -18
  46. data/test/unit/bio/test_sequence.rb +1 -1
  47. metadata +18 -30
  48. data/lib/bio/io/biosql/biodatabase.rb +0 -64
  49. data/lib/bio/io/biosql/bioentry.rb +0 -29
  50. data/lib/bio/io/biosql/bioentry_dbxref.rb +0 -11
  51. data/lib/bio/io/biosql/bioentry_path.rb +0 -12
  52. data/lib/bio/io/biosql/bioentry_qualifier_value.rb +0 -10
  53. data/lib/bio/io/biosql/bioentry_reference.rb +0 -10
  54. data/lib/bio/io/biosql/bioentry_relationship.rb +0 -10
  55. data/lib/bio/io/biosql/biosequence.rb +0 -11
  56. data/lib/bio/io/biosql/comment.rb +0 -7
  57. data/lib/bio/io/biosql/dbxref.rb +0 -13
  58. data/lib/bio/io/biosql/dbxref_qualifier_value.rb +0 -12
  59. data/lib/bio/io/biosql/location.rb +0 -32
  60. data/lib/bio/io/biosql/location_qualifier_value.rb +0 -11
  61. data/lib/bio/io/biosql/ontology.rb +0 -10
  62. data/lib/bio/io/biosql/reference.rb +0 -9
  63. data/lib/bio/io/biosql/seqfeature.rb +0 -32
  64. data/lib/bio/io/biosql/seqfeature_dbxref.rb +0 -11
  65. data/lib/bio/io/biosql/seqfeature_path.rb +0 -11
  66. data/lib/bio/io/biosql/seqfeature_qualifier_value.rb +0 -20
  67. data/lib/bio/io/biosql/seqfeature_relationship.rb +0 -11
  68. data/lib/bio/io/biosql/taxon.rb +0 -12
  69. data/lib/bio/io/biosql/taxon_name.rb +0 -9
  70. data/lib/bio/io/biosql/term.rb +0 -27
  71. data/lib/bio/io/biosql/term_dbxref.rb +0 -11
  72. data/lib/bio/io/biosql/term_path.rb +0 -12
  73. data/lib/bio/io/biosql/term_relationship.rb +0 -13
  74. data/lib/bio/io/biosql/term_relationship_term.rb +0 -11
  75. data/lib/bio/io/biosql/term_synonym.rb +0 -10
@@ -119,7 +119,7 @@ module Bio
119
119
  assert(Bio::Blast.local(@program, @db, @option))
120
120
  end
121
121
 
122
- def test_self_local
122
+ def test_self_remote
123
123
  assert(Bio::Blast.remote(@program, @db, @option))
124
124
  end
125
125
 
@@ -0,0 +1,110 @@
1
+ # To change this template, choose Tools | Templates
2
+ # and open the template in the editor.
3
+
4
+ $:.unshift File.join(File.dirname(__FILE__),'..','lib')
5
+
6
+ require 'test/unit'
7
+ require 'bio'
8
+
9
+ module Bio
10
+ class TestBiosqlIO < Test::Unit::TestCase
11
+ def setup
12
+ @connection = Bio::SQL.establish_connection({'development'=>{'hostname'=>'localhost','database'=>"bioseq", 'adapter'=>"jdbcmysql", 'username'=>"febo", 'password'=>nil}},'development')
13
+ @str_genbank=<<END
14
+ LOCUS X64011 756 bp DNA linear BCT 26-SEP-2006
15
+ DEFINITION Listeria ivanovii sod gene for superoxide dismutase.
16
+ ACCESSION X64011 S78972
17
+ VERSION X64011.1 GI:44010
18
+ KEYWORDS sod gene; superoxide dismutase.
19
+ SOURCE Listeria ivanovii
20
+ ORGANISM Listeria ivanovii
21
+ Bacteria; Firmicutes; Bacillales; Listeriaceae; Listeria.
22
+ REFERENCE 1
23
+ AUTHORS Haas,A. and Goebel,W.
24
+ TITLE Cloning of a superoxide dismutase gene from Listeria ivanovii by
25
+ functional complementation in Escherichia coli and characterization
26
+ of the gene product
27
+ JOURNAL Mol. Gen. Genet. 231 (2), 313-322 (1992)
28
+ PUBMED 1736100
29
+ REFERENCE 2 (bases 1 to 756)
30
+ AUTHORS Kreft,J.
31
+ TITLE Direct Submission
32
+ JOURNAL Submitted (21-APR-1992) J. Kreft, Institut f. Mikrobiologie,
33
+ Universitaet Wuerzburg, Biozentrum Am Hubland, 8700 Wuerzburg, FRG
34
+ COMMENT On Jun 23, 2005 this sequence version replaced gi:244394.
35
+ FEATURES Location/Qualifiers
36
+ source 1..756
37
+ /organism="Listeria ivanovii"
38
+ /mol_type="genomic DNA"
39
+ /strain="ATCC 19119"
40
+ /db_xref="taxon:1638"
41
+ gene 95..746
42
+ /gene="sod"
43
+ RBS 95..100
44
+ /gene="sod"
45
+ CDS 109..717
46
+ /gene="sod"
47
+ /EC_number="1.15.1.1"
48
+ /codon_start=1
49
+ /transl_table=11
50
+ /product="superoxide dismutase"
51
+ /protein_id="CAA45406.1"
52
+ /db_xref="GI:44011"
53
+ /db_xref="GOA:P28763"
54
+ /db_xref="InterPro:IPR001189"
55
+ /db_xref="UniProtKB/Swiss-Prot:P28763"
56
+ /translation="MTYELPKLPYTYDALEPNFDKETMEIHYTKHHNIYVTKLNEAVS
57
+ GHAELASKPGEELVANLDSVPEEIRGAVRNHGGGHANHTLFWSSLSPNGGGAPTGNLK
58
+ AAIESEFGTFDEFKEKFNAAAAARFGSGWAWLVVNNGKLEIVSTANQDSPLSEGKTPV
59
+ LGLDVWEHAYYLKFQNRRPEYIDTFWNVINWDERNKRFDAAK"
60
+ terminator 723..746
61
+ /gene="sod"
62
+ ORIGIN
63
+ 1 cgttatttaa ggtgttacat agttctatgg aaatagggtc tatacctttc gccttacaat
64
+ 61 gtaatttctt ttcacataaa taataaacaa tccgaggagg aatttttaat gacttacgaa
65
+ 121 ttaccaaaat taccttatac ttatgatgct ttggagccga attttgataa agaaacaatg
66
+ 181 gaaattcact atacaaagca ccacaatatt tatgtaacaa aactaaatga agcagtctca
67
+ 241 ggacacgcag aacttgcaag taaacctggg gaagaattag ttgctaatct agatagcgtt
68
+ 301 cctgaagaaa ttcgtggcgc agtacgtaac cacggtggtg gacatgctaa ccatacttta
69
+ 361 ttctggtcta gtcttagccc aaatggtggt ggtgctccaa ctggtaactt aaaagcagca
70
+ 421 atcgaaagcg aattcggcac atttgatgaa ttcaaagaaa aattcaatgc ggcagctgcg
71
+ 481 gctcgttttg gttcaggatg ggcatggcta gtagtgaaca atggtaaact agaaattgtt
72
+ 541 tccactgcta accaagattc tccacttagc gaaggtaaaa ctccagttct tggcttagat
73
+ 601 gtttgggaac atgcttatta tcttaaattc caaaaccgtc gtcctgaata cattgacaca
74
+ 661 ttttggaatg taattaactg ggatgaacga aataaacgct ttgacgcagc aaaataatta
75
+ 721 tcgaaaggct cacttaggtg ggtcttttta tttcta
76
+ //
77
+ END
78
+ end
79
+
80
+ def test_00_connection
81
+ assert_instance_of(ActiveRecord::ConnectionAdapters::ConnectionPool, @connection)
82
+ end
83
+
84
+ def test_01_input_is_genbank
85
+ assert_instance_of(Bio::GenBank,Bio::GenBank.new(@str_genbank))
86
+ end
87
+
88
+ def test_02_insert_bioentry
89
+ @@x = Bio::SQL::Sequence.new(:biosequence=>Bio::GenBank.new(@str_genbank).to_biosequence, :biodatabase=>Bio::SQL::Biodatabase.find(:first))
90
+ assert_not_nil(@@x)
91
+ end
92
+
93
+ def test_03_input_output
94
+ bioseq = Bio::SQL.fetch_accession("X64011")
95
+ assert_not_nil bioseq
96
+ assert_equal(@str_genbank, bioseq.to_biosequence.output(:genbank))
97
+ end
98
+
99
+ def test_04_bioentry_data_format
100
+ assert_equal('26-SEP-2006', @@x.date_modified.to_s)
101
+ end
102
+
103
+ def test_05_title
104
+ assert_equal('Cloning of a superoxide dismutase gene from Listeria ivanovii by functional complementation in Escherichia coli and characterization of the gene product',@@x.references.first.title)
105
+ end
106
+ def test_99_delete_bioentry
107
+ assert_not_nil(@@x.delete)
108
+ end
109
+ end
110
+ end
@@ -0,0 +1,8 @@
1
+ # To change this template, choose Tools | Templates
2
+ # and open the template in the editor.
3
+ $:.unshift File.dirname(__FILE__)
4
+
5
+ require 'test/unit'
6
+
7
+ # Add your testcases here
8
+ require 'tc_biosql'
@@ -5,7 +5,7 @@
5
5
  # Mitsuteru Nakao <n@bioruby.org>
6
6
  # License:: The Ruby License
7
7
  #
8
- # $Id: test_feature.rb,v 1.5.2.1 2008/05/08 05:38:01 ngoto Exp $
8
+ # $Id:$
9
9
  #
10
10
 
11
11
  require 'pathname'
@@ -89,25 +89,26 @@ module Bio
89
89
  end
90
90
  end
91
91
 
92
- class NullStderr
93
- def initialize
94
- @log = []
95
- end
92
+ class TestFeatures < Test::Unit::TestCase
96
93
 
97
- def write(*arg)
98
- #p arg
99
- @log.push([ :write, *arg ])
100
- nil
101
- end
94
+ class NullStderr
95
+ def initialize
96
+ @log = []
97
+ end
102
98
 
103
- def method_missing(*arg)
104
- #p arg
105
- @log.push arg
106
- nil
107
- end
108
- end
99
+ def write(*arg)
100
+ #p arg
101
+ @log.push([ :write, *arg ])
102
+ nil
103
+ end
104
+
105
+ def method_missing(*arg)
106
+ #p arg
107
+ @log.push arg
108
+ nil
109
+ end
110
+ end #class NullStderr
109
111
 
110
- class TestFeatures < Test::Unit::TestCase
111
112
  def setup
112
113
  # To suppress warning messages, $stderr is replaced by dummy object.
113
114
  @stderr_orig = $stderr
@@ -1,11 +1,11 @@
1
1
  #
2
- # = test/bio/tc_pathway.rb - Unit test for Bio::Pathway
2
+ # = test/unit/bio/test_reference.rb - Unit test for Bio::Reference
3
3
  #
4
4
  # Copyright:: Copyright (C) 2006
5
5
  # Mitsuteru C. Nakao <n@bioruby.org>
6
6
  # License:: The Ruby License
7
7
  #
8
- # $Id: test_reference.rb,v 1.3.2.2 2008/06/17 12:24:41 ngoto Exp $
8
+ # $Id:$
9
9
  #
10
10
 
11
11
  require 'pathname'
@@ -199,25 +199,25 @@ __END__
199
199
 
200
200
  end
201
201
 
202
- class NullStderr
203
- def initialize
204
- @log = []
205
- end
202
+ class TestReferences < Test::Unit::TestCase
206
203
 
207
- def write(*arg)
208
- #p arg
209
- @log.push([ :write, *arg ])
210
- nil
211
- end
204
+ class NullStderr
205
+ def initialize
206
+ @log = []
207
+ end
212
208
 
213
- def method_missing(*arg)
214
- #p arg
215
- @log.push arg
216
- nil
217
- end
218
- end
209
+ def write(*arg)
210
+ #p arg
211
+ @log.push([ :write, *arg ])
212
+ nil
213
+ end
219
214
 
220
- class TestReferences < Test::Unit::TestCase
215
+ def method_missing(*arg)
216
+ #p arg
217
+ @log.push arg
218
+ nil
219
+ end
220
+ end #class NullStderr
221
221
 
222
222
  def setup
223
223
  # To suppress warning messages, $stderr is replaced by dummy object.
@@ -321,7 +321,7 @@ module Bio
321
321
  def test_translate_5
322
322
  assert_equal("", @obj.translate(5))
323
323
  end
324
- def test_translate_5
324
+ def test_translate_6
325
325
  assert_equal("", @obj.translate(6))
326
326
  end
327
327
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - BioRuby project
@@ -9,7 +9,7 @@ autorequire: bio
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-02-20 00:00:00 +09:00
12
+ date: 2009-09-02 00:00:00 +09:00
13
13
  default_executable: bioruby
14
14
  dependencies: []
15
15
 
@@ -30,8 +30,13 @@ extra_rdoc_files:
30
30
  - README_DEV.rdoc
31
31
  - doc/Changes-1.3.rdoc
32
32
  files:
33
+ - COPYING
34
+ - COPYING.ja
33
35
  - ChangeLog
36
+ - GPL
34
37
  - KNOWN_ISSUES.rdoc
38
+ - LEGAL
39
+ - LGPL
35
40
  - README.rdoc
36
41
  - README_DEV.rdoc
37
42
  - Rakefile
@@ -169,35 +174,9 @@ files:
169
174
  - lib/bio/db/soft.rb
170
175
  - lib/bio/db/transfac.rb
171
176
  - lib/bio/feature.rb
172
- - lib/bio/io/biosql/biodatabase.rb
173
- - lib/bio/io/biosql/bioentry.rb
174
- - lib/bio/io/biosql/bioentry_dbxref.rb
175
- - lib/bio/io/biosql/bioentry_path.rb
176
- - lib/bio/io/biosql/bioentry_qualifier_value.rb
177
- - lib/bio/io/biosql/bioentry_reference.rb
178
- - lib/bio/io/biosql/bioentry_relationship.rb
179
- - lib/bio/io/biosql/biosequence.rb
180
- - lib/bio/io/biosql/comment.rb
177
+ - lib/bio/io/biosql/ar-biosql.rb
178
+ - lib/bio/io/biosql/biosql.rb
181
179
  - lib/bio/io/biosql/config/database.yml
182
- - lib/bio/io/biosql/dbxref.rb
183
- - lib/bio/io/biosql/dbxref_qualifier_value.rb
184
- - lib/bio/io/biosql/location.rb
185
- - lib/bio/io/biosql/location_qualifier_value.rb
186
- - lib/bio/io/biosql/ontology.rb
187
- - lib/bio/io/biosql/reference.rb
188
- - lib/bio/io/biosql/seqfeature.rb
189
- - lib/bio/io/biosql/seqfeature_dbxref.rb
190
- - lib/bio/io/biosql/seqfeature_path.rb
191
- - lib/bio/io/biosql/seqfeature_qualifier_value.rb
192
- - lib/bio/io/biosql/seqfeature_relationship.rb
193
- - lib/bio/io/biosql/taxon.rb
194
- - lib/bio/io/biosql/taxon_name.rb
195
- - lib/bio/io/biosql/term.rb
196
- - lib/bio/io/biosql/term_dbxref.rb
197
- - lib/bio/io/biosql/term_path.rb
198
- - lib/bio/io/biosql/term_relationship.rb
199
- - lib/bio/io/biosql/term_relationship_term.rb
200
- - lib/bio/io/biosql/term_synonym.rb
201
180
  - lib/bio/io/das.rb
202
181
  - lib/bio/io/dbget.rb
203
182
  - lib/bio/io/ddbjxml.rb
@@ -361,6 +340,7 @@ files:
361
340
  - test/data/embl/AB090716.embl.rel89
362
341
  - test/data/fasta/example1.txt
363
342
  - test/data/fasta/example2.txt
343
+ - test/data/gcg/pileup-aa.msf
364
344
  - test/data/genscan/sample.report
365
345
  - test/data/iprscan/merged.raw
366
346
  - test/data/iprscan/merged.txt
@@ -370,11 +350,15 @@ files:
370
350
  - test/data/prosite/prosite.dat
371
351
  - test/data/refseq/nm_126355.entret
372
352
  - test/data/rpsblast/misc.rpsblast
353
+ - test/data/sim4/complement-A4.sim4
354
+ - test/data/sim4/simple-A4.sim4
355
+ - test/data/sim4/simple2-A4.sim4
373
356
  - test/data/soft/GDS100_partial.soft
374
357
  - test/data/soft/GSE3457_family_partial.soft
375
358
  - test/data/uniprot/p53_human.uniprot
376
359
  - test/functional/bio/appl/test_pts1.rb
377
360
  - test/functional/bio/io/test_ensembl.rb
361
+ - test/functional/bio/io/test_pubmed.rb
378
362
  - test/functional/bio/io/test_soapwsdl.rb
379
363
  - test/functional/bio/io/test_togows.rb
380
364
  - test/functional/bio/sequence/test_output_embl.rb
@@ -384,6 +368,7 @@ files:
384
368
  - test/unit/bio/appl/blast/test_ncbioptions.rb
385
369
  - test/unit/bio/appl/blast/test_report.rb
386
370
  - test/unit/bio/appl/blast/test_rpsblast.rb
371
+ - test/unit/bio/appl/gcg/test_msf.rb
387
372
  - test/unit/bio/appl/genscan/test_report.rb
388
373
  - test/unit/bio/appl/hmmer/test_report.rb
389
374
  - test/unit/bio/appl/iprscan/test_report.rb
@@ -391,6 +376,7 @@ files:
391
376
  - test/unit/bio/appl/paml/codeml/test_rates.rb
392
377
  - test/unit/bio/appl/paml/codeml/test_report.rb
393
378
  - test/unit/bio/appl/paml/test_codeml.rb
379
+ - test/unit/bio/appl/sim4/test_report.rb
394
380
  - test/unit/bio/appl/sosui/test_report.rb
395
381
  - test/unit/bio/appl/targetp/test_report.rb
396
382
  - test/unit/bio/appl/test_blast.rb
@@ -400,6 +386,8 @@ files:
400
386
  - test/unit/bio/data/test_aa.rb
401
387
  - test/unit/bio/data/test_codontable.rb
402
388
  - test/unit/bio/data/test_na.rb
389
+ - test/unit/bio/db/biosql/tc_biosql.rb
390
+ - test/unit/bio/db/biosql/ts_suite_biosql.rb
403
391
  - test/unit/bio/db/embl/test_common.rb
404
392
  - test/unit/bio/db/embl/test_embl.rb
405
393
  - test/unit/bio/db/embl/test_embl_rel89.rb
@@ -1,64 +0,0 @@
1
- module Bio
2
- class SQL
3
- class Biodatabase < DummyBase
4
- has_many :bioentries, :class_name =>"Bioentry", :foreign_key => "biodatabase_id"
5
- validates_uniqueness_of :name
6
- end
7
- end #SQL
8
- end #Bio
9
-
10
-
11
- if __FILE__ == $0
12
- require 'rubygems'
13
- require 'composite_primary_keys'
14
- require 'bio'
15
- require 'pp'
16
-
17
- # pp connection = Bio::SQL.establish_connection('bio/io/biosql/config/database.yml','development')
18
- pp connection = Bio::SQL.establish_connection({'test'=>{'database'=>"bio_test", 'adapter'=>"postgresql", 'username'=>"rails", 'password'=>nil}},'test')
19
- #pp YAML::load(ERB.new(IO.read('bio/io/biosql/config/database.yml')).result)
20
- if true
21
- pp Bio::SQL.list_entries
22
-
23
- puts "### GenBank"
24
- if ARGV.size > 0
25
- gb = Bio::GenBank.new(ARGF.read)
26
- else
27
- require 'bio/io/fetch'
28
- gb = Bio::GenBank.new(Bio::Fetch.query('gb', 'AJ224122'))
29
- end
30
-
31
- biosequence = gb.to_biosequence
32
- db=Bio::SQL::Biodatabase.new(:biodatabase_id=>3,:name=>"JEFF", :authority=>"ME", :description=>"YOU")
33
- db.save!
34
-
35
- #sqlseq = Bio::SQL::Sequence.new(:biosequence=>biosequence,:biodatabase_id=>db.id)
36
-
37
- # bioseq = Bio::SQL.fetch_accession('AJ224122')
38
- # pp bioseq
39
- # pp bioseq.entry_id
40
- #TODO create a test only for tables not sequence here
41
- # pp bioseq.molecule_type
42
- #pp bioseq.molecule_type.class
43
- #bioseq.molecule_type_update('dna', 1)
44
- pp Bio::SQL::Taxon.find(8121).taxon_names
45
-
46
- #sqlseq.to_biosequence
47
-
48
- #sqlseq.delete
49
- end
50
- #pp bioseq.molecule_type
51
- #term = Bio::SQL::Term.find_by_name('mol_type')
52
- #pp term
53
- #pp bioseq.entry.bioentry_qualifier_values.create(:term=>term, :rank=>2, :value=>'pippo')
54
- #pp bioseq.entry.bioentry_qualifier_values.inspect
55
- #pp bioseq.entry.bioentry_qualifier_values.find_all_by_term_id(26)
56
- #pp primo.class
57
- # pp primo.value='dna'
58
- # pp primo.save
59
- #pp bioseq.molecule_type= 'prova'
60
-
61
- #Bio::SQL::BioentryQualifierValue.delete(delete.bioentry_id,delete.term_id,delete.rank)
62
-
63
-
64
- end
@@ -1,29 +0,0 @@
1
- module Bio
2
- class SQL
3
- class Bioentry < DummyBase
4
- belongs_to :biodatabase, :class_name => "Biodatabase"
5
- belongs_to :taxon, :class_name => "Taxon"
6
- has_one :biosequence
7
- #, :class_name => "Biosequence", :foreign_key => "bioentry_id"
8
- has_many :comments, :class_name =>"Comment", :order =>'rank'
9
- has_many :seqfeatures, :class_name => "Seqfeature", :order=>'rank'
10
- has_many :bioentry_references, :class_name=>"BioentryReference" #, :foreign_key => "bioentry_id"
11
- has_many :bioentry_dbxrefs, :class_name => "BioentryDbxref"
12
- has_many :object_bioentry_relationships, :class_name=>"BioentryRelationship", :foreign_key=>"object_bioentry_id" #non mi convince molto credo non funzioni nel modo corretto
13
- has_many :subject_bioentry_relationships, :class_name=>"BioentryRelationship", :foreign_key=>"subject_bioentry_id" #non mi convince molto credo non funzioni nel modo corretto
14
-
15
- has_many :cdsfeatures, :class_name=>"Seqfeature", :foreign_key =>"bioentry_id", :conditions=>["term.name='CDS'"], :include=>"type_term"
16
-
17
- has_many :terms, :through=>:bioentry_qualifier_values, :class_name => "Term"
18
- #NOTE: added order_by for multiple hit and manage ranks correctly
19
- has_many :bioentry_qualifier_values, :order=>"bioentry_id,term_id,rank", :class_name => "BioentryQualifierValue"
20
-
21
- #per la creazione richiesti:
22
- #name, accession, version
23
- # validates_uniqueness_of :accession, :scope=>[:biodatabase_id]
24
- # validates_uniqueness_of :name, :scope=>[:biodatabase_id]
25
- # validates_uniqueness_of :identifier, :scope=>[:biodatabase_id]
26
-
27
- end
28
- end #SQL
29
- end #Bio