bio 1.4.3.0001 → 1.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +39 -33
- data/BSDL +22 -0
- data/COPYING +2 -2
- data/COPYING.ja +36 -36
- data/ChangeLog +2404 -1025
- data/KNOWN_ISSUES.rdoc +15 -55
- data/README.rdoc +17 -23
- data/RELEASE_NOTES.rdoc +246 -183
- data/Rakefile +3 -2
- data/bin/br_biofetch.rb +29 -5
- data/bioruby.gemspec +15 -32
- data/bioruby.gemspec.erb +10 -20
- data/doc/ChangeLog-1.4.3 +1478 -0
- data/doc/RELEASE_NOTES-1.4.3.rdoc +204 -0
- data/doc/Tutorial.rd +0 -6
- data/doc/Tutorial.rd.html +7 -12
- data/doc/Tutorial.rd.ja +960 -1064
- data/doc/Tutorial.rd.ja.html +977 -1067
- data/gemfiles/Gemfile.travis-jruby1.8 +2 -1
- data/gemfiles/Gemfile.travis-jruby1.9 +2 -4
- data/gemfiles/Gemfile.travis-rbx +13 -0
- data/gemfiles/Gemfile.travis-ruby1.8 +2 -1
- data/gemfiles/Gemfile.travis-ruby1.9 +2 -4
- data/gemfiles/Gemfile.travis-ruby2.2 +9 -0
- data/lib/bio.rb +10 -43
- data/lib/bio/alignment.rb +8 -14
- data/lib/bio/appl/blast.rb +1 -2
- data/lib/bio/appl/blast/format0.rb +18 -7
- data/lib/bio/appl/blast/remote.rb +0 -9
- data/lib/bio/appl/blast/report.rb +1 -1
- data/lib/bio/appl/clustalw/report.rb +3 -1
- data/lib/bio/appl/genscan/report.rb +1 -2
- data/lib/bio/appl/iprscan/report.rb +1 -2
- data/lib/bio/appl/meme/mast.rb +4 -4
- data/lib/bio/appl/meme/mast/report.rb +1 -1
- data/lib/bio/appl/paml/codeml.rb +2 -2
- data/lib/bio/appl/paml/codeml/report.rb +1 -0
- data/lib/bio/appl/paml/common.rb +1 -1
- data/lib/bio/appl/sosui/report.rb +1 -2
- data/lib/bio/command.rb +62 -2
- data/lib/bio/data/aa.rb +13 -31
- data/lib/bio/data/codontable.rb +1 -2
- data/lib/bio/db/biosql/biosql_to_biosequence.rb +1 -0
- data/lib/bio/db/biosql/sequence.rb +1 -1
- data/lib/bio/db/embl/common.rb +1 -1
- data/lib/bio/db/embl/embl.rb +5 -4
- data/lib/bio/db/embl/format_embl.rb +3 -3
- data/lib/bio/db/embl/sptr.rb +9 -1444
- data/lib/bio/db/embl/swissprot.rb +12 -29
- data/lib/bio/db/embl/trembl.rb +13 -30
- data/lib/bio/db/embl/uniprot.rb +12 -29
- data/lib/bio/db/embl/uniprotkb.rb +1455 -0
- data/lib/bio/db/fasta.rb +17 -0
- data/lib/bio/db/fasta/defline.rb +1 -3
- data/lib/bio/db/fastq.rb +1 -1
- data/lib/bio/db/genbank/ddbj.rb +9 -5
- data/lib/bio/db/genbank/refseq.rb +11 -3
- data/lib/bio/db/gff.rb +3 -4
- data/lib/bio/db/go.rb +5 -6
- data/lib/bio/db/kegg/module.rb +4 -5
- data/lib/bio/db/kegg/pathway.rb +4 -5
- data/lib/bio/db/kegg/reaction.rb +1 -1
- data/lib/bio/db/nexus.rb +3 -2
- data/lib/bio/db/pdb/pdb.rb +2 -2
- data/lib/bio/db/phyloxml/phyloxml_elements.rb +82 -59
- data/lib/bio/db/phyloxml/phyloxml_parser.rb +2 -2
- data/lib/bio/db/phyloxml/phyloxml_writer.rb +1 -2
- data/lib/bio/db/sanger_chromatogram/chromatogram.rb +1 -2
- data/lib/bio/db/transfac.rb +1 -1
- data/lib/bio/io/das.rb +40 -41
- data/lib/bio/io/fastacmd.rb +0 -16
- data/lib/bio/io/fetch.rb +111 -55
- data/lib/bio/io/flatfile/buffer.rb +4 -5
- data/lib/bio/io/hinv.rb +2 -3
- data/lib/bio/io/ncbirest.rb +43 -6
- data/lib/bio/io/pubmed.rb +76 -81
- data/lib/bio/io/togows.rb +33 -10
- data/lib/bio/map.rb +1 -1
- data/lib/bio/pathway.rb +1 -1
- data/lib/bio/sequence/compat.rb +1 -1
- data/lib/bio/sequence/na.rb +63 -12
- data/lib/bio/shell.rb +0 -2
- data/lib/bio/shell/core.rb +5 -6
- data/lib/bio/shell/interface.rb +3 -4
- data/lib/bio/shell/irb.rb +1 -2
- data/lib/bio/shell/plugin/entry.rb +2 -3
- data/lib/bio/shell/plugin/seq.rb +7 -6
- data/lib/bio/shell/setup.rb +1 -2
- data/lib/bio/tree.rb +2 -2
- data/lib/bio/util/contingency_table.rb +0 -2
- data/lib/bio/util/restriction_enzyme/range/sequence_range.rb +2 -2
- data/lib/bio/util/sirna.rb +76 -16
- data/lib/bio/version.rb +8 -9
- data/sample/benchmark_clustalw_report.rb +47 -0
- data/sample/biofetch.rb +248 -151
- data/setup.rb +6 -7
- data/test/data/clustalw/example1-seqnos.aln +58 -0
- data/test/network/bio/appl/blast/test_remote.rb +1 -15
- data/test/network/bio/appl/test_blast.rb +0 -12
- data/test/network/bio/io/test_pubmed.rb +49 -0
- data/test/network/bio/io/test_togows.rb +0 -1
- data/test/network/bio/test_command.rb +65 -2
- data/test/unit/bio/appl/bl2seq/test_report.rb +0 -1
- data/test/unit/bio/appl/blast/test_report.rb +110 -48
- data/test/unit/bio/appl/clustalw/test_report.rb +67 -51
- data/test/unit/bio/appl/sim4/test_report.rb +46 -17
- data/test/unit/bio/appl/test_blast.rb +2 -2
- data/test/unit/bio/db/embl/test_embl.rb +0 -1
- data/test/unit/bio/db/embl/test_embl_rel89.rb +0 -1
- data/test/unit/bio/db/embl/{test_sptr.rb → test_uniprotkb.rb} +111 -115
- data/test/unit/bio/db/embl/{test_uniprot_new_part.rb → test_uniprotkb_new_part.rb} +11 -11
- data/test/unit/bio/db/genbank/test_genbank.rb +10 -4
- data/test/unit/bio/db/pdb/test_pdb.rb +14 -8
- data/test/unit/bio/db/test_fasta.rb +41 -1
- data/test/unit/bio/db/test_fastq.rb +14 -4
- data/test/unit/bio/db/test_gff.rb +2 -2
- data/test/unit/bio/db/test_phyloxml.rb +30 -30
- data/test/unit/bio/db/test_phyloxml_writer.rb +2 -2
- data/test/unit/bio/io/flatfile/test_autodetection.rb +1 -2
- data/test/unit/bio/io/flatfile/test_buffer.rb +7 -1
- data/test/unit/bio/io/flatfile/test_splitter.rb +1 -1
- data/test/unit/bio/io/test_togows.rb +3 -2
- data/test/unit/bio/sequence/test_dblink.rb +1 -1
- data/test/unit/bio/sequence/test_na.rb +3 -1
- data/test/unit/bio/test_alignment.rb +1 -2
- data/test/unit/bio/test_command.rb +5 -4
- data/test/unit/bio/test_db.rb +4 -2
- data/test/unit/bio/test_pathway.rb +25 -10
- data/test/unit/bio/util/test_sirna.rb +22 -22
- metadata +656 -1430
- data/doc/KEGG_API.rd +0 -1843
- data/doc/KEGG_API.rd.ja +0 -1834
- data/extconf.rb +0 -2
- data/lib/bio/appl/blast/ddbj.rb +0 -131
- data/lib/bio/db/kegg/taxonomy.rb +0 -280
- data/lib/bio/io/dbget.rb +0 -194
- data/lib/bio/io/ddbjrest.rb +0 -344
- data/lib/bio/io/ddbjxml.rb +0 -458
- data/lib/bio/io/ebisoap.rb +0 -158
- data/lib/bio/io/ensembl.rb +0 -229
- data/lib/bio/io/higet.rb +0 -73
- data/lib/bio/io/keggapi.rb +0 -363
- data/lib/bio/io/ncbisoap.rb +0 -156
- data/lib/bio/io/soapwsdl.rb +0 -119
- data/lib/bio/shell/plugin/keggapi.rb +0 -181
- data/lib/bio/shell/plugin/soap.rb +0 -87
- data/sample/dbget +0 -37
- data/sample/demo_ddbjxml.rb +0 -212
- data/sample/demo_kegg_taxonomy.rb +0 -92
- data/sample/demo_keggapi.rb +0 -502
- data/sample/psortplot_html.rb +0 -214
- data/test/network/bio/io/test_ddbjrest.rb +0 -47
- data/test/network/bio/io/test_ensembl.rb +0 -230
- data/test/network/bio/io/test_soapwsdl.rb +0 -53
- data/test/unit/bio/io/test_ddbjxml.rb +0 -81
- data/test/unit/bio/io/test_ensembl.rb +0 -111
- data/test/unit/bio/io/test_soapwsdl.rb +0 -33
data/sample/psortplot_html.rb
DELETED
@@ -1,214 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# psortplot_html.rb - A KEGG API demo script. Generates a HTML file of
|
4
|
-
# genes marked by PSORT II predictions onto a
|
5
|
-
# KEGG/PATHWAY map.
|
6
|
-
#
|
7
|
-
# Usage:
|
8
|
-
#
|
9
|
-
# % ruby psortplot_html.rb
|
10
|
-
# % cat sce00010_psort2.html
|
11
|
-
# % ruby psortplot_html.rb path:eco00010
|
12
|
-
# % cat eco00010_psort2.html
|
13
|
-
#
|
14
|
-
# Copyright:: Copyright (C) 2005
|
15
|
-
# Mitsuteru C. Nakao <n@bioruby.org>
|
16
|
-
# License:: The Ruby License
|
17
|
-
#
|
18
|
-
# $Id: psortplot_html.rb,v 1.3 2007/04/05 23:35:42 trevor Exp $
|
19
|
-
#
|
20
|
-
|
21
|
-
require 'bio'
|
22
|
-
|
23
|
-
class KEGG
|
24
|
-
DBGET_BASEURI = 'http://kegg.com/dbget-bin'
|
25
|
-
WWW_BGET_BASEURI = DBGET_BASEURI + '/www_bget'
|
26
|
-
WWW_PATHWAY_BASEURI = DBGET_BASEURI + '/get_pathway'
|
27
|
-
|
28
|
-
# path := path:sce00010
|
29
|
-
def self.link_pathway(path0)
|
30
|
-
path, path = path0.split(':')
|
31
|
-
org_name = path.scan(/(^\w{3})/).to_s
|
32
|
-
mapno = path.sub(org_name, '')
|
33
|
-
str = "<a href='#{WWW_PATHWAY_BASEURI}?org_name=#{org_name}&mapno=#{mapno}'>#{path0}</a>"
|
34
|
-
end
|
35
|
-
|
36
|
-
# ec_num := ec:1.2.3.4
|
37
|
-
def self.link_ec(ec_num)
|
38
|
-
ec = ec_num.sub(/^ec:/, '')
|
39
|
-
str = "<a href='#{WWW_BGET_BASEURI}?enzyme+#{ec}'>#{ec_num}</a>"
|
40
|
-
return str
|
41
|
-
end
|
42
|
-
|
43
|
-
# gene := eco:b0002
|
44
|
-
def self.link_genes(gene)
|
45
|
-
org_name, gene_name = gene.split(':')
|
46
|
-
str = "<a href='#{WWW_BGET_BASEURI}?#{org_name}+#{gene_name}'>#{gene}</a>"
|
47
|
-
return str
|
48
|
-
end
|
49
|
-
end
|
50
|
-
|
51
|
-
|
52
|
-
class PSORT
|
53
|
-
COLOR_Palette = {
|
54
|
-
'csk' => "#FF0000", # 'cytoskeletal'
|
55
|
-
'cyt' => "#FF8000", # 'cytoplasmic'
|
56
|
-
'nuc' => "#FFFF00", # 'nuclear'
|
57
|
-
'mit' => "#80FF00", # 'mitochondrial'
|
58
|
-
'ves' => "#00FF00", # 'vesicles of secretory system'
|
59
|
-
'end' => "#00FF80", # 'endoplasmic reticulum'
|
60
|
-
'gol' => "#00FFFF", # 'Golgi'
|
61
|
-
'vac' => "#0080FF", # 'vacuolar'
|
62
|
-
'pla' => "#0000FF", # 'plasma membrane'
|
63
|
-
'pox' => "#8000FF", # 'peroxisomal'
|
64
|
-
'exc' => "#FF00FF", # 'extracellular, including cell wall'
|
65
|
-
'---' => "#FF0080" # 'other'
|
66
|
-
}
|
67
|
-
end
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
keggapi = Bio::KEGG::API.new
|
73
|
-
psort2serv = Bio::PSORT::PSORT2.imsut
|
74
|
-
|
75
|
-
# Obtains a list of genes on specified pathway
|
76
|
-
pathway = ARGV.shift || "path:sce00010"
|
77
|
-
genes = keggapi.get_genes_by_pathway(pathway)
|
78
|
-
|
79
|
-
scl = Hash.new # protein subcelluler localizations
|
80
|
-
ec = Hash.new # EC numbers
|
81
|
-
|
82
|
-
serial = 0
|
83
|
-
sync_default = $stdout.sync
|
84
|
-
$stdout.sync = true
|
85
|
-
genes.each do |gene|
|
86
|
-
print "#{(serial += 1).to_s.rjust(genes.size.to_s.size)}\t#{gene}\t"
|
87
|
-
# Obtains amino acid sequence from KEGG GENES entry
|
88
|
-
aaseq = keggapi.get_aaseqs([gene])
|
89
|
-
|
90
|
-
# Predicts protein subcellualr localization
|
91
|
-
result = psort2serv.exec(aaseq)
|
92
|
-
scl[gene] = result.pred
|
93
|
-
print "#{scl[gene]}\t"
|
94
|
-
|
95
|
-
# Obtains the EC number from KEGG GENES entry
|
96
|
-
ec[gene] = keggapi.get_enzymes_by_gene(gene)
|
97
|
-
puts "#{ec[gene].inspect}"
|
98
|
-
end
|
99
|
-
$stdout.sync = sync_default
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
fg_list = Array.new
|
105
|
-
bg_list = Array.new
|
106
|
-
|
107
|
-
genes.each do |gene|
|
108
|
-
fg_list << "#FF0000"
|
109
|
-
bg_list << PSORT::COLOR_Palette[scl[gene]]
|
110
|
-
end
|
111
|
-
|
112
|
-
# coloring KEGG pathway according to gene's localization
|
113
|
-
url = keggapi.color_pathway_by_objects(pathway, genes, fg_list, bg_list)
|
114
|
-
puts "#{url} downloaded."
|
115
|
-
|
116
|
-
# remove "path:" prefix from pathway_id
|
117
|
-
path_code = pathway.sub(/^path:/, '')
|
118
|
-
|
119
|
-
# save the result image
|
120
|
-
image_file = "#{path_code}_psort2.gif"
|
121
|
-
begin
|
122
|
-
keggapi.save_image(url, image_file)
|
123
|
-
end
|
124
|
-
|
125
|
-
|
126
|
-
# create html with a color palette
|
127
|
-
html = <<END
|
128
|
-
<html>
|
129
|
-
<head>
|
130
|
-
<title>PSORT II prediction protein subcellular localization map of KEGG/PATHWAY (#{pathway})</title>
|
131
|
-
<style>
|
132
|
-
table { border-collapse: collapse; }
|
133
|
-
td { border: 1px solid black; padding: 5px; }
|
134
|
-
td.outer { border: none; vertical-align: top; }
|
135
|
-
</style>
|
136
|
-
</head>
|
137
|
-
<body>
|
138
|
-
<h1><li><a href="http://psort.ims.u-tokyo.ac.jp/helpwww2.html">PSORT II</a> prediction protein subcellular localization map of <a href="http://kegg.com/kegg/pathway.html">KEGG/PATHWAY</a> (<a href="">#{KEGG.link_pathway(pathway)})</h1>
|
139
|
-
|
140
|
-
<table>
|
141
|
-
<tr>
|
142
|
-
<td class=outer>
|
143
|
-
<table>
|
144
|
-
<tr>
|
145
|
-
<th></th>
|
146
|
-
<th>EC</th>
|
147
|
-
<th>Gene</th>
|
148
|
-
<th>Localization</th>
|
149
|
-
</tr>
|
150
|
-
END
|
151
|
-
|
152
|
-
|
153
|
-
# generate gene table with localization
|
154
|
-
names = Bio::PSORT::PSORT2::SclNames
|
155
|
-
multi_genes = Hash.new(0)
|
156
|
-
|
157
|
-
ec.values.flatten.sort.uniq.each do |ec_num|
|
158
|
-
ec.find_all {|x| x[1].include?(ec_num) }.each do |gene|
|
159
|
-
gene = gene[0]
|
160
|
-
loc = scl[gene]
|
161
|
-
color = PSORT::COLOR_Palette[loc]
|
162
|
-
name = names[loc]
|
163
|
-
multi_genes[gene] += 1
|
164
|
-
|
165
|
-
html += <<END
|
166
|
-
<tr>
|
167
|
-
<td>#{multi_genes[gene]}</td>
|
168
|
-
<td>#{KEGG.link_ec(ec_num)}</td>
|
169
|
-
<td>#{KEGG.link_genes(gene)}</td>
|
170
|
-
<td bgcolor="#{color}">#{name}</td>
|
171
|
-
</tr>
|
172
|
-
END
|
173
|
-
end
|
174
|
-
end
|
175
|
-
|
176
|
-
html += <<END
|
177
|
-
</table>
|
178
|
-
</td>
|
179
|
-
<td class=outer>
|
180
|
-
<table>
|
181
|
-
<tr>
|
182
|
-
<th>Code</th>
|
183
|
-
<th>Color</th>
|
184
|
-
</tr>
|
185
|
-
END
|
186
|
-
|
187
|
-
# generate color code table also
|
188
|
-
PSORT::COLOR_Palette.sort.each do |code, color|
|
189
|
-
html += <<END
|
190
|
-
<tr>
|
191
|
-
<td>#{code}</td>
|
192
|
-
<td bgcolor="#{color}">#{names[code]}</td>
|
193
|
-
</tr>
|
194
|
-
END
|
195
|
-
end
|
196
|
-
|
197
|
-
html += <<END
|
198
|
-
</table>
|
199
|
-
</td>
|
200
|
-
</tr>
|
201
|
-
</table>
|
202
|
-
<br>
|
203
|
-
<img src="#{image_file}">
|
204
|
-
</body>
|
205
|
-
</html>
|
206
|
-
END
|
207
|
-
|
208
|
-
# save generated HTML file
|
209
|
-
html_file = "#{path_code}_psort2.html"
|
210
|
-
File.open(html_file, "w+") do |file|
|
211
|
-
file.puts html
|
212
|
-
end
|
213
|
-
|
214
|
-
puts "Open #{html_file}"
|
@@ -1,47 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# test/functional/bio/io/test_ddbjrest.rb - Functional test for Bio::DDBJ::REST
|
3
|
-
#
|
4
|
-
# Copyright:: Copyright (C) 2011
|
5
|
-
# Naohisa Goto <ng@bioruby.org>
|
6
|
-
# License:: The Ruby License
|
7
|
-
#
|
8
|
-
|
9
|
-
# loading helper routine for testing bioruby
|
10
|
-
require 'pathname'
|
11
|
-
load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 3,
|
12
|
-
'bioruby_test_helper.rb')).cleanpath.to_s
|
13
|
-
|
14
|
-
# libraries needed for the tests
|
15
|
-
require 'bio/io/ddbjrest'
|
16
|
-
require 'test/unit'
|
17
|
-
|
18
|
-
module Bio
|
19
|
-
module NetTestDDBJREST
|
20
|
-
|
21
|
-
class TestDDBJ < Test::Unit::TestCase
|
22
|
-
|
23
|
-
def setup
|
24
|
-
@obj = Bio::DDBJ::REST::DDBJ.new
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_countBasePair
|
28
|
-
text = @obj.countBasePair("AF237819")
|
29
|
-
expected = {
|
30
|
-
"a" => 47,
|
31
|
-
"t" => 38,
|
32
|
-
"g" => 48,
|
33
|
-
"c" => 38
|
34
|
-
}
|
35
|
-
h = {}
|
36
|
-
text.each_line do |line|
|
37
|
-
base, count, percent = line.split(/\t/)
|
38
|
-
count = count.to_i
|
39
|
-
h[base] = count if count > 0
|
40
|
-
end
|
41
|
-
assert_equal(expected, h)
|
42
|
-
end
|
43
|
-
|
44
|
-
end #class TestDDBJ
|
45
|
-
|
46
|
-
end #module NetTestDDBJREST
|
47
|
-
end #module Bio
|
@@ -1,230 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# test/functional/bio/io/test_ensembl.rb - Functional test for Bio::Ensembl
|
3
|
-
#
|
4
|
-
# Copyright:: Copyright (C) 2007
|
5
|
-
# Mitsuteru C. Nakao <n@bioruby.org>
|
6
|
-
# License:: The Ruby License
|
7
|
-
#
|
8
|
-
# $Id:$
|
9
|
-
#
|
10
|
-
|
11
|
-
# loading helper routine for testing bioruby
|
12
|
-
require 'pathname'
|
13
|
-
load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 3,
|
14
|
-
'bioruby_test_helper.rb')).cleanpath.to_s
|
15
|
-
|
16
|
-
# libraries needed for the tests
|
17
|
-
require 'test/unit'
|
18
|
-
require 'bio/io/ensembl'
|
19
|
-
|
20
|
-
module Bio
|
21
|
-
|
22
|
-
class FuncTestEnsembl < Test::Unit::TestCase
|
23
|
-
def setup
|
24
|
-
@serv = Bio::Ensembl.new('Homo_sapiens')
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_class
|
28
|
-
assert_equal(Bio::Ensembl, @serv.class)
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
class FuncTestEnsemblHuman < Test::Unit::TestCase
|
33
|
-
def setup
|
34
|
-
@serv = Bio::Ensembl.human
|
35
|
-
end
|
36
|
-
|
37
|
-
def test_organism
|
38
|
-
assert_equal("Homo_sapiens", @serv.organism)
|
39
|
-
end
|
40
|
-
|
41
|
-
def test_server
|
42
|
-
assert_equal("http://www.ensembl.org", @serv.server)
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
class FuncTestEnsemblHumanExportView < Test::Unit::TestCase
|
47
|
-
def setup
|
48
|
-
@serv = Bio::Ensembl.new('Homo_sapiens',
|
49
|
-
'http://jul2008.archive.ensembl.org')
|
50
|
-
end
|
51
|
-
|
52
|
-
def test_fna_exportview
|
53
|
-
seq = ">4 dna:chromosome chromosome:NCBI36:4:1149206:1149209:1\nGAGA\n"
|
54
|
-
fna = @serv.exportview(4, 1149206, 1149209)
|
55
|
-
assert_equal(seq, fna)
|
56
|
-
end
|
57
|
-
|
58
|
-
def test_fasta_exportview_with_hash_4th_params
|
59
|
-
fna = @serv.exportview(4, 1149206, 1149209, :upstream => 10)
|
60
|
-
fna10 = @serv.exportview(4, 1149196, 1149209)
|
61
|
-
assert_equal(fna10, fna)
|
62
|
-
end
|
63
|
-
|
64
|
-
def test_fna_exportview_with_named_args
|
65
|
-
seq = ">4 dna:chromosome chromosome:NCBI36:4:1149206:1149209:1\nGAGA\n"
|
66
|
-
fna = @serv.exportview(:seq_region_name => 4,
|
67
|
-
:anchor1 => 1149206,
|
68
|
-
:anchor2 => 1149209)
|
69
|
-
assert_equal(seq, fna)
|
70
|
-
end
|
71
|
-
|
72
|
-
def test_fasta_exportview_with_named_args_and_hash_4th_params
|
73
|
-
fna = @serv.exportview(:seq_region_name => 4,
|
74
|
-
:anchor1 => 1149206,
|
75
|
-
:anchor2 => 1149209,
|
76
|
-
:upstream => 10)
|
77
|
-
fna10 = @serv.exportview(:seq_region_name => 4,
|
78
|
-
:anchor1 => 1149196,
|
79
|
-
:anchor2 => 1149209)
|
80
|
-
assert_equal(fna10, fna)
|
81
|
-
end
|
82
|
-
|
83
|
-
def test_gff_exportview_for_empty_result
|
84
|
-
gff = @serv.exportview(4, 1149206, 1149209, ['gene'])
|
85
|
-
assert_equal('', gff)
|
86
|
-
end
|
87
|
-
|
88
|
-
def test_gff_exportview
|
89
|
-
# OR1A1 (Olfactory receptor 1A1)
|
90
|
-
lines = [ [ "17",
|
91
|
-
"Ensembl",
|
92
|
-
"Gene",
|
93
|
-
"3065665",
|
94
|
-
"3066594",
|
95
|
-
".",
|
96
|
-
"+",
|
97
|
-
"1",
|
98
|
-
"gene_id=ENSG00000172146; transcript_id=ENST00000304094; exon_id=ENSE00001137815; gene_type=KNOWN_protein_coding"
|
99
|
-
],
|
100
|
-
[ "17",
|
101
|
-
"Vega",
|
102
|
-
"Gene",
|
103
|
-
"3065665",
|
104
|
-
"3066594",
|
105
|
-
".",
|
106
|
-
"+",
|
107
|
-
"1",
|
108
|
-
"gene_id=OTTHUMG00000090637; transcript_id=OTTHUMT00000207292; exon_id=OTTHUME00001080001; gene_type=KNOWN_protein_coding"
|
109
|
-
]
|
110
|
-
]
|
111
|
-
line = lines.collect { |x| x.join("\t") + "\n" }.join('')
|
112
|
-
gff = @serv.exportview(17, 3065665, 3066594, ['gene'])
|
113
|
-
assert_equal(line, gff)
|
114
|
-
end
|
115
|
-
|
116
|
-
def test_gff_exportview_with_named_args_for_empty_result
|
117
|
-
gff = @serv.exportview(:seq_region_name => 4,
|
118
|
-
:anchor1 => 1149206,
|
119
|
-
:anchor2 => 1149209,
|
120
|
-
:options => ['gene'])
|
121
|
-
assert_equal('', gff)
|
122
|
-
end
|
123
|
-
|
124
|
-
def test_gff_exportview_with_named_args
|
125
|
-
# OR1A1 (Olfactory receptor 1A1)
|
126
|
-
lines = [ [ "17",
|
127
|
-
"Ensembl",
|
128
|
-
"Gene",
|
129
|
-
"3065665",
|
130
|
-
"3066594",
|
131
|
-
".",
|
132
|
-
"+",
|
133
|
-
"1",
|
134
|
-
"gene_id=ENSG00000172146; transcript_id=ENST00000304094; exon_id=ENSE00001137815; gene_type=KNOWN_protein_coding"
|
135
|
-
],
|
136
|
-
[ "17",
|
137
|
-
"Vega",
|
138
|
-
"Gene",
|
139
|
-
"3065665",
|
140
|
-
"3066594",
|
141
|
-
".",
|
142
|
-
"+",
|
143
|
-
"1",
|
144
|
-
"gene_id=OTTHUMG00000090637; transcript_id=OTTHUMT00000207292; exon_id=OTTHUME00001080001; gene_type=KNOWN_protein_coding"
|
145
|
-
]
|
146
|
-
]
|
147
|
-
line = lines.collect { |x| x.join("\t") + "\n" }.join('')
|
148
|
-
gff = @serv.exportview(:seq_region_name => 17,
|
149
|
-
:anchor1 => 3065665,
|
150
|
-
:anchor2 => 3066594,
|
151
|
-
:options => ['gene'])
|
152
|
-
assert_equal(line, gff)
|
153
|
-
end
|
154
|
-
|
155
|
-
def test_tab_exportview_with_named_args_for_empty_result
|
156
|
-
line = ["seqname",
|
157
|
-
"source",
|
158
|
-
"feature",
|
159
|
-
"start",
|
160
|
-
"end",
|
161
|
-
"score",
|
162
|
-
"strand",
|
163
|
-
"frame",
|
164
|
-
"gene_id",
|
165
|
-
"transcript_id",
|
166
|
-
"exon_id",
|
167
|
-
"gene_type"].join("\t") + "\n"
|
168
|
-
gff = @serv.exportview(:seq_region_name => 4,
|
169
|
-
:anchor1 => 1149206,
|
170
|
-
:anchor2 => 1149209,
|
171
|
-
:options => ['gene'],
|
172
|
-
:format => 'tab')
|
173
|
-
assert_equal(line, gff)
|
174
|
-
end
|
175
|
-
|
176
|
-
def test_tab_exportview_with_named_args
|
177
|
-
# OR1A1 (Olfactory receptor 1A1)
|
178
|
-
lines = [ [ "seqname",
|
179
|
-
"source",
|
180
|
-
"feature",
|
181
|
-
"start",
|
182
|
-
"end",
|
183
|
-
"score",
|
184
|
-
"strand",
|
185
|
-
"frame",
|
186
|
-
"gene_id",
|
187
|
-
"transcript_id",
|
188
|
-
"exon_id",
|
189
|
-
"gene_type"
|
190
|
-
],
|
191
|
-
[ "17",
|
192
|
-
"Ensembl",
|
193
|
-
"Gene",
|
194
|
-
"3065665",
|
195
|
-
"3066594",
|
196
|
-
".",
|
197
|
-
"+",
|
198
|
-
"1",
|
199
|
-
"ENSG00000172146",
|
200
|
-
"ENST00000304094",
|
201
|
-
"ENSE00001137815",
|
202
|
-
"KNOWN_protein_coding"
|
203
|
-
],
|
204
|
-
[ "17",
|
205
|
-
"Vega",
|
206
|
-
"Gene",
|
207
|
-
"3065665",
|
208
|
-
"3066594",
|
209
|
-
".",
|
210
|
-
"+",
|
211
|
-
"1",
|
212
|
-
"OTTHUMG00000090637",
|
213
|
-
"OTTHUMT00000207292",
|
214
|
-
"OTTHUME00001080001",
|
215
|
-
"KNOWN_protein_coding"
|
216
|
-
]
|
217
|
-
]
|
218
|
-
line = lines.collect { |x| x.join("\t") + "\n" }.join('')
|
219
|
-
gff = @serv.exportview(:seq_region_name => 17,
|
220
|
-
:anchor1 => 3065665,
|
221
|
-
:anchor2 => 3066594,
|
222
|
-
:options => ['gene'],
|
223
|
-
:format => 'tab')
|
224
|
-
assert_equal(line, gff)
|
225
|
-
end
|
226
|
-
|
227
|
-
|
228
|
-
end
|
229
|
-
|
230
|
-
end # module Bio
|