bio 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +56 -0
- data/COPYING.ja +51 -0
- data/ChangeLog +540 -0
- data/GPL +340 -0
- data/LEGAL +141 -0
- data/LGPL +504 -0
- data/README.rdoc +4 -2
- data/Rakefile +2 -2
- data/bioruby.gemspec +17 -29
- data/doc/Tutorial.rd +118 -90
- data/doc/Tutorial.rd.html +124 -87
- data/lib/bio/appl/blast.rb +2 -2
- data/lib/bio/appl/blast/format0.rb +1 -1
- data/lib/bio/appl/fasta.rb +5 -12
- data/lib/bio/appl/fasta/format10.rb +96 -6
- data/lib/bio/appl/gcg/msf.rb +11 -14
- data/lib/bio/appl/pts1.rb +0 -4
- data/lib/bio/appl/sim4/report.rb +50 -17
- data/lib/bio/db/biosql/biosql_to_biosequence.rb +10 -0
- data/lib/bio/db/biosql/sequence.rb +234 -298
- data/lib/bio/db/embl/embl.rb +0 -3
- data/lib/bio/db/genbank/common.rb +3 -1
- data/lib/bio/io/biosql/ar-biosql.rb +257 -0
- data/lib/bio/io/biosql/biosql.rb +39 -0
- data/lib/bio/io/biosql/config/database.yml +5 -4
- data/lib/bio/io/ncbirest.rb +12 -5
- data/lib/bio/io/pubmed.rb +5 -1
- data/lib/bio/io/sql.rb +43 -150
- data/lib/bio/sequence/compat.rb +5 -1
- data/lib/bio/util/restriction_enzyme/range/sequence_range/calculated_cuts.rb +6 -4
- data/lib/bio/version.rb +1 -1
- data/test/data/gcg/pileup-aa.msf +67 -0
- data/test/data/sim4/complement-A4.sim4 +43 -0
- data/test/data/sim4/simple-A4.sim4 +25 -0
- data/test/data/sim4/simple2-A4.sim4 +25 -0
- data/test/functional/bio/io/test_pubmed.rb +129 -0
- data/test/unit/bio/appl/bl2seq/test_report.rb +5 -5
- data/test/unit/bio/appl/gcg/test_msf.rb +154 -0
- data/test/unit/bio/appl/hmmer/test_report.rb +2 -2
- data/test/unit/bio/appl/sim4/test_report.rb +869 -0
- data/test/unit/bio/appl/test_blast.rb +1 -1
- data/test/unit/bio/db/biosql/tc_biosql.rb +110 -0
- data/test/unit/bio/db/biosql/ts_suite_biosql.rb +8 -0
- data/test/unit/bio/test_feature.rb +18 -17
- data/test/unit/bio/test_reference.rb +18 -18
- data/test/unit/bio/test_sequence.rb +1 -1
- metadata +18 -30
- data/lib/bio/io/biosql/biodatabase.rb +0 -64
- data/lib/bio/io/biosql/bioentry.rb +0 -29
- data/lib/bio/io/biosql/bioentry_dbxref.rb +0 -11
- data/lib/bio/io/biosql/bioentry_path.rb +0 -12
- data/lib/bio/io/biosql/bioentry_qualifier_value.rb +0 -10
- data/lib/bio/io/biosql/bioentry_reference.rb +0 -10
- data/lib/bio/io/biosql/bioentry_relationship.rb +0 -10
- data/lib/bio/io/biosql/biosequence.rb +0 -11
- data/lib/bio/io/biosql/comment.rb +0 -7
- data/lib/bio/io/biosql/dbxref.rb +0 -13
- data/lib/bio/io/biosql/dbxref_qualifier_value.rb +0 -12
- data/lib/bio/io/biosql/location.rb +0 -32
- data/lib/bio/io/biosql/location_qualifier_value.rb +0 -11
- data/lib/bio/io/biosql/ontology.rb +0 -10
- data/lib/bio/io/biosql/reference.rb +0 -9
- data/lib/bio/io/biosql/seqfeature.rb +0 -32
- data/lib/bio/io/biosql/seqfeature_dbxref.rb +0 -11
- data/lib/bio/io/biosql/seqfeature_path.rb +0 -11
- data/lib/bio/io/biosql/seqfeature_qualifier_value.rb +0 -20
- data/lib/bio/io/biosql/seqfeature_relationship.rb +0 -11
- data/lib/bio/io/biosql/taxon.rb +0 -12
- data/lib/bio/io/biosql/taxon_name.rb +0 -9
- data/lib/bio/io/biosql/term.rb +0 -27
- data/lib/bio/io/biosql/term_dbxref.rb +0 -11
- data/lib/bio/io/biosql/term_path.rb +0 -12
- data/lib/bio/io/biosql/term_relationship.rb +0 -13
- data/lib/bio/io/biosql/term_relationship_term.rb +0 -11
- data/lib/bio/io/biosql/term_synonym.rb +0 -10
@@ -1,11 +0,0 @@
|
|
1
|
-
module Bio
|
2
|
-
class SQL
|
3
|
-
class BioentryDbxref < DummyBase
|
4
|
-
#delete set_sequence_name nil
|
5
|
-
set_primary_key nil #bioentry_id,dbxref_id
|
6
|
-
belongs_to :bioentry, :class_name => "Bioentry"
|
7
|
-
belongs_to :dbxref, :class_name => "Dbxref"
|
8
|
-
end
|
9
|
-
end #SQL
|
10
|
-
end #Bio
|
11
|
-
|
@@ -1,12 +0,0 @@
|
|
1
|
-
module Bio
|
2
|
-
class SQL
|
3
|
-
class BioentryPath < DummyBase
|
4
|
-
set_primary_key nil
|
5
|
-
#delete set_sequence_name nil
|
6
|
-
belongs_to :term, :class_name => "Term"
|
7
|
-
#da sistemare per poter procedere.
|
8
|
-
belongs_to :object_bioentry, :class_name=>"Bioentry"
|
9
|
-
belongs_to :subject_bioentry, :class_name=>"Bioentry"
|
10
|
-
end #BioentryPath
|
11
|
-
end #SQL
|
12
|
-
end #Bio
|
@@ -1,10 +0,0 @@
|
|
1
|
-
module Bio
|
2
|
-
class SQL
|
3
|
-
class BioentryQualifierValue < DummyBase
|
4
|
-
#NOTE: added rank to primary_keys, now it's finished.
|
5
|
-
set_primary_keys :bioentry_id, :term_id, :rank
|
6
|
-
belongs_to :bioentry, :class_name => "Bioentry"
|
7
|
-
belongs_to :term, :class_name => "Term"
|
8
|
-
end #BioentryQualifierValue
|
9
|
-
end #SQL
|
10
|
-
end #Bio
|
@@ -1,10 +0,0 @@
|
|
1
|
-
module Bio
|
2
|
-
class SQL
|
3
|
-
class BioentryRelationship < DummyBase
|
4
|
-
#delete set_primary_key "bioentry_relationship_id"
|
5
|
-
set_sequence_name "bieontry_relationship_pk_seq"
|
6
|
-
belongs_to :object_bioentry, :class_name => "Bioentry"
|
7
|
-
belongs_to :subject_bioentry, :class_name => "Bioentry"
|
8
|
-
end
|
9
|
-
end #SQL
|
10
|
-
end #Bio
|
@@ -1,11 +0,0 @@
|
|
1
|
-
module Bio
|
2
|
-
class SQL
|
3
|
-
class Biosequence < DummyBase
|
4
|
-
set_primary_key "bioentry_id"
|
5
|
-
#delete set_sequence_name "biosequence_pk_seq"
|
6
|
-
belongs_to :bioentry, :foreign_key=>"bioentry_id"
|
7
|
-
#has_one :bioentry
|
8
|
-
#, :class_name => "Bioentry"
|
9
|
-
end
|
10
|
-
end #SQL
|
11
|
-
end #Bio
|
data/lib/bio/io/biosql/dbxref.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
module Bio
|
2
|
-
class SQL
|
3
|
-
class Dbxref < DummyBase
|
4
|
-
#set_sequence_name "dbxref_pk_seq"
|
5
|
-
has_many :dbxref_qualifier_values, :class_name => "DbxrefQualifierValue"
|
6
|
-
has_many :locations, :class_name => "Location"
|
7
|
-
has_many :references, :class_name=>"Reference"
|
8
|
-
has_many :term_dbxrefs, :class_name => "TermDbxref"
|
9
|
-
has_many :bioentry_dbxrefs, :class_name => "BioentryDbxref"
|
10
|
-
#TODO: check is with bioentry there is an has_and_belongs_to_many relationship has specified in schema overview.
|
11
|
-
end
|
12
|
-
end #SQL
|
13
|
-
end #Bio
|
@@ -1,12 +0,0 @@
|
|
1
|
-
module Bio
|
2
|
-
class SQL
|
3
|
-
class DbxrefQualifierValue < DummyBase
|
4
|
-
#think to use composite primary key
|
5
|
-
set_primary_key nil #dbxref_id, term_id, rank
|
6
|
-
#delete set_sequence_name nil
|
7
|
-
belongs_to :dbxref, :class_name => "Dbxref"
|
8
|
-
belongs_to :term, :class_name => "Term"
|
9
|
-
end
|
10
|
-
end #SQL
|
11
|
-
end #Bio
|
12
|
-
|
@@ -1,32 +0,0 @@
|
|
1
|
-
module Bio
|
2
|
-
class SQL
|
3
|
-
class Location < DummyBase
|
4
|
-
#set_sequence_name "location_pk_seq"
|
5
|
-
belongs_to :seqfeature, :class_name => "Seqfeature"
|
6
|
-
belongs_to :dbxref, :class_name => "Dbxref"
|
7
|
-
belongs_to :term, :class_name => "Term"
|
8
|
-
has_many :location_qualifier_values, :class_name => "LocationQualifierValue"
|
9
|
-
|
10
|
-
def to_s
|
11
|
-
if strand==-1
|
12
|
-
str="complement("+start_pos.to_s+".."+end_pos.to_s+")"
|
13
|
-
else
|
14
|
-
str=start_pos.to_s+".."+end_pos.to_s
|
15
|
-
end
|
16
|
-
return str
|
17
|
-
end
|
18
|
-
|
19
|
-
def sequence
|
20
|
-
seq=""
|
21
|
-
unless self.seqfeature.bioentry.biosequence.seq.nil?
|
22
|
-
seq=Bio::Sequence::NA.new(self.seqfeature.bioentry.biosequence.seq[start_pos-1..end_pos-1])
|
23
|
-
seq.reverse_complement! if strand==-1
|
24
|
-
end
|
25
|
-
return seq
|
26
|
-
end
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
end
|
31
|
-
end #SQL
|
32
|
-
end #Bio
|
@@ -1,11 +0,0 @@
|
|
1
|
-
module Bio
|
2
|
-
class SQL
|
3
|
-
class LocationQualifierValue < DummyBase
|
4
|
-
set_primary_key nil #location_id, term_id
|
5
|
-
#delete set_sequence_name nil
|
6
|
-
belongs_to :location, :class_name => "Location"
|
7
|
-
belongs_to :term, :class_name => "Term"
|
8
|
-
end
|
9
|
-
end #SQL
|
10
|
-
end #Bio
|
11
|
-
|
@@ -1,32 +0,0 @@
|
|
1
|
-
|
2
|
-
module Bio
|
3
|
-
class SQL
|
4
|
-
class Seqfeature <DummyBase
|
5
|
-
set_sequence_name "seqfeature_pk_seq"
|
6
|
-
belongs_to :bioentry
|
7
|
-
#, :class_name => "Bioentry"
|
8
|
-
belongs_to :type_term, :class_name => "Term", :foreign_key => "type_term_id"
|
9
|
-
belongs_to :source_term, :class_name => "Term", :foreign_key =>"source_term_id"
|
10
|
-
has_many :seqfeature_dbxrefs, :class_name => "SeqfeatureDbxref", :foreign_key => "seqfeature_id"
|
11
|
-
has_many :seqfeature_qualifier_values, :order=>'rank', :foreign_key => "seqfeature_id"
|
12
|
-
#, :class_name => "SeqfeatureQualifierValue"
|
13
|
-
has_many :locations, :class_name => "Location", :order=>'rank'
|
14
|
-
has_many :object_seqfeature_paths, :class_name => "SeqfeaturePath", :foreign_key => "object_seqfeature_id"
|
15
|
-
has_many :subject_seqfeature_paths, :class_name => "SeqfeaturePath", :foreign_key => "subject_seqfeature_id"
|
16
|
-
has_many :object_seqfeature_relationships, :class_name => "SeqfeatureRelationship", :foreign_key => "object_seqfeature_id"
|
17
|
-
has_many :subject_seqfeature_relationships, :class_name => "SeqfeatureRelationship", :foreign_key => "subject_seqfeature_id"
|
18
|
-
|
19
|
-
#get the subsequence described by the locations objects
|
20
|
-
def sequence
|
21
|
-
return self.locations.inject(Bio::Sequence::NA.new("")){|seq, location| seq<<location.sequence}
|
22
|
-
end
|
23
|
-
|
24
|
-
#translate the subsequences represented by the feature and its locations
|
25
|
-
#not considering the qualifiers
|
26
|
-
#Return a Bio::Sequence::AA object
|
27
|
-
def translate(*args)
|
28
|
-
self.sequence.translate(*args)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end #SQL
|
32
|
-
end #Bio
|
@@ -1,11 +0,0 @@
|
|
1
|
-
|
2
|
-
module Bio
|
3
|
-
class SQL
|
4
|
-
class SeqfeatureDbxref < DummyBase
|
5
|
-
set_primary_keys :seqfeature_id, :dbxref_id
|
6
|
-
#delete set_sequence_name nil
|
7
|
-
belongs_to :seqfeature, :class_name => "Seqfeature", :foreign_key => "seqfeature_id"
|
8
|
-
belongs_to :dbxref, :class_name => "Dbxref", :foreign_key => "dbxref_id"
|
9
|
-
end
|
10
|
-
end #SQL
|
11
|
-
end #Bio
|
@@ -1,11 +0,0 @@
|
|
1
|
-
module Bio
|
2
|
-
class SQL
|
3
|
-
class SeqfeaturePath < DummyBase
|
4
|
-
set_primary_keys :object_seqfeature_id, :subject_seqfeature_id, :term_id
|
5
|
-
set_sequence_name nil
|
6
|
-
belongs_to :object_seqfeature, :class_name => "Seqfeature", :foreign_key => "object_seqfeature_id"
|
7
|
-
belongs_to :subject_seqfeature, :class_name => "Seqfeature", :foreign_key => "subject_seqfeature_id"
|
8
|
-
belongs_to :term, :class_name => "Term"
|
9
|
-
end
|
10
|
-
end #SQL
|
11
|
-
end #Bio
|
@@ -1,20 +0,0 @@
|
|
1
|
-
|
2
|
-
module Bio
|
3
|
-
class SQL
|
4
|
-
class SeqfeatureQualifierValue < DummyBase
|
5
|
-
set_primary_keys :seqfeature_id, :term_id, :rank
|
6
|
-
set_sequence_name nil
|
7
|
-
belongs_to :seqfeature
|
8
|
-
belongs_to :term, :class_name => "Term"
|
9
|
-
|
10
|
-
def self.find_cluster(query)
|
11
|
-
term_note= Term.find_by_name('note')
|
12
|
-
find(:all, :conditions =>["value like ? and term_id = ?", "cl:#{query}", term_note])
|
13
|
-
end
|
14
|
-
def self.find_cluster_info(query)
|
15
|
-
term_note= Term.find_by_name('note')
|
16
|
-
find(:all, :conditions =>["value like ? and term_id = ?", "cli:#{query}", term_note])
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end #SQL
|
20
|
-
end #Bio
|
@@ -1,11 +0,0 @@
|
|
1
|
-
|
2
|
-
module Bio
|
3
|
-
class SQL
|
4
|
-
class SeqfeatureRelationship <DummyBase
|
5
|
-
set_sequence_name "seqfeatue_relationship_pk_seq"
|
6
|
-
belongs_to :term, :class_name => "Term"
|
7
|
-
belongs_to :object_seqfeature, :class_name => "Seqfeature"
|
8
|
-
belongs_to :subject_seqfeature, :class_name => "Seqfeature"
|
9
|
-
end
|
10
|
-
end #SQL
|
11
|
-
end #Bio
|
data/lib/bio/io/biosql/taxon.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
|
2
|
-
module Bio
|
3
|
-
class SQL
|
4
|
-
class Taxon < DummyBase
|
5
|
-
set_sequence_name "taxon_pk_seq"
|
6
|
-
has_many :taxon_names, :class_name => "TaxonName"
|
7
|
-
has_one :taxon_scientific_name, :class_name => "TaxonName", :conditions=>"name_class = 'scientific name'"
|
8
|
-
has_one :taxon_genbank_common_name, :class_name => "TaxonName", :conditions=>"name_class = 'genbank common name'"
|
9
|
-
has_one :bioentry, :class_name => "Bioentry"
|
10
|
-
end
|
11
|
-
end #SQL
|
12
|
-
end #Bio
|
data/lib/bio/io/biosql/term.rb
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
|
2
|
-
module Bio
|
3
|
-
class SQL
|
4
|
-
class Term < DummyBase
|
5
|
-
belongs_to :ontology, :class_name => "Ontology"
|
6
|
-
has_many :seqfeature_qualifier_values, :class_name => "SeqfeatureQualifierValue"
|
7
|
-
has_many :dbxref_qualifier_values, :class_name => "DbxrefQualifierValue"
|
8
|
-
has_many :bioentry_qualifer_values, :class_name => "BioentryQualifierValue"
|
9
|
-
has_many :bioentries, :through=>:bioentry_qualifier_values
|
10
|
-
has_many :locations, :class_name => "Location"
|
11
|
-
has_many :seqfeature_relationships, :class_name => "SeqfeatureRelationship"
|
12
|
-
has_many :term_dbxrefs, :class_name => "TermDbxref"
|
13
|
-
has_many :term_relationship_terms, :class_name => "TermRelationshipTerm"
|
14
|
-
has_many :term_synonyms, :class_name => "TermSynonym"
|
15
|
-
has_many :location_qualifier_values, :class_name => "LocationQualifierValue"
|
16
|
-
has_many :seqfeature_types, :class_name => "Seqfeature", :foreign_key => "type_term_id"
|
17
|
-
has_many :seqfeature_sources, :class_name => "Seqfeature", :foreign_key => "source_term_id"
|
18
|
-
has_many :term_path_subjects, :class_name => "TermPath", :foreign_key => "subject_term_id"
|
19
|
-
has_many :term_path_predicates, :class_name => "TermPath", :foreign_key => "predicate_term_id"
|
20
|
-
has_many :term_path_objects, :class_name => "TermPath", :foreign_key => "object_term_id"
|
21
|
-
has_many :term_relationship_subjects, :class_name => "TermRelationship", :foreign_key =>"subject_term_id"
|
22
|
-
has_many :term_relationship_predicates, :class_name => "TermRelationship", :foreign_key =>"predicate_term_id"
|
23
|
-
has_many :term_relationship_objects, :class_name => "TermRelationship", :foreign_key =>"object_term_id"
|
24
|
-
has_many :seqfeature_paths, :class_name => "SeqfeaturePath"
|
25
|
-
end
|
26
|
-
end #SQL
|
27
|
-
end #Bio
|
@@ -1,12 +0,0 @@
|
|
1
|
-
|
2
|
-
module Bio
|
3
|
-
class SQL
|
4
|
-
class TermPath < DummyBase
|
5
|
-
set_sequence_name "term_path_pk_seq"
|
6
|
-
belongs_to :ontology, :class_name => "Ontology"
|
7
|
-
belongs_to :subject_term, :class_name => "Term"
|
8
|
-
belongs_to :object_term, :class_name => "Term"
|
9
|
-
belongs_to :predicate_term, :class_name => "Term"
|
10
|
-
end
|
11
|
-
end #SQL
|
12
|
-
end #Bio
|
@@ -1,13 +0,0 @@
|
|
1
|
-
|
2
|
-
module Bio
|
3
|
-
class SQL
|
4
|
-
class TermRelationship < DummyBase
|
5
|
-
set_sequence_name "term_relationship_pk_seq"
|
6
|
-
belongs_to :ontology, :class_name => "Ontology"
|
7
|
-
belongs_to :subject_term, :class_name => "Term"
|
8
|
-
belongs_to :predicate_term, :class_name => "Term"
|
9
|
-
belongs_to :object_term, :class_name => "Term"
|
10
|
-
has_one :term_relationship_term, :class_name => "TermRelationshipTerm"
|
11
|
-
end
|
12
|
-
end #SQL
|
13
|
-
end #Bio
|
@@ -1,11 +0,0 @@
|
|
1
|
-
|
2
|
-
module Bio
|
3
|
-
class SQL
|
4
|
-
class TermRelationshipTerm < DummyBase
|
5
|
-
#delete set_sequence_name nil
|
6
|
-
set_primary_key :term_relationship_id
|
7
|
-
belongs_to :term_relationship, :class_name => "TermRelationship"
|
8
|
-
belongs_to :term, :class_name => "Term"
|
9
|
-
end
|
10
|
-
end #SQL
|
11
|
-
end #Bio
|