bio-nexml 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/extconf.rb DELETED
@@ -1,2 +0,0 @@
1
- require 'mkmf'
2
- create_makefile("bio-nexml")
data/lib/bio.rb DELETED
@@ -1,321 +0,0 @@
1
- #
2
- # = bio.rb - Loading all BioRuby modules
3
- #
4
- # Copyright:: Copyright (C) 2001-2007
5
- # Toshiaki Katayama <k@bioruby.org>
6
- # License:: The Ruby License
7
- #
8
- # $Id:$
9
- #
10
-
11
- module Bio
12
-
13
- autoload :BIORUBY_VERSION, 'bio/version'
14
- autoload :BIORUBY_EXTRA_VERSION, 'bio/version'
15
- autoload :BIORUBY_VERSION_ID, 'bio/version'
16
-
17
- ### Basic data types
18
-
19
- ## Sequence
20
-
21
- autoload :Sequence, 'bio/sequence'
22
- ## below are described in bio/sequence.rb
23
- #class Sequence
24
- # autoload :Common, 'bio/sequence/common'
25
- # autoload :NA, 'bio/sequence/na'
26
- # autoload :AA, 'bio/sequence/aa'
27
- # autoload :Generic, 'bio/sequence/generic'
28
- # autoload :Format, 'bio/sequence/format'
29
- # autoload :Adapter, 'bio/sequence/adapter'
30
- #end
31
-
32
- ## Locations/Location
33
-
34
- autoload :Location, 'bio/location'
35
- autoload :Locations, 'bio/location'
36
-
37
- ## Features/Feature
38
-
39
- autoload :Feature, 'bio/feature'
40
- autoload :Features, 'bio/compat/features'
41
-
42
- ## References/Reference
43
-
44
- autoload :Reference, 'bio/reference'
45
- autoload :References, 'bio/compat/references'
46
-
47
- ## Pathway/Relation
48
-
49
- autoload :Pathway, 'bio/pathway'
50
- autoload :Relation, 'bio/pathway'
51
-
52
- ## Alignment
53
-
54
- autoload :Alignment, 'bio/alignment'
55
-
56
- ## Tree
57
- autoload :Tree, 'bio/tree'
58
-
59
- ## Map
60
- autoload :Map, 'bio/map'
61
-
62
- ### Constants
63
-
64
- autoload :NucleicAcid, 'bio/data/na'
65
- autoload :AminoAcid, 'bio/data/aa'
66
- autoload :CodonTable, 'bio/data/codontable'
67
-
68
-
69
- ### DB parsers
70
-
71
- autoload :DB, 'bio/db'
72
- autoload :NCBIDB, 'bio/db'
73
- autoload :KEGGDB, 'bio/db'
74
- autoload :EMBLDB, 'bio/db'
75
-
76
- ## GenBank/RefSeq/DDBJ
77
-
78
- autoload :GenBank, 'bio/db/genbank/genbank'
79
- autoload :GenPept, 'bio/db/genbank/genpept'
80
- autoload :RefSeq, 'bio/db/genbank/refseq'
81
- autoload :DDBJ, 'bio/db/genbank/ddbj'
82
- ## below are described in bio/db/genbank/ddbj.rb
83
- #class DDBJ
84
- # autoload :XML, 'bio/io/ddbjxml'
85
- #end
86
-
87
- ## EMBL/TrEMBL/Swiss-Prot/SPTR
88
-
89
- autoload :EMBL, 'bio/db/embl/embl'
90
- autoload :SPTR, 'bio/db/embl/sptr'
91
- autoload :TrEMBL, 'bio/db/embl/trembl'
92
- autoload :UniProt, 'bio/db/embl/uniprot'
93
- autoload :SwissProt, 'bio/db/embl/swissprot'
94
-
95
- ## KEGG
96
-
97
- class KEGG
98
- autoload :GENOME, 'bio/db/kegg/genome'
99
- autoload :GENES, 'bio/db/kegg/genes'
100
- autoload :ENZYME, 'bio/db/kegg/enzyme'
101
- autoload :COMPOUND, 'bio/db/kegg/compound'
102
- autoload :DRUG, 'bio/db/kegg/drug'
103
- autoload :GLYCAN, 'bio/db/kegg/glycan'
104
- autoload :REACTION, 'bio/db/kegg/reaction'
105
- autoload :BRITE, 'bio/db/kegg/brite'
106
- autoload :CELL, 'bio/db/kegg/cell'
107
- autoload :EXPRESSION, 'bio/db/kegg/expression'
108
- autoload :ORTHOLOGY, 'bio/db/kegg/orthology'
109
- autoload :KGML, 'bio/db/kegg/kgml'
110
- autoload :Taxonomy, 'bio/db/kegg/taxonomy'
111
- end
112
-
113
- ## other formats
114
-
115
- autoload :FastaFormat, 'bio/db/fasta'
116
- autoload :FastaNumericFormat, 'bio/db/fasta/qual' # change to FastaFormat::Numeric ?
117
- autoload :FastaDefline, 'bio/db/fasta/defline' # change to FastaFormat::Defline ?
118
- autoload :Fastq, 'bio/db/fastq'
119
- autoload :GFF, 'bio/db/gff'
120
- autoload :AAindex, 'bio/db/aaindex'
121
- autoload :AAindex1, 'bio/db/aaindex' # change to AAindex::AAindex1 ?
122
- autoload :AAindex2, 'bio/db/aaindex' # change to AAindex::AAindex2 ?
123
- autoload :TRANSFAC, 'bio/db/transfac'
124
- autoload :PROSITE, 'bio/db/prosite'
125
- autoload :LITDB, 'bio/db/litdb'
126
- autoload :MEDLINE, 'bio/db/medline'
127
- autoload :FANTOM, 'bio/db/fantom'
128
- autoload :GO, 'bio/db/go'
129
- autoload :PDB, 'bio/db/pdb'
130
- autoload :NBRF, 'bio/db/nbrf'
131
- autoload :REBASE, 'bio/db/rebase'
132
- autoload :SOFT, 'bio/db/soft'
133
- autoload :Lasergene, 'bio/db/lasergene'
134
- autoload :SangerChromatogram, 'bio/db/sanger_chromatogram/chromatogram'
135
- autoload :Scf, 'bio/db/sanger_chromatogram/scf'
136
- autoload :Abif, 'bio/db/sanger_chromatogram/abif'
137
-
138
- autoload :Newick, 'bio/db/newick'
139
- autoload :Nexus, 'bio/db/nexus'
140
-
141
- autoload :PhyloXML, 'bio/db/phyloxml/phyloxml_elements'
142
- # Bio::Taxonomy will be moved to other file
143
- autoload :Taxonomy, 'bio/db/phyloxml/phyloxml_elements'
144
- ## below are described in bio/db/phyloxml/phyloxml_elements.rb
145
- #module PhyloXML
146
- # autoload :Parser, 'bio/db/phyloxml/phyloxml_parser'
147
- # autoload :Writer, 'bio/db/phyloxml/phyloxml_writer'
148
- #end
149
-
150
- ### IO interface modules
151
-
152
- autoload :Registry, 'bio/io/registry'
153
- autoload :Fetch, 'bio/io/fetch'
154
- autoload :SQL, 'bio/io/sql'
155
- autoload :SOAPWSDL, 'bio/io/soapwsdl'
156
- autoload :FlatFile, 'bio/io/flatfile'
157
- autoload :FlatFileIndex, 'bio/io/flatfile/index' # chage to FlatFile::Index ?
158
- ## below are described in bio/io/flatfile/index.rb
159
- #class FlatFileIndex
160
- # autoload :Indexer, 'bio/io/flatfile/indexer'
161
- # autoload :BDBdefault, 'bio/io/flatfile/bdb'
162
- # autoload :BDBwrapper, 'bio/io/flatfile/bdb'
163
- # autoload :BDB_1, 'bio/io/flatfile/bdb'
164
- #end
165
-
166
- autoload :PubMed, 'bio/io/pubmed'
167
- autoload :DAS, 'bio/io/das'
168
- autoload :DBGET, 'bio/io/dbget'
169
-
170
- autoload :Ensembl, 'bio/io/ensembl'
171
- autoload :Hinv, 'bio/io/hinv'
172
-
173
- ## below are described in bio/appl/blast.rb
174
- #class Blast
175
- # autoload :Fastacmd, 'bio/io/fastacmd'
176
- #end
177
-
178
- class KEGG
179
- autoload :API, 'bio/io/keggapi'
180
- end
181
-
182
- ## below are described in bio/db/genbank/ddbj.rb
183
- #class DDBJ
184
- # autoload :XML, 'bio/io/ddbjxml'
185
- #end
186
-
187
- class HGC
188
- autoload :HiGet, 'bio/io/higet'
189
- end
190
-
191
- class EBI
192
- autoload :SOAP, 'bio/io/ebisoap'
193
- end
194
-
195
- autoload :NCBI, 'bio/io/ncbirest'
196
- ## below are described in bio/io/ncbirest.rb
197
- #class NCBI
198
- # autoload :SOAP, 'bio/io/ncbisoap'
199
- # autoload :REST, 'bio/io/ncbirest'
200
- #end
201
-
202
- autoload :TogoWS, 'bio/io/togows'
203
-
204
- ### Applications
205
-
206
- autoload :Fasta, 'bio/appl/fasta'
207
- ## below are described in bio/appl/fasta.rb
208
- #class Fasta
209
- # autoload :Report, 'bio/appl/fasta/format10'
210
- #end
211
-
212
- autoload :Blast, 'bio/appl/blast'
213
- ## below are described in bio/appl/blast.rb
214
- #class Blast
215
- # autoload :Fastacmd, 'bio/io/fastacmd'
216
- # autoload :Report, 'bio/appl/blast/report'
217
- # autoload :Default, 'bio/appl/blast/format0'
218
- # autoload :WU, 'bio/appl/blast/wublast'
219
- # autoload :Bl2seq, 'bio/appl/bl2seq/report'
220
- # autoload :RPSBlast, 'bio/appl/blast/rpsblast'
221
- # autoload :NCBIOptions, 'bio/appl/blast/ncbioptions'
222
- # autoload :Remote, 'bio/appl/blast/remote'
223
- #end
224
-
225
- autoload :HMMER, 'bio/appl/hmmer'
226
- ## below are described in bio/appl/hmmer.rb
227
- #class HMMER
228
- # autoload :Report, 'bio/appl/hmmer/report'
229
- #end
230
-
231
- autoload :EMBOSS, 'bio/appl/emboss' # use bio/command, improve
232
-
233
- autoload :PSORT, 'bio/appl/psort'
234
- ## below are described in bio/appl/psort.rb
235
- #class PSORT
236
- # class PSORT1
237
- # autoload :Report, 'bio/appl/psort/report'
238
- # end
239
- # class PSORT2
240
- # autoload :Report, 'bio/appl/psort/report'
241
- # end
242
- #end
243
-
244
- autoload :TMHMM, 'bio/appl/tmhmm/report'
245
- autoload :TargetP, 'bio/appl/targetp/report'
246
- autoload :SOSUI, 'bio/appl/sosui/report'
247
- autoload :Genscan, 'bio/appl/genscan/report'
248
-
249
- autoload :ClustalW, 'bio/appl/clustalw'
250
- ## below are described in bio/appl/clustalw.rb
251
- #class ClustalW
252
- # autoload :Report, 'bio/appl/clustalw/report'
253
- #end
254
-
255
- autoload :MAFFT, 'bio/appl/mafft'
256
- ## below are described in bio/appl/mafft.rb
257
- #class MAFFT
258
- # autoload :Report, 'bio/appl/mafft/report'
259
- #end
260
-
261
- autoload :Tcoffee, 'bio/appl/tcoffee'
262
- autoload :Muscle, 'bio/appl/muscle'
263
- autoload :Probcons, 'bio/appl/probcons'
264
-
265
- autoload :Sim4, 'bio/appl/sim4'
266
- ## below are described in bio/appl/sim4.rb
267
- #class Sim4
268
- # autoload :Report, 'bio/appl/sim4/report'
269
- #end
270
-
271
- autoload :Spidey, 'bio/appl/spidey/report'
272
- autoload :Blat, 'bio/appl/blat/report'
273
-
274
- module GCG
275
- autoload :Msf, 'bio/appl/gcg/msf'
276
- autoload :Seq, 'bio/appl/gcg/seq'
277
- end
278
-
279
- module Phylip
280
- autoload :PhylipFormat, 'bio/appl/phylip/alignment'
281
- autoload :DistanceMatrix, 'bio/appl/phylip/distance_matrix'
282
- end
283
-
284
- autoload :Iprscan, 'bio/appl/iprscan/report'
285
-
286
- autoload :PAML, 'bio/appl/paml/common'
287
- ## below are described in bio/appl/paml/common.rb
288
- # module PAML
289
- # autoload :Codeml, 'bio/appl/paml/codeml'
290
- # autoload :Baseml, 'bio/appl/paml/baseml'
291
- # autoload :Yn00, 'bio/appl/paml/yn00'
292
- # end
293
-
294
- ### Utilities
295
-
296
- autoload :SiRNA, 'bio/util/sirna'
297
- autoload :ColorScheme, 'bio/util/color_scheme'
298
- autoload :ContingencyTable, 'bio/util/contingency_table'
299
- autoload :RestrictionEnzyme, 'bio/util/restriction_enzyme'
300
-
301
- ### Service libraries
302
- autoload :Command, 'bio/command'
303
-
304
- ### NeXML lib
305
- autoload :NeXML, 'bio/db/nexml'
306
-
307
- ### Provide BioRuby shell 'command' also as 'Bio.command' (like ChemRuby)
308
-
309
- def self.method_missing(*args)
310
- require 'bio/shell'
311
- extend Bio::Shell
312
- public_class_method(*Bio::Shell.private_instance_methods)
313
- if Bio.respond_to?(args.first)
314
- Bio.send(*args)
315
- else
316
- raise NameError
317
- end
318
- end
319
-
320
- end
321
-
@@ -1,69 +0,0 @@
1
- <?xml version="1.0" encoding="ISO-8859-1"?>
2
- <nex:nexml
3
- version="0.9"
4
- generator="eclipse"
5
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6
- xmlns:xml="http://www.w3.org/XML/1998/namespace"
7
- xmlns:nex="http://www.nexml.org/2009"
8
- xmlns="http://www.nexml.org/2009"
9
- xsi:schemaLocation="http://www.nexml.org/2009 http://www.nexml.org/2009/nexml.xsd">
10
-
11
- <otus id="taxa1" label="A taxa block">
12
- <otu id="o1" label="A taxon"/>
13
- <otu id="o2" label="A taxon"/>
14
- </otus>
15
- <trees otus="taxa1" id="trees1" label="A tree container">
16
- <tree id="tree1" xsi:type="nex:FloatTree" label="A float tree">
17
- <node id="n1" label="A node" root="true" otu="o1"/>
18
- <node id="n2" label="A node"/>
19
- <rootedge id="re1" label="A rootedge" target="n1" length="0.5"/>
20
- <edge source="n1" target="n2" id="e1" length="0.4353" label="An edge"/>
21
- </tree>
22
- <network id="network1" xsi:type="nex:IntNetwork" label="An int network">
23
- <node id="n1n1" label="A node" root="true" otu="o1"/>
24
- <node id="n1n2" label="A node"/>
25
- <edge source="n1n1" target="n1n2" id="n1e1" length="1" label="An edge"/>
26
- <edge source="n1n2" target="n1n2" id="n1e2" length="0" label="An edge"/>
27
- </network>
28
- </trees>
29
- <characters otus="taxa1" id="standardchars6" xsi:type="nex:StandardSeqs" label="Standard sequences">
30
- <format>
31
- <states id="sss1">
32
- <state id="ss1" symbol="1"/>
33
- <state id="ss2" symbol="2"/>
34
- <polymorphic_state_set symbol="4" id="ss4">
35
- <member state="ss1"/>
36
- <member state="ss2"/>
37
- </polymorphic_state_set>
38
- <uncertain_state_set symbol="5" id="ss5">
39
- <member state="ss2"/>
40
- <member state="ss1"/>
41
- </uncertain_state_set>
42
- </states>
43
- <char states="sss1" id="sc1"/>
44
- <char states="sss1" id="sc2"/>
45
- </format>
46
- <matrix>
47
- <row id="sr1" otu="o1">
48
- <seq>1 2</seq>
49
- </row>
50
- <row id="sr2" otu="o2">
51
- <seq>2 2</seq>
52
- </row>
53
- </matrix>
54
- </characters>
55
- <characters otus="taxa1" id="m2" xsi:type="nex:StandardCells" label="Categorical characters">
56
- <format>
57
- <states id="sss2">
58
- <state id="ss6" symbol="1"/>
59
- </states>
60
- <char states="sss2" id="sc3"/>
61
- </format>
62
-
63
- <matrix>
64
- <row id="sr3" otu="o1">
65
- <cell char="sc3" state="ss6"/>
66
- </row>
67
- </matrix>
68
- </characters>
69
- </nex:nexml>
@@ -1,119 +0,0 @@
1
- module Bio
2
- module NeXML
3
- class TestFactory < Test::Unit::TestCase
4
- def setup
5
- @nexml = Bio::NeXML::Nexml.new
6
- @otus = @nexml.create_otus
7
- end
8
-
9
- def test_otus
10
- assert @otus.kind_of? Bio::NeXML::Otus
11
- end
12
-
13
- def test_otu
14
- otu = @otus.create_otu
15
- assert otu.kind_of? Bio::NeXML::Otu
16
- end
17
-
18
- def test_trees
19
- trees = @nexml.create_trees( :otus => @otus )
20
- otu = @otus.create_otu
21
- assert_equal @otus, trees.otus
22
- assert trees.instance_of? Bio::NeXML::Trees
23
-
24
- floattree = trees.create_tree
25
- assert floattree.kind_of? Bio::NeXML::Tree
26
- assert floattree.kind_of? Bio::Tree
27
- assert floattree.kind_of? Bio::NeXML::FloatTree
28
- floatnode = floattree.create_node( :otu => otu )
29
- assert floatnode.kind_of? Bio::NeXML::Node
30
- assert floatnode.kind_of? Bio::Tree::Node
31
- assert_equal otu, floatnode.otu
32
-
33
- floatedge = floattree.create_edge( :source => floatnode, :target => floatnode )
34
- assert floatedge.kind_of? Bio::NeXML::Edge
35
- assert floatedge.kind_of? Bio::Tree::Edge
36
- assert floatedge.kind_of? Bio::NeXML::FloatEdge
37
- floatrootedge = floattree.create_rootedge( :target => floatnode )
38
- assert floatrootedge.kind_of? Bio::NeXML::Edge
39
- assert floatrootedge.kind_of? Bio::Tree::Edge
40
- assert floatrootedge.kind_of? Bio::NeXML::RootEdge
41
- assert floatrootedge.kind_of? Bio::NeXML::FloatRootEdge
42
-
43
- inttree = trees.create_tree( true )
44
- assert inttree.kind_of? Bio::NeXML::Tree
45
- assert inttree.kind_of? Bio::Tree
46
- assert inttree.kind_of? Bio::NeXML::IntTree
47
- intedge = inttree.create_edge
48
- assert intedge.kind_of? Bio::NeXML::Edge
49
- assert intedge.kind_of? Bio::Tree::Edge
50
- assert intedge.kind_of? Bio::NeXML::IntEdge
51
- introotedge = inttree.create_rootedge
52
- assert introotedge.kind_of? Bio::NeXML::Edge
53
- assert introotedge.kind_of? Bio::Tree::Edge
54
- assert introotedge.kind_of? Bio::NeXML::RootEdge
55
- assert introotedge.kind_of? Bio::NeXML::IntRootEdge
56
-
57
- floatnetwork = trees.create_network
58
- assert floatnetwork.kind_of? Bio::NeXML::Tree
59
- assert floatnetwork.kind_of? Bio::Tree
60
- assert floatnetwork.kind_of? Bio::NeXML::FloatNetwork
61
- floatnedge = floatnetwork.create_edge
62
- assert floatnedge.kind_of? Bio::NeXML::Edge
63
- assert floatnedge.kind_of? Bio::Tree::Edge
64
- assert floatnedge.kind_of? Bio::NeXML::FloatEdge
65
-
66
- intnetwork = trees.create_network( true )
67
- assert intnetwork.kind_of? Bio::NeXML::Tree
68
- assert intnetwork.kind_of? Bio::Tree
69
- assert intnetwork.kind_of? Bio::NeXML::IntNetwork
70
- intnedge = intnetwork.create_edge
71
- assert intnedge.kind_of? Bio::NeXML::Edge
72
- assert intnedge.kind_of? Bio::Tree::Edge
73
- assert intnedge.kind_of? Bio::NeXML::IntEdge
74
- end
75
- def test_characters_seqs
76
- otu = @otus.create_otu
77
- dnaseqs = @nexml.create_characters( "Dna", false, :otus => @otus )
78
- assert dnaseqs.kind_of? Bio::NeXML::Characters
79
- assert dnaseqs.kind_of? Bio::NeXML::Dna
80
- assert dnaseqs.kind_of? Bio::NeXML::DnaSeqs
81
- assert_equal @otus, dnaseqs.otus
82
-
83
- format = dnaseqs.create_format
84
- assert format.kind_of? Bio::NeXML::Format
85
- assert_equal format, dnaseqs.format
86
-
87
- matrix = dnaseqs.create_matrix
88
- assert matrix.kind_of? Bio::NeXML::Matrix
89
- assert matrix.kind_of? Bio::NeXML::SeqMatrix
90
- assert_equal matrix, dnaseqs.matrix
91
-
92
- row = matrix.create_row( :otu => otu )
93
- assert row.kind_of? Bio::NeXML::Row
94
- assert row.kind_of? Bio::NeXML::SeqRow
95
- assert_equal otu, row.otu
96
-
97
- seq = 'ACATGCAG'
98
- newrow = dnaseqs.create_raw( seq )
99
- assert_equal newrow.sequences.first.value, seq
100
- end
101
- def test_characters_cells
102
- otu1 = @otus.create_otu
103
- otu2 = @otus.create_otu
104
- standardcells = @nexml.create_characters( "Standard", true, :otus => @otus )
105
- newrow1 = standardcells.create_raw('1 2 3 4 5')
106
- newrow1.otu = otu1
107
- newrow2 = standardcells.create_raw('1 2 3 4 5')
108
- newrow2.otu = otu2
109
- assert_equal otu1, newrow1.otu
110
- assert_equal otu2, newrow2.otu
111
- assert newrow1.kind_of? Bio::NeXML::Row
112
- assert newrow1.kind_of? Bio::NeXML::CellRow
113
- assert standardcells.kind_of? Bio::NeXML::Characters
114
- assert standardcells.kind_of? Bio::NeXML::Standard
115
- assert standardcells.kind_of? Bio::NeXML::StandardCells
116
- end
117
- end
118
- end
119
- end