bio 1.2.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +3421 -0
- data/KNOWN_ISSUES.rdoc +88 -0
- data/README.rdoc +252 -0
- data/README_DEV.rdoc +285 -0
- data/Rakefile +143 -0
- data/bin/bioruby +0 -0
- data/bin/br_biofetch.rb +0 -0
- data/bin/br_bioflat.rb +12 -1
- data/bin/br_biogetseq.rb +0 -0
- data/bin/br_pmfetch.rb +4 -3
- data/bioruby.gemspec +477 -0
- data/bioruby.gemspec.erb +117 -0
- data/doc/Changes-0.7.rd +7 -0
- data/doc/Changes-1.3.rdoc +239 -0
- data/doc/Tutorial.rd +296 -184
- data/doc/Tutorial.rd.html +1031 -0
- data/doc/Tutorial.rd.ja +111 -45
- data/doc/Tutorial.rd.ja.html +2225 -0
- data/doc/bioruby.css +281 -0
- data/extconf.rb +2 -0
- data/lib/bio.rb +29 -4
- data/lib/bio/appl/blast.rb +306 -121
- data/lib/bio/appl/blast/ddbj.rb +142 -0
- data/lib/bio/appl/blast/format0.rb +35 -25
- data/lib/bio/appl/blast/format8.rb +2 -2
- data/lib/bio/appl/blast/genomenet.rb +263 -0
- data/lib/bio/appl/blast/ncbioptions.rb +220 -0
- data/lib/bio/appl/blast/remote.rb +106 -0
- data/lib/bio/appl/blast/report.rb +260 -9
- data/lib/bio/appl/blast/rexml.rb +12 -5
- data/lib/bio/appl/blast/rpsblast.rb +277 -0
- data/lib/bio/appl/blast/wublast.rb +133 -12
- data/lib/bio/appl/blast/xmlparser.rb +35 -18
- data/lib/bio/appl/blat/report.rb +46 -5
- data/lib/bio/appl/emboss.rb +62 -13
- data/lib/bio/appl/fasta.rb +9 -11
- data/lib/bio/appl/genscan/report.rb +3 -3
- data/lib/bio/appl/hmmer.rb +1 -1
- data/lib/bio/appl/hmmer/report.rb +10 -10
- data/lib/bio/appl/paml/baseml.rb +95 -0
- data/lib/bio/appl/paml/baseml/report.rb +32 -0
- data/lib/bio/appl/paml/codeml.rb +242 -0
- data/lib/bio/appl/paml/codeml/rates.rb +67 -0
- data/lib/bio/appl/paml/codeml/report.rb +67 -0
- data/lib/bio/appl/paml/common.rb +348 -0
- data/lib/bio/appl/paml/common_report.rb +38 -0
- data/lib/bio/appl/paml/yn00.rb +103 -0
- data/lib/bio/appl/paml/yn00/report.rb +32 -0
- data/lib/bio/appl/psort.rb +2 -2
- data/lib/bio/appl/pts1.rb +5 -5
- data/lib/bio/appl/tmhmm/report.rb +10 -1
- data/lib/bio/command.rb +297 -41
- data/lib/bio/compat/features.rb +157 -0
- data/lib/bio/compat/references.rb +128 -0
- data/lib/bio/db/biosql/biosql_to_biosequence.rb +67 -0
- data/lib/bio/db/biosql/sequence.rb +508 -0
- data/lib/bio/db/embl/common.rb +28 -12
- data/lib/bio/db/embl/embl.rb +107 -9
- data/lib/bio/db/embl/embl_to_biosequence.rb +85 -0
- data/lib/bio/db/embl/format_embl.rb +190 -0
- data/lib/bio/db/embl/sptr.rb +15 -16
- data/lib/bio/db/fantom.rb +6 -8
- data/lib/bio/db/fasta.rb +10 -507
- data/lib/bio/db/fasta/defline.rb +532 -0
- data/lib/bio/db/fasta/fasta_to_biosequence.rb +63 -0
- data/lib/bio/db/fasta/format_fasta.rb +97 -0
- data/lib/bio/db/genbank/common.rb +25 -8
- data/lib/bio/db/genbank/format_genbank.rb +187 -0
- data/lib/bio/db/genbank/genbank.rb +36 -1
- data/lib/bio/db/genbank/genbank_to_biosequence.rb +86 -0
- data/lib/bio/db/gff.rb +1791 -119
- data/lib/bio/db/kegg/glycan.rb +2 -6
- data/lib/bio/db/lasergene.rb +3 -3
- data/lib/bio/db/medline.rb +4 -1
- data/lib/bio/db/newick.rb +10 -10
- data/lib/bio/db/pdb/chain.rb +6 -2
- data/lib/bio/db/pdb/pdb.rb +12 -3
- data/lib/bio/db/rebase.rb +7 -8
- data/lib/bio/db/soft.rb +3 -3
- data/lib/bio/feature.rb +1 -88
- data/lib/bio/io/biosql/biodatabase.rb +64 -0
- data/lib/bio/io/biosql/bioentry.rb +29 -0
- data/lib/bio/io/biosql/bioentry_dbxref.rb +11 -0
- data/lib/bio/io/biosql/bioentry_path.rb +12 -0
- data/lib/bio/io/biosql/bioentry_qualifier_value.rb +10 -0
- data/lib/bio/io/biosql/bioentry_reference.rb +10 -0
- data/lib/bio/io/biosql/bioentry_relationship.rb +10 -0
- data/lib/bio/io/biosql/biosequence.rb +11 -0
- data/lib/bio/io/biosql/comment.rb +7 -0
- data/lib/bio/io/biosql/config/database.yml +20 -0
- data/lib/bio/io/biosql/dbxref.rb +13 -0
- data/lib/bio/io/biosql/dbxref_qualifier_value.rb +12 -0
- data/lib/bio/io/biosql/location.rb +32 -0
- data/lib/bio/io/biosql/location_qualifier_value.rb +11 -0
- data/lib/bio/io/biosql/ontology.rb +10 -0
- data/lib/bio/io/biosql/reference.rb +9 -0
- data/lib/bio/io/biosql/seqfeature.rb +32 -0
- data/lib/bio/io/biosql/seqfeature_dbxref.rb +11 -0
- data/lib/bio/io/biosql/seqfeature_path.rb +11 -0
- data/lib/bio/io/biosql/seqfeature_qualifier_value.rb +20 -0
- data/lib/bio/io/biosql/seqfeature_relationship.rb +11 -0
- data/lib/bio/io/biosql/taxon.rb +12 -0
- data/lib/bio/io/biosql/taxon_name.rb +9 -0
- data/lib/bio/io/biosql/term.rb +27 -0
- data/lib/bio/io/biosql/term_dbxref.rb +11 -0
- data/lib/bio/io/biosql/term_path.rb +12 -0
- data/lib/bio/io/biosql/term_relationship.rb +13 -0
- data/lib/bio/io/biosql/term_relationship_term.rb +11 -0
- data/lib/bio/io/biosql/term_synonym.rb +10 -0
- data/lib/bio/io/das.rb +7 -7
- data/lib/bio/io/ddbjxml.rb +57 -0
- data/lib/bio/io/ensembl.rb +2 -2
- data/lib/bio/io/fetch.rb +28 -14
- data/lib/bio/io/flatfile.rb +17 -853
- data/lib/bio/io/flatfile/autodetection.rb +545 -0
- data/lib/bio/io/flatfile/buffer.rb +237 -0
- data/lib/bio/io/flatfile/index.rb +17 -7
- data/lib/bio/io/flatfile/indexer.rb +30 -12
- data/lib/bio/io/flatfile/splitter.rb +297 -0
- data/lib/bio/io/hinv.rb +442 -0
- data/lib/bio/io/keggapi.rb +2 -2
- data/lib/bio/io/ncbirest.rb +733 -0
- data/lib/bio/io/pubmed.rb +34 -80
- data/lib/bio/io/registry.rb +2 -2
- data/lib/bio/io/sql.rb +178 -357
- data/lib/bio/io/togows.rb +458 -0
- data/lib/bio/location.rb +106 -11
- data/lib/bio/pathway.rb +120 -14
- data/lib/bio/reference.rb +115 -101
- data/lib/bio/sequence.rb +164 -183
- data/lib/bio/sequence/adapter.rb +108 -0
- data/lib/bio/sequence/common.rb +22 -45
- data/lib/bio/sequence/compat.rb +2 -2
- data/lib/bio/sequence/dblink.rb +54 -0
- data/lib/bio/sequence/format.rb +254 -77
- data/lib/bio/sequence/format_raw.rb +23 -0
- data/lib/bio/shell.rb +3 -1
- data/lib/bio/shell/core.rb +2 -2
- data/lib/bio/shell/plugin/entry.rb +33 -4
- data/lib/bio/shell/plugin/ncbirest.rb +64 -0
- data/lib/bio/shell/plugin/togows.rb +40 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/bioruby_generator.rb +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/_classes.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/_log.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/_methods.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/_modules.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/_variables.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/bioruby-bg.gif +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/bioruby-gem.png +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/bioruby-link.gif +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/bioruby.css +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/bioruby.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/bioruby_controller.rb +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/bioruby_helper.rb +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/commands.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/history.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/index.rhtml +0 -0
- data/lib/bio/shell/rails/vendor/plugins/{generators → bioruby/generators}/bioruby/templates/spinner.gif +0 -0
- data/lib/bio/tree.rb +4 -2
- data/lib/bio/util/color_scheme.rb +2 -2
- data/lib/bio/util/contingency_table.rb +2 -2
- data/lib/bio/util/restriction_enzyme.rb +2 -2
- data/lib/bio/util/restriction_enzyme/single_strand.rb +6 -5
- data/lib/bio/version.rb +25 -0
- data/rdoc.zsh +8 -0
- data/sample/any2fasta.rb +0 -0
- data/sample/biofetch.rb +0 -0
- data/sample/dbget +0 -0
- data/sample/demo_sequence.rb +158 -0
- data/sample/enzymes.rb +0 -0
- data/sample/fasta2tab.rb +0 -0
- data/sample/fastagrep.rb +72 -0
- data/sample/fastasort.rb +54 -0
- data/sample/fsplit.rb +0 -0
- data/sample/gb2fasta.rb +2 -3
- data/sample/gb2tab.rb +0 -0
- data/sample/gbtab2mysql.rb +0 -0
- data/sample/genes2nuc.rb +0 -0
- data/sample/genes2pep.rb +0 -0
- data/sample/genes2tab.rb +0 -0
- data/sample/genome2rb.rb +0 -0
- data/sample/genome2tab.rb +0 -0
- data/sample/goslim.rb +0 -0
- data/sample/gt2fasta.rb +0 -0
- data/sample/na2aa.rb +34 -0
- data/sample/pmfetch.rb +0 -0
- data/sample/pmsearch.rb +0 -0
- data/sample/ssearch2tab.rb +0 -0
- data/sample/tfastx2tab.rb +0 -0
- data/sample/vs-genes.rb +0 -0
- data/setup.rb +1596 -0
- data/test/data/blast/blastp-multi.m7 +188 -0
- data/test/data/command/echoarg2.bat +1 -0
- data/test/data/paml/codeml/control_file.txt +30 -0
- data/test/data/paml/codeml/output.txt +78 -0
- data/test/data/paml/codeml/rates +217 -0
- data/test/data/rpsblast/misc.rpsblast +193 -0
- data/test/data/soft/GDS100_partial.soft +0 -0
- data/test/data/soft/GSE3457_family_partial.soft +0 -0
- data/test/functional/bio/appl/test_pts1.rb +115 -0
- data/test/functional/bio/io/test_ensembl.rb +123 -80
- data/test/functional/bio/io/test_togows.rb +267 -0
- data/test/functional/bio/sequence/test_output_embl.rb +51 -0
- data/test/functional/bio/test_command.rb +301 -0
- data/test/runner.rb +17 -1
- data/test/unit/bio/appl/blast/test_ncbioptions.rb +112 -0
- data/test/unit/bio/appl/blast/test_report.rb +753 -35
- data/test/unit/bio/appl/blast/test_rpsblast.rb +398 -0
- data/test/unit/bio/appl/paml/codeml/test_rates.rb +45 -0
- data/test/unit/bio/appl/paml/codeml/test_report.rb +45 -0
- data/test/unit/bio/appl/paml/test_codeml.rb +174 -0
- data/test/unit/bio/appl/test_blast.rb +135 -4
- data/test/unit/bio/appl/test_fasta.rb +2 -2
- data/test/unit/bio/appl/test_pts1.rb +1 -64
- data/test/unit/bio/db/embl/test_common.rb +15 -15
- data/test/unit/bio/db/embl/test_embl.rb +4 -4
- data/test/unit/bio/db/embl/test_embl_rel89.rb +5 -5
- data/test/unit/bio/db/embl/test_embl_to_bioseq.rb +203 -0
- data/test/unit/bio/db/embl/test_sptr.rb +38 -1
- data/test/unit/bio/db/pdb/test_pdb.rb +2 -2
- data/test/unit/bio/db/test_gff.rb +1151 -25
- data/test/unit/bio/db/test_medline.rb +127 -0
- data/test/unit/bio/db/test_nexus.rb +5 -1
- data/test/unit/bio/db/test_prosite.rb +4 -4
- data/test/unit/bio/io/flatfile/test_autodetection.rb +375 -0
- data/test/unit/bio/io/flatfile/test_buffer.rb +251 -0
- data/test/unit/bio/io/flatfile/test_splitter.rb +369 -0
- data/test/unit/bio/io/test_ddbjxml.rb +8 -3
- data/test/unit/bio/io/test_fastacmd.rb +5 -5
- data/test/unit/bio/io/test_flatfile.rb +357 -106
- data/test/unit/bio/io/test_soapwsdl.rb +2 -2
- data/test/unit/bio/io/test_togows.rb +161 -0
- data/test/unit/bio/sequence/test_common.rb +210 -11
- data/test/unit/bio/sequence/test_compat.rb +3 -3
- data/test/unit/bio/sequence/test_dblink.rb +58 -0
- data/test/unit/bio/sequence/test_na.rb +2 -2
- data/test/unit/bio/test_command.rb +111 -50
- data/test/unit/bio/test_feature.rb +29 -1
- data/test/unit/bio/test_location.rb +566 -6
- data/test/unit/bio/test_pathway.rb +91 -65
- data/test/unit/bio/test_reference.rb +67 -13
- data/test/unit/bio/util/restriction_enzyme/analysis/test_calculated_cuts.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/analysis/test_cut_ranges.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/analysis/test_sequence_range.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_aligned_strands.rb +4 -3
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair_in_enzyme_notation.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations_in_enzyme_notation.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/single_strand/test_cut_locations_in_enzyme_notation.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/test_analysis.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/test_cut_symbol.rb +4 -4
- data/test/unit/bio/util/restriction_enzyme/test_double_stranded.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/test_single_strand.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/test_single_strand_complement.rb +3 -3
- data/test/unit/bio/util/restriction_enzyme/test_string_formatting.rb +3 -3
- data/test/unit/bio/util/test_restriction_enzyme.rb +3 -3
- metadata +202 -167
- data/test/unit/bio/appl/blast/test_xmlparser.rb +0 -388
@@ -0,0 +1,10 @@
|
|
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
|
@@ -0,0 +1,10 @@
|
|
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
|
@@ -0,0 +1,11 @@
|
|
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
|
@@ -0,0 +1,20 @@
|
|
1
|
+
#This is the database configuration specific for BioSQL
|
2
|
+
#User can configure it's db here
|
3
|
+
|
4
|
+
development:
|
5
|
+
adapter: postgresql
|
6
|
+
database: biorails_development
|
7
|
+
username: rails
|
8
|
+
password:
|
9
|
+
|
10
|
+
test:
|
11
|
+
adapter: postgresql
|
12
|
+
database: biorails_test
|
13
|
+
username: rails
|
14
|
+
password:
|
15
|
+
|
16
|
+
production:
|
17
|
+
adapter: postgresql
|
18
|
+
database: biorails_production
|
19
|
+
username: rails
|
20
|
+
password:
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,12 @@
|
|
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
|
+
|
@@ -0,0 +1,32 @@
|
|
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
|
@@ -0,0 +1,11 @@
|
|
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
|
+
|
@@ -0,0 +1,32 @@
|
|
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
|
@@ -0,0 +1,11 @@
|
|
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
|
@@ -0,0 +1,11 @@
|
|
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
|
@@ -0,0 +1,20 @@
|
|
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
|
@@ -0,0 +1,11 @@
|
|
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
|
@@ -0,0 +1,12 @@
|
|
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
|
@@ -0,0 +1,27 @@
|
|
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
|
@@ -0,0 +1,12 @@
|
|
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
|
@@ -0,0 +1,13 @@
|
|
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
|
@@ -0,0 +1,11 @@
|
|
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
|
data/lib/bio/io/das.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
# Toshiaki Katayama <k@bioruby.org>
|
7
7
|
# License:: The Ruby License
|
8
8
|
#
|
9
|
-
# $Id
|
9
|
+
# $Id:$
|
10
10
|
#
|
11
11
|
#--
|
12
12
|
# == TODO
|
@@ -47,7 +47,7 @@ class DAS
|
|
47
47
|
# Returns an Array of Bio::DAS::DSN
|
48
48
|
def get_dsn
|
49
49
|
ary = []
|
50
|
-
result
|
50
|
+
result = Bio::Command.post_form("#{@server}/das/dsn")
|
51
51
|
doc = REXML::Document.new(result.body)
|
52
52
|
doc.elements.each('/descendant::DSN') do |e|
|
53
53
|
dsn = DSN.new
|
@@ -78,7 +78,7 @@ class DAS
|
|
78
78
|
else
|
79
79
|
src = dsn
|
80
80
|
end
|
81
|
-
result
|
81
|
+
result = Bio::Command.post_form("#{@server}/das/#{src}/entry_points")
|
82
82
|
doc = REXML::Document.new(result.body)
|
83
83
|
doc.elements.each('/descendant::ENTRY_POINTS') do |e|
|
84
84
|
entry_point.href = e.attributes['href']
|
@@ -112,7 +112,7 @@ class DAS
|
|
112
112
|
opts << "segment=#{s.entry_id}:#{s.start},#{s.stop}"
|
113
113
|
end
|
114
114
|
|
115
|
-
result
|
115
|
+
result = Bio::Command.post_form("#{@server}/das/#{dsn}/dna", opts)
|
116
116
|
doc = REXML::Document.new(result.body)
|
117
117
|
doc.elements.each('/descendant::SEQUENCE') do |e|
|
118
118
|
sequence = DNA.new
|
@@ -144,7 +144,7 @@ class DAS
|
|
144
144
|
opts << "segment=#{s.entry_id}:#{s.start},#{s.stop}"
|
145
145
|
end
|
146
146
|
|
147
|
-
result
|
147
|
+
result = Bio::Command.post_form("#{@server}/das/#{dsn}/sequence", opts)
|
148
148
|
doc = REXML::Document.new(result.body)
|
149
149
|
doc.elements.each('/descendant::SEQUENCE') do |e|
|
150
150
|
sequence = SEQUENCE.new
|
@@ -181,7 +181,7 @@ class DAS
|
|
181
181
|
opts << "segment=#{s.entry_id}:#{s.start},#{s.stop}"
|
182
182
|
end
|
183
183
|
|
184
|
-
result
|
184
|
+
result = Bio::Command.post_form("#{@server}/das/#{dsn}/types", opts)
|
185
185
|
doc = REXML::Document.new(result.body)
|
186
186
|
doc.elements.each('/descendant::GFF') do |e|
|
187
187
|
types.version = e.attributes['version']
|
@@ -232,7 +232,7 @@ class DAS
|
|
232
232
|
opts << "group_id=#{gid}"
|
233
233
|
end
|
234
234
|
|
235
|
-
result
|
235
|
+
result = Bio::Command.post_form("#{@server}/das/#{dsn}/features", opts)
|
236
236
|
doc = REXML::Document.new(result.body)
|
237
237
|
doc.elements.each('/descendant::GFF') do |e|
|
238
238
|
gff.version = e.attributes['version']
|