jandot-bio 1.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (335) hide show
  1. data/bin/bioruby +44 -0
  2. data/bin/br_biofetch.rb +47 -0
  3. data/bin/br_bioflat.rb +282 -0
  4. data/bin/br_biogetseq.rb +45 -0
  5. data/bin/br_pmfetch.rb +421 -0
  6. data/doc/Changes-0.7.rd +369 -0
  7. data/doc/KEGG_API.rd +1843 -0
  8. data/doc/KEGG_API.rd.ja +1834 -0
  9. data/doc/Tutorial.rd +1296 -0
  10. data/doc/Tutorial.rd.ja +2640 -0
  11. data/etc/bioinformatics/seqdatabase.ini +210 -0
  12. data/lib/bio.rb +279 -0
  13. data/lib/bio/alignment.rb +2518 -0
  14. data/lib/bio/appl/bl2seq/report.rb +334 -0
  15. data/lib/bio/appl/blast.rb +351 -0
  16. data/lib/bio/appl/blast/format0.rb +1438 -0
  17. data/lib/bio/appl/blast/format8.rb +83 -0
  18. data/lib/bio/appl/blast/report.rb +516 -0
  19. data/lib/bio/appl/blast/rexml.rb +135 -0
  20. data/lib/bio/appl/blast/rpsblast.rb +176 -0
  21. data/lib/bio/appl/blast/wublast.rb +550 -0
  22. data/lib/bio/appl/blast/xmlparser.rb +228 -0
  23. data/lib/bio/appl/blat/report.rb +489 -0
  24. data/lib/bio/appl/clustalw.rb +219 -0
  25. data/lib/bio/appl/clustalw/report.rb +152 -0
  26. data/lib/bio/appl/emboss.rb +203 -0
  27. data/lib/bio/appl/fasta.rb +237 -0
  28. data/lib/bio/appl/fasta/format10.rb +325 -0
  29. data/lib/bio/appl/gcg/msf.rb +212 -0
  30. data/lib/bio/appl/gcg/seq.rb +195 -0
  31. data/lib/bio/appl/genscan/report.rb +552 -0
  32. data/lib/bio/appl/hmmer.rb +126 -0
  33. data/lib/bio/appl/hmmer/report.rb +683 -0
  34. data/lib/bio/appl/iprscan/report.rb +374 -0
  35. data/lib/bio/appl/mafft.rb +259 -0
  36. data/lib/bio/appl/mafft/report.rb +226 -0
  37. data/lib/bio/appl/muscle.rb +52 -0
  38. data/lib/bio/appl/phylip/alignment.rb +129 -0
  39. data/lib/bio/appl/phylip/distance_matrix.rb +96 -0
  40. data/lib/bio/appl/probcons.rb +41 -0
  41. data/lib/bio/appl/psort.rb +548 -0
  42. data/lib/bio/appl/psort/report.rb +457 -0
  43. data/lib/bio/appl/pts1.rb +263 -0
  44. data/lib/bio/appl/sim4.rb +124 -0
  45. data/lib/bio/appl/sim4/report.rb +485 -0
  46. data/lib/bio/appl/sosui/report.rb +151 -0
  47. data/lib/bio/appl/spidey/report.rb +593 -0
  48. data/lib/bio/appl/targetp/report.rb +267 -0
  49. data/lib/bio/appl/tcoffee.rb +55 -0
  50. data/lib/bio/appl/tmhmm/report.rb +222 -0
  51. data/lib/bio/command.rb +337 -0
  52. data/lib/bio/data/aa.rb +349 -0
  53. data/lib/bio/data/codontable.rb +722 -0
  54. data/lib/bio/data/na.rb +223 -0
  55. data/lib/bio/db.rb +329 -0
  56. data/lib/bio/db/aaindex.rb +357 -0
  57. data/lib/bio/db/embl/common.rb +336 -0
  58. data/lib/bio/db/embl/embl.rb +402 -0
  59. data/lib/bio/db/embl/sptr.rb +1283 -0
  60. data/lib/bio/db/embl/swissprot.rb +42 -0
  61. data/lib/bio/db/embl/trembl.rb +41 -0
  62. data/lib/bio/db/embl/uniprot.rb +42 -0
  63. data/lib/bio/db/fantom.rb +599 -0
  64. data/lib/bio/db/fasta.rb +907 -0
  65. data/lib/bio/db/genbank/common.rb +290 -0
  66. data/lib/bio/db/genbank/ddbj.rb +22 -0
  67. data/lib/bio/db/genbank/genbank.rb +215 -0
  68. data/lib/bio/db/genbank/genpept.rb +60 -0
  69. data/lib/bio/db/genbank/refseq.rb +18 -0
  70. data/lib/bio/db/gff.rb +174 -0
  71. data/lib/bio/db/go.rb +481 -0
  72. data/lib/bio/db/kegg/brite.rb +41 -0
  73. data/lib/bio/db/kegg/compound.rb +131 -0
  74. data/lib/bio/db/kegg/drug.rb +98 -0
  75. data/lib/bio/db/kegg/enzyme.rb +148 -0
  76. data/lib/bio/db/kegg/expression.rb +155 -0
  77. data/lib/bio/db/kegg/genes.rb +263 -0
  78. data/lib/bio/db/kegg/genome.rb +241 -0
  79. data/lib/bio/db/kegg/glycan.rb +170 -0
  80. data/lib/bio/db/kegg/keggtab.rb +357 -0
  81. data/lib/bio/db/kegg/kgml.rb +256 -0
  82. data/lib/bio/db/kegg/orthology.rb +136 -0
  83. data/lib/bio/db/kegg/reaction.rb +82 -0
  84. data/lib/bio/db/kegg/taxonomy.rb +331 -0
  85. data/lib/bio/db/lasergene.rb +209 -0
  86. data/lib/bio/db/litdb.rb +107 -0
  87. data/lib/bio/db/medline.rb +323 -0
  88. data/lib/bio/db/nbrf.rb +191 -0
  89. data/lib/bio/db/newick.rb +658 -0
  90. data/lib/bio/db/nexus.rb +1854 -0
  91. data/lib/bio/db/pdb.rb +29 -0
  92. data/lib/bio/db/pdb/atom.rb +77 -0
  93. data/lib/bio/db/pdb/chain.rb +210 -0
  94. data/lib/bio/db/pdb/chemicalcomponent.rb +224 -0
  95. data/lib/bio/db/pdb/model.rb +148 -0
  96. data/lib/bio/db/pdb/pdb.rb +1911 -0
  97. data/lib/bio/db/pdb/residue.rb +176 -0
  98. data/lib/bio/db/pdb/utils.rb +399 -0
  99. data/lib/bio/db/prosite.rb +597 -0
  100. data/lib/bio/db/rebase.rb +457 -0
  101. data/lib/bio/db/soft.rb +404 -0
  102. data/lib/bio/db/transfac.rb +375 -0
  103. data/lib/bio/feature.rb +226 -0
  104. data/lib/bio/io/das.rb +461 -0
  105. data/lib/bio/io/dbget.rb +194 -0
  106. data/lib/bio/io/ddbjxml.rb +581 -0
  107. data/lib/bio/io/ebisoap.rb +158 -0
  108. data/lib/bio/io/ensembl.rb +229 -0
  109. data/lib/bio/io/fastacmd.rb +163 -0
  110. data/lib/bio/io/fetch.rb +181 -0
  111. data/lib/bio/io/flatfile.rb +1309 -0
  112. data/lib/bio/io/flatfile/bdb.rb +253 -0
  113. data/lib/bio/io/flatfile/index.rb +1371 -0
  114. data/lib/bio/io/flatfile/indexer.rb +787 -0
  115. data/lib/bio/io/higet.rb +73 -0
  116. data/lib/bio/io/hinv.rb +442 -0
  117. data/lib/bio/io/keggapi.rb +805 -0
  118. data/lib/bio/io/ncbirest.rb +256 -0
  119. data/lib/bio/io/ncbisoap.rb +155 -0
  120. data/lib/bio/io/pubmed.rb +307 -0
  121. data/lib/bio/io/registry.rb +292 -0
  122. data/lib/bio/io/soapwsdl.rb +119 -0
  123. data/lib/bio/io/sql.rb +365 -0
  124. data/lib/bio/location.rb +772 -0
  125. data/lib/bio/map.rb +410 -0
  126. data/lib/bio/pathway.rb +854 -0
  127. data/lib/bio/reference.rb +623 -0
  128. data/lib/bio/sequence.rb +475 -0
  129. data/lib/bio/sequence/aa.rb +125 -0
  130. data/lib/bio/sequence/common.rb +333 -0
  131. data/lib/bio/sequence/compat.rb +123 -0
  132. data/lib/bio/sequence/format.rb +181 -0
  133. data/lib/bio/sequence/generic.rb +24 -0
  134. data/lib/bio/sequence/na.rb +491 -0
  135. data/lib/bio/shell.rb +44 -0
  136. data/lib/bio/shell/core.rb +578 -0
  137. data/lib/bio/shell/demo.rb +146 -0
  138. data/lib/bio/shell/interface.rb +218 -0
  139. data/lib/bio/shell/irb.rb +95 -0
  140. data/lib/bio/shell/object.rb +71 -0
  141. data/lib/bio/shell/plugin/blast.rb +42 -0
  142. data/lib/bio/shell/plugin/codon.rb +218 -0
  143. data/lib/bio/shell/plugin/das.rb +58 -0
  144. data/lib/bio/shell/plugin/emboss.rb +23 -0
  145. data/lib/bio/shell/plugin/entry.rb +105 -0
  146. data/lib/bio/shell/plugin/flatfile.rb +101 -0
  147. data/lib/bio/shell/plugin/keggapi.rb +181 -0
  148. data/lib/bio/shell/plugin/midi.rb +430 -0
  149. data/lib/bio/shell/plugin/obda.rb +45 -0
  150. data/lib/bio/shell/plugin/psort.rb +56 -0
  151. data/lib/bio/shell/plugin/seq.rb +247 -0
  152. data/lib/bio/shell/plugin/soap.rb +87 -0
  153. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/bioruby_generator.rb +29 -0
  154. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/_classes.rhtml +4 -0
  155. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/_log.rhtml +27 -0
  156. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/_methods.rhtml +11 -0
  157. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/_modules.rhtml +4 -0
  158. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/_variables.rhtml +7 -0
  159. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby-bg.gif +0 -0
  160. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby-gem.png +0 -0
  161. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby-link.gif +0 -0
  162. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby.css +368 -0
  163. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby.rhtml +47 -0
  164. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_controller.rb +144 -0
  165. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/bioruby_helper.rb +47 -0
  166. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/commands.rhtml +8 -0
  167. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/history.rhtml +10 -0
  168. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/index.rhtml +26 -0
  169. data/lib/bio/shell/rails/vendor/plugins/bioruby/generators/bioruby/templates/spinner.gif +0 -0
  170. data/lib/bio/shell/script.rb +25 -0
  171. data/lib/bio/shell/setup.rb +109 -0
  172. data/lib/bio/shell/web.rb +102 -0
  173. data/lib/bio/tree.rb +850 -0
  174. data/lib/bio/util/color_scheme.rb +191 -0
  175. data/lib/bio/util/color_scheme/buried.rb +59 -0
  176. data/lib/bio/util/color_scheme/helix.rb +59 -0
  177. data/lib/bio/util/color_scheme/hydropathy.rb +64 -0
  178. data/lib/bio/util/color_scheme/nucleotide.rb +31 -0
  179. data/lib/bio/util/color_scheme/strand.rb +59 -0
  180. data/lib/bio/util/color_scheme/taylor.rb +50 -0
  181. data/lib/bio/util/color_scheme/turn.rb +59 -0
  182. data/lib/bio/util/color_scheme/zappo.rb +50 -0
  183. data/lib/bio/util/contingency_table.rb +370 -0
  184. data/lib/bio/util/restriction_enzyme.rb +228 -0
  185. data/lib/bio/util/restriction_enzyme/analysis.rb +249 -0
  186. data/lib/bio/util/restriction_enzyme/analysis_basic.rb +217 -0
  187. data/lib/bio/util/restriction_enzyme/cut_symbol.rb +107 -0
  188. data/lib/bio/util/restriction_enzyme/double_stranded.rb +321 -0
  189. data/lib/bio/util/restriction_enzyme/double_stranded/aligned_strands.rb +130 -0
  190. data/lib/bio/util/restriction_enzyme/double_stranded/cut_location_pair.rb +103 -0
  191. data/lib/bio/util/restriction_enzyme/double_stranded/cut_location_pair_in_enzyme_notation.rb +38 -0
  192. data/lib/bio/util/restriction_enzyme/double_stranded/cut_locations.rb +76 -0
  193. data/lib/bio/util/restriction_enzyme/double_stranded/cut_locations_in_enzyme_notation.rb +107 -0
  194. data/lib/bio/util/restriction_enzyme/enzymes.yaml +7061 -0
  195. data/lib/bio/util/restriction_enzyme/range/cut_range.rb +24 -0
  196. data/lib/bio/util/restriction_enzyme/range/cut_ranges.rb +47 -0
  197. data/lib/bio/util/restriction_enzyme/range/horizontal_cut_range.rb +67 -0
  198. data/lib/bio/util/restriction_enzyme/range/sequence_range.rb +257 -0
  199. data/lib/bio/util/restriction_enzyme/range/sequence_range/calculated_cuts.rb +242 -0
  200. data/lib/bio/util/restriction_enzyme/range/sequence_range/fragment.rb +51 -0
  201. data/lib/bio/util/restriction_enzyme/range/sequence_range/fragments.rb +41 -0
  202. data/lib/bio/util/restriction_enzyme/range/vertical_cut_range.rb +77 -0
  203. data/lib/bio/util/restriction_enzyme/single_strand.rb +199 -0
  204. data/lib/bio/util/restriction_enzyme/single_strand/cut_locations_in_enzyme_notation.rb +135 -0
  205. data/lib/bio/util/restriction_enzyme/single_strand_complement.rb +23 -0
  206. data/lib/bio/util/restriction_enzyme/string_formatting.rb +111 -0
  207. data/lib/bio/util/sirna.rb +288 -0
  208. data/sample/any2fasta.rb +59 -0
  209. data/sample/biofetch.rb +475 -0
  210. data/sample/color_scheme_na.rb +91 -0
  211. data/sample/dbget +37 -0
  212. data/sample/enzymes.rb +78 -0
  213. data/sample/fasta2tab.rb +99 -0
  214. data/sample/fastagrep.rb +72 -0
  215. data/sample/fastasort.rb +54 -0
  216. data/sample/fsplit.rb +51 -0
  217. data/sample/gb2fasta.rb +30 -0
  218. data/sample/gb2tab.rb +325 -0
  219. data/sample/gbtab2mysql.rb +161 -0
  220. data/sample/genes2nuc.rb +33 -0
  221. data/sample/genes2pep.rb +33 -0
  222. data/sample/genes2tab.rb +81 -0
  223. data/sample/genome2rb.rb +29 -0
  224. data/sample/genome2tab.rb +76 -0
  225. data/sample/goslim.rb +303 -0
  226. data/sample/gt2fasta.rb +47 -0
  227. data/sample/na2aa.rb +34 -0
  228. data/sample/pmfetch.rb +42 -0
  229. data/sample/pmsearch.rb +42 -0
  230. data/sample/psortplot_html.rb +214 -0
  231. data/sample/ssearch2tab.rb +96 -0
  232. data/sample/tdiary.rb +158 -0
  233. data/sample/tfastx2tab.rb +100 -0
  234. data/sample/vs-genes.rb +212 -0
  235. data/test/data/HMMER/hmmpfam.out +64 -0
  236. data/test/data/HMMER/hmmsearch.out +88 -0
  237. data/test/data/SOSUI/sample.report +11 -0
  238. data/test/data/TMHMM/sample.report +21 -0
  239. data/test/data/aaindex/DAYM780301 +30 -0
  240. data/test/data/aaindex/PRAM900102 +20 -0
  241. data/test/data/bl2seq/cd8a_cd8b_blastp.bl2seq +53 -0
  242. data/test/data/bl2seq/cd8a_p53_e-5blastp.bl2seq +37 -0
  243. data/test/data/blast/2.2.15.blastp.m7 +876 -0
  244. data/test/data/blast/b0002.faa +15 -0
  245. data/test/data/blast/b0002.faa.m0 +128 -0
  246. data/test/data/blast/b0002.faa.m7 +65 -0
  247. data/test/data/blast/b0002.faa.m8 +1 -0
  248. data/test/data/embl/AB090716.embl +65 -0
  249. data/test/data/embl/AB090716.embl.rel89 +63 -0
  250. data/test/data/fasta/example1.txt +75 -0
  251. data/test/data/fasta/example2.txt +21 -0
  252. data/test/data/genscan/sample.report +63 -0
  253. data/test/data/iprscan/merged.raw +32 -0
  254. data/test/data/iprscan/merged.txt +74 -0
  255. data/test/data/prosite/prosite.dat +2233 -0
  256. data/test/data/refseq/nm_126355.entret +64 -0
  257. data/test/data/soft/GDS100_partial.soft +92 -0
  258. data/test/data/soft/GSE3457_family_partial.soft +874 -0
  259. data/test/data/uniprot/p53_human.uniprot +1456 -0
  260. data/test/functional/bio/io/test_ensembl.rb +186 -0
  261. data/test/functional/bio/io/test_soapwsdl.rb +52 -0
  262. data/test/runner.rb +14 -0
  263. data/test/unit/bio/appl/bl2seq/test_report.rb +134 -0
  264. data/test/unit/bio/appl/blast/test_report.rb +417 -0
  265. data/test/unit/bio/appl/blast/test_xmlparser.rb +388 -0
  266. data/test/unit/bio/appl/genscan/test_report.rb +182 -0
  267. data/test/unit/bio/appl/hmmer/test_report.rb +342 -0
  268. data/test/unit/bio/appl/iprscan/test_report.rb +338 -0
  269. data/test/unit/bio/appl/mafft/test_report.rb +63 -0
  270. data/test/unit/bio/appl/sosui/test_report.rb +81 -0
  271. data/test/unit/bio/appl/targetp/test_report.rb +146 -0
  272. data/test/unit/bio/appl/test_blast.rb +163 -0
  273. data/test/unit/bio/appl/test_fasta.rb +130 -0
  274. data/test/unit/bio/appl/test_pts1.rb +140 -0
  275. data/test/unit/bio/appl/tmhmm/test_report.rb +126 -0
  276. data/test/unit/bio/data/test_aa.rb +90 -0
  277. data/test/unit/bio/data/test_codontable.rb +107 -0
  278. data/test/unit/bio/data/test_na.rb +80 -0
  279. data/test/unit/bio/db/embl/test_common.rb +117 -0
  280. data/test/unit/bio/db/embl/test_embl.rb +214 -0
  281. data/test/unit/bio/db/embl/test_embl_rel89.rb +219 -0
  282. data/test/unit/bio/db/embl/test_sptr.rb +1775 -0
  283. data/test/unit/bio/db/embl/test_uniprot.rb +31 -0
  284. data/test/unit/bio/db/kegg/test_genes.rb +45 -0
  285. data/test/unit/bio/db/pdb/test_pdb.rb +152 -0
  286. data/test/unit/bio/db/test_aaindex.rb +197 -0
  287. data/test/unit/bio/db/test_fasta.rb +250 -0
  288. data/test/unit/bio/db/test_gff.rb +127 -0
  289. data/test/unit/bio/db/test_lasergene.rb +95 -0
  290. data/test/unit/bio/db/test_newick.rb +293 -0
  291. data/test/unit/bio/db/test_nexus.rb +360 -0
  292. data/test/unit/bio/db/test_prosite.rb +1437 -0
  293. data/test/unit/bio/db/test_rebase.rb +101 -0
  294. data/test/unit/bio/db/test_soft.rb +138 -0
  295. data/test/unit/bio/io/test_ddbjxml.rb +75 -0
  296. data/test/unit/bio/io/test_ensembl.rb +109 -0
  297. data/test/unit/bio/io/test_fastacmd.rb +42 -0
  298. data/test/unit/bio/io/test_flatfile.rb +237 -0
  299. data/test/unit/bio/io/test_soapwsdl.rb +32 -0
  300. data/test/unit/bio/sequence/test_aa.rb +103 -0
  301. data/test/unit/bio/sequence/test_common.rb +174 -0
  302. data/test/unit/bio/sequence/test_compat.rb +69 -0
  303. data/test/unit/bio/sequence/test_na.rb +330 -0
  304. data/test/unit/bio/shell/plugin/test_seq.rb +185 -0
  305. data/test/unit/bio/test_alignment.rb +1025 -0
  306. data/test/unit/bio/test_command.rb +288 -0
  307. data/test/unit/bio/test_db.rb +96 -0
  308. data/test/unit/bio/test_feature.rb +116 -0
  309. data/test/unit/bio/test_location.rb +39 -0
  310. data/test/unit/bio/test_map.rb +230 -0
  311. data/test/unit/bio/test_pathway.rb +473 -0
  312. data/test/unit/bio/test_reference.rb +224 -0
  313. data/test/unit/bio/test_sequence.rb +329 -0
  314. data/test/unit/bio/test_shell.rb +18 -0
  315. data/test/unit/bio/test_tree.rb +593 -0
  316. data/test/unit/bio/util/restriction_enzyme/analysis/test_calculated_cuts.rb +299 -0
  317. data/test/unit/bio/util/restriction_enzyme/analysis/test_cut_ranges.rb +103 -0
  318. data/test/unit/bio/util/restriction_enzyme/analysis/test_sequence_range.rb +240 -0
  319. data/test/unit/bio/util/restriction_enzyme/double_stranded/test_aligned_strands.rb +101 -0
  320. data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair.rb +75 -0
  321. data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_location_pair_in_enzyme_notation.rb +73 -0
  322. data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations.rb +53 -0
  323. data/test/unit/bio/util/restriction_enzyme/double_stranded/test_cut_locations_in_enzyme_notation.rb +104 -0
  324. data/test/unit/bio/util/restriction_enzyme/single_strand/test_cut_locations_in_enzyme_notation.rb +83 -0
  325. data/test/unit/bio/util/restriction_enzyme/test_analysis.rb +246 -0
  326. data/test/unit/bio/util/restriction_enzyme/test_cut_symbol.rb +44 -0
  327. data/test/unit/bio/util/restriction_enzyme/test_double_stranded.rb +115 -0
  328. data/test/unit/bio/util/restriction_enzyme/test_single_strand.rb +147 -0
  329. data/test/unit/bio/util/restriction_enzyme/test_single_strand_complement.rb +147 -0
  330. data/test/unit/bio/util/restriction_enzyme/test_string_formatting.rb +60 -0
  331. data/test/unit/bio/util/test_color_scheme.rb +33 -0
  332. data/test/unit/bio/util/test_contingency_table.rb +94 -0
  333. data/test/unit/bio/util/test_restriction_enzyme.rb +42 -0
  334. data/test/unit/bio/util/test_sirna.rb +245 -0
  335. metadata +479 -0
@@ -0,0 +1,2640 @@
1
+ =begin
2
+
3
+ $Id: Tutorial.rd.ja,v 1.20 2006/02/27 09:12:18 k Exp $
4
+
5
+ Copyright (C) 2001-2003, 2005, 2006 Toshiaki Katayama <k@bioruby.org>
6
+ Copyright (C) 2005, 2006 Naohisa Goto <ng@bioruby.org>
7
+
8
+ = BioRuby �λȤ���
9
+
10
+ BioRuby �Ϲ񻺤ιⵡǽ���֥������Ȼظ�������ץȸ��� Ruby �Τ����
11
+ �����ץ󥽡����ʥХ�������ե��ޥƥ������ѥ饤�֥��Ǥ���
12
+
13
+ Ruby ����� Perl ����椺��ζ��Ϥʥƥ����Ƚ����ȡ�
14
+ ����ץ��ʬ����䤹��ʸˡ�����ꥢ�ʥ��֥������Ȼظ���ǽ�ˤ�ꡢ
15
+ �����Ȥ���褦�ˤʤ�ޤ�����Ruby �ˤĤ��ƾܤ����ϡ������֥�����
16
+ ((<URL:http://www.ruby-lang.org/>)) ����Τν������򻲾Ȥ��Ƥ���������
17
+
18
+ == �Ϥ����
19
+
20
+ BioRuby ����Ѥ���ˤ� Ruby �� BioRuby �򥤥󥹥ȡ��뤹��ɬ�פ�����ޤ���
21
+
22
+ === Ruby �Υ��󥹥ȡ���
23
+
24
+ Ruby �� Mac OS X ��Ƕ�� UNIX �ˤ��̾磻�󥹥ȡ��뤵��Ƥ��ޤ���
25
+ Windows �ξ��⣱����å����󥹥ȡ���� ActiveScriptRuby �ʤɤ�
26
+ �Ѱդ���Ƥ��ޤ����ޤ����󥹥ȡ��뤵��Ƥ��ʤ�����
27
+
28
+ * ((<URL:http://jp.rubyist.net/magazine/?0002-FirstProgramming>))
29
+ * ((<URL:http://jp.rubyist.net/magazine/?FirstStepRuby>))
30
+
31
+ �ʤɤ򻲹ͤˤ��ƥ��󥹥ȡ��뤷�ޤ��礦��
32
+
33
+ ���ʤ��Υ���ԥ塼���ˤɤΥС������� Ruby �����󥹥ȡ��뤵��Ƥ��뤫��
34
+ �����å�����ˤ�
35
+
36
+ % ruby -v
37
+
38
+ �ȥ��ޥ�ɤ����Ϥ��Ƥ�������������ȡ����Ȥ���
39
+
40
+ ruby 1.8.2 (2004-12-25) [powerpc-darwin7.7.0]
41
+
42
+ �Τ褦�ʴ����ǥС������ɽ������ޤ����С������ 1.8.2 �ʹߤ򤪴��ᤷ�ޤ���
43
+
44
+ Ruby ɸ�������Υ��饹��᥽�åɤˤĤ��Ƥϡ�Ruby �Υ�ե���󥹥ޥ˥奢���
45
+ ���Ȥ��Ƥ���������
46
+
47
+ * ((<URL:http://www.ruby-lang.org/ja/man/>))
48
+
49
+ ���ޥ�ɥ饤��ǥإ�פ򻲾Ȥ���ˤϡ�Ruby ɸ��ź�դ� ri ���ޥ�ɤ䡢
50
+ ���ܸ��Ǥ� refe ���ޥ�ɤ������Ǥ���
51
+
52
+ * ((<URL:http://i.loveruby.net/ja/prog/refe.html>))
53
+
54
+ === RubyGems �Υ��󥹥ȡ���
55
+
56
+ RubyGems �Υڡ�������ǿ��Ǥ����������ɤ��ޤ���
57
+
58
+ * ((<URL:http://rubyforge.org/projects/rubygems/>))
59
+
60
+ Ÿ�����ƥ��󥹥ȡ��뤷�ޤ���
61
+
62
+ % tar zxvf rubygems-x.x.x.tar.gz
63
+ % cd rubygems-x.x.x
64
+ % ruby setup.rb
65
+
66
+ === BioRuby �Υ��󥹥ȡ���
67
+
68
+ BioRuby �Υ��󥹥ȡ�����ˡ�� ((<URL:http://bioruby.org/archive/>)) ����
69
+ �ǿ��Ǥ�������ưʲ��Τ褦�˹Ԥ��ޤ���Ʊ������Ƥ��� README �ե�����ˤ�
70
+ �ܤ��̤���ĺ�������ΤǤ���������ʤ��ȣ���������ˤʤ� BioPerl ����٤�
71
+ BioRuby �Υ��󥹥ȡ���Ϥ����˽����Ϥ��Ǥ���
72
+
73
+ % wget http://bioruby.org/archive/bioruby-x.x.x.tar.gz
74
+ % tar zxvf bioruby-x.x.x.tar.gz
75
+ % cd bioruby-x.x.x
76
+ % ruby install.rb config
77
+ % ruby install.rb setup
78
+ # ruby install.rb install
79
+
80
+ RubyGems ���Ȥ���Ķ��Ǥ����
81
+
82
+ % gem install bio
83
+
84
+ �����ǥ��󥹥ȡ���Ǥ��ޤ������Τ��� README �ե�����˽񤫤�Ƥ���褦��
85
+
86
+ bioruby-x.x.x/etc/bioinformatics/seqdatabase.ini
87
+
88
+ �Ȥ����ե������ۡ���ǥ��쥯�ȥ�� ~/.bioinformatics �˥��ԡ�����
89
+ �����Ȥ褤�Ǥ��礦��RubyGems �ξ���
90
+
91
+ /usr/local/lib/ruby/gems/1.8/gems/bio-x.x.x/
92
+
93
+ �ʤɤˤ���Ϥ��Ǥ���
94
+
95
+ % mkdir ~/.bioinformatics
96
+ % cp bioruby-x.x.x/etc/bioinformatics/seqdatabase.ini ~/.bioinformatics
97
+
98
+ �ޤ���Emacs ���ǥ�����Ȥ��ͤ� Ruby �Υ�������Ʊ������Ƥ���
99
+ misc/ruby-mode.el �򥤥󥹥ȡ��뤷�Ƥ����Ȥ褤�Ǥ��礦��
100
+
101
+ % mkdir -p ~/lib/lisp/ruby
102
+ % cp ruby-x.x.x/misc/ruby-mode.el ~/lib/lisp/ruby
103
+
104
+ �ʤɤȤ��Ƥ����ơ�~/.emacs �˰ʲ���������­���ޤ���
105
+
106
+ ; subdirs ������
107
+ (let ((default-directory "~/lib/lisp"))
108
+ (normal-top-level-add-subdirs-to-load-path)
109
+
110
+ ; ruby-mode ������
111
+ (autoload 'ruby-mode "ruby-mode" "Mode for editing ruby source files")
112
+ (add-to-list 'auto-mode-alist '("\\.rb$" . rd-mode))
113
+ (add-to-list 'interpeter-mode-alist '("ruby" . ruby-mode))
114
+
115
+ == BioRuby ������
116
+
117
+ BioRuby �С������ 0.7 �ʹߤǤϡ���ñ������ BioRuby �ȶ��˥��󥹥ȡ��뤵���
118
+ bioruby ���ޥ�ɤǹԤ����Ȥ��Ǥ��ޤ���bioruby ���ޥ�ɤ� Ruby ����¢����Ƥ���
119
+ ���󥿥饯�ƥ��֥����� irb �����Ѥ��Ƥ��ꡢRuby �� BioRuby �ˤǤ��뤳�Ȥ�����
120
+ ��ͳ�˼¹Ԥ��뤳�Ȥ��Ǥ��ޤ���
121
+
122
+ % bioruby project1
123
+
124
+ �����ǻ��ꤷ��̾���Υǥ��쥯�ȥ꤬�������졢������Dz��Ϥ�Ԥ��ޤ���
125
+ �嵭����ξ�� project1 �Ȥ����ǥ��쥯�ȥ꤬�������졢����˰ʲ���
126
+ ���֥ǥ��쥯�ȥ��ե����뤬����ޤ���
127
+
128
+ data/ �桼���β��ϥե�������֤����
129
+ plugin/ ɬ�פ˱������ɲäΥץ饰������֤����
130
+ session/ ����䥪�֥������ȡ��ҥ��ȥ�ʤɤ���¸�������
131
+ session/config �桼�����������¸�����ե�����
132
+ session/history �桼�������Ϥ������ޥ�ɤΥҥ��ȥ����¸�����ե�����
133
+ session/object ��³�����줿���֥������Ȥγ�Ǽ�ե�����
134
+
135
+ ���Τ�����data �ǥ��쥯�ȥ�ϥ桼������ͳ�˽񤭴����ƹ����ޤ���
136
+ �ޤ���session/history �ե�����򸫤�ȡ����ĤɤΤ褦������Ԥä�����
137
+ ��ǧ���뤳�Ȥ��Ǥ��ޤ���
138
+
139
+ �����ܰʹߤϡ�����Ʊ�ͤ�
140
+
141
+ % bioruby project1
142
+
143
+ �Ȥ��Ƶ�ư���Ƥ⹽���ޤ��󤷡��������줿�ǥ��쥯�ȥ�˰�ư����
144
+
145
+ % cd project1
146
+ % bioruby
147
+
148
+ �Τ褦�˰����ʤ��ǵ�ư���뤳�Ȥ�Ǥ��ޤ���
149
+
150
+ ����¾��script ���ޥ�ɤǺ�������륹����ץȥե�����䡢
151
+ web ���ޥ�ɤǺ�������� Rails �Τ��������ե�����ʤɤ�����ޤ�����
152
+ �����ˤĤ��Ƥ�ɬ�פ˱����Ƹ�Ҥ��ޤ���
153
+
154
+ BioRuby ������Ǥϥǥե���ȤǤ����Ĥ��������ʥ饤�֥����ɤ߹���Ǥ��ޤ���
155
+ �㤨�� readline �饤�֥�꤬�Ȥ���Ķ��Ǥ� Tab �����ǥ᥽�å�̾���ѿ�̾��
156
+ �䴰�����Ϥ��Ǥ���open-uri, pp, yaml �ʤɤ�ǽ餫���ɤ߹��ޤ�Ƥ��ޤ���
157
+
158
+ === ����, ���ߥλ����������
159
+
160
+ --- seq(str)
161
+
162
+ seq ���ޥ�ɤ�Ȥä�ʸ���󤫤��������䥢�ߥλ�������뤳�Ȥ��Ǥ��ޤ���
163
+ ����ȥ��ߥλ��� ATGC �δ��̤� 90% �ʾ夫�ɤ����Ǽ�ưȽ�ꤵ��ޤ���
164
+ �����Ǥϡ��Ǥ������������ dna �Ȥ����ѿ����������ޤ���
165
+
166
+ bioruby> dna = seq("atgcatgcaaaa")
167
+
168
+ �ѿ�����Ȥ��ǧ����ˤ� Ruby �� puts �᥽�åɤ�Ȥ��ޤ���
169
+
170
+ bioruby> puts dna
171
+ atgcatgcaaaa
172
+
173
+ �ե�����̾�������Ϳ����ȼ긵�ˤ���ե����뤫����������뤳�Ȥ�Ǥ��ޤ���
174
+ GenBank, EMBL, UniProt, FASTA �ʤɼ��פ�����ե����ޥåȤϼ�ưȽ�̤���ޤ�
175
+ �ʳ�ĥ�ҤʤɤΥե�����̾�ǤϤʤ�����ȥ����Ȥ�Ƚ�ꤷ�ޤ��ˡ�
176
+ �ʲ��� UniProt �ե����ޥåȤΥ���ȥ��ե����뤫���ɤ߹���Ǥ��ޤ���
177
+ ������ˡ�Ǥϡ�ʣ���Υ���ȥ꤬������ǽ�Υ���ȥ�������ɤ߹��ޤ�ޤ���
178
+
179
+ bioruby> cdc2 = seq("p04551.sp")
180
+ bioruby> puts cdc2
181
+ MENYQKVEKIGEGTYGVVYKARHKLSGRIVAMKKIRLEDESEGVPSTAIREISLLKEVNDENNRSN...(ά)
182
+
183
+ �ǡ����١���̾�ȥ���ȥ�̾��ʬ���äƤ���С����󥿡��ͥåȤ��̤���
184
+ �����ưŪ�˼������뤳�Ȥ��Ǥ��ޤ���
185
+
186
+ bioruby> psaB = seq("genbank:AB044425")
187
+ bioruby> puts psaB
188
+ actgaccctgttcatattcgtcctattgctcacgcgatttgggatccgcactttggccaaccagca...(ά)
189
+
190
+ �ɤ��Υǡ����١�������ɤΤ褦����ˡ�ǥ���ȥ��������뤫�ϡ�BioPerl
191
+ �ʤɤȶ��̤� OBDA ����ե����� ~/.bioinformatics/seqdatabase.ini
192
+ ���Ѥ��ƥǡ����١������Ȥ˻��ꤹ�뤳�Ȥ��Ǥ��ޤ��ʸ�ҡˡ�
193
+ �ޤ���EMBOSS �� seqret ���ޥ�ɤˤ����������ˤ��б����Ƥ��ޤ��Τǡ�
194
+ EMBOSS �� USA ɽ���Ǥ⥨��ȥ������Ǥ��ޤ���EMBOSS �Υޥ˥奢��򻲾Ȥ�
195
+ ~/.embossrc ��Ŭ�ڤ����ꤷ�Ƥ���������
196
+
197
+ �ɤ���ˡ�Ǽ����������⡢seq ���ޥ�ɤˤ�ä��֤��������ϡ�
198
+ DNA ����Τ���� Bio::Sequence::NA ���饹�������ߥλ�����Τ����
199
+ Bio::sequence::AA ���饹�Τɤ��餫�Υ��֥������Ȥˤʤ�ޤ���
200
+
201
+ ���󤬤ɤ���Υ��饹��°���뤫�� Ruby �� class �᥽�åɤ��Ѥ���
202
+
203
+ bioruby> p cdc2.class
204
+ Bio::Sequence::AA
205
+
206
+ bioruby> p psaB.class
207
+ Bio::Sequence::NA
208
+
209
+ �Τ褦��Ĵ�٤뤳�Ȥ��Ǥ��ޤ�����ưȽ�꤬�ְ�äƤ�����ʤɤˤ�
210
+ to_naseq, to_aaseq �᥽�åɤǶ���Ū���Ѵ��Ǥ��ޤ���
211
+
212
+ bioruby> pep = dna.to_aaseq
213
+ bioruby> p pep.class
214
+ Bio::Sequence::AA
215
+
216
+ ��������䥢�ߥλ�����Υ��饹�� Ruby ��ʸ���󥯥饹�Ǥ��� String ��
217
+ �Ѿ����Ƥ��ޤ��Τǡ�length ��Ĺ����Ĵ�٤��ꡢ+ ��­����碌���ꡢ* ��
218
+ �����֤�����ʤɡ�Ruby ��ʸ������Ф��ƹԤ��������������Ѳ�ǽ�Ǥ���
219
+ ���Τ褦����ħ�ϥ��֥������Ȼظ��ζ��Ϥ�¦�̤ΰ�Ĥȸ�����Ǥ��礦��
220
+
221
+ bioruby> puts dna.length
222
+ 12
223
+
224
+ bioruby> puts dna + dna
225
+ atgcatgcaaaaatgcatgcaaaa
226
+
227
+ bioruby> puts dna * 5
228
+ atgcatgcaaaaatgcatgcaaaaatgcatgcaaaaatgcatgcaaaaatgcatgcaaaa
229
+
230
+ :complement
231
+
232
+ ������������亿���������ˤϱ�������� complement �᥽�åɤ�ƤӤޤ���
233
+
234
+ bioruby> puts dna.complement
235
+ ttttgcatgcat
236
+
237
+ :translate
238
+
239
+ ��������򥢥ߥλ��������������ˤ� translate �᥽�åɤ�Ȥ��ޤ���
240
+ �������줿���ߥλ������ pep �Ȥ����ѿ����������Ƥߤޤ���
241
+
242
+ bioruby> pep = dna.translate
243
+ bioruby> puts pep
244
+ MHAK
245
+
246
+ �ե졼����Ѥ�����������ˤ�
247
+
248
+ bioruby> puts dna.translate(2)
249
+ CMQ
250
+ bioruby> puts dna.translate(3)
251
+ ACK
252
+
253
+ �ʤɤȤ��ޤ���
254
+
255
+ :molecular_weight
256
+
257
+ ʬ���̤� molecular_weight �᥽�åɤ�ɽ������ޤ���
258
+
259
+ bioruby> puts dna.molecular_weight
260
+ 3718.66444
261
+
262
+ bioruby> puts pep.molecular_weight
263
+ 485.605
264
+
265
+ --- seqstat(seq)
266
+
267
+ seqstat ���ޥ�ɤ�Ȥ��ȡ������ʤɤξ������٤�ɽ������ޤ���
268
+
269
+ bioruby> seqstat(dna)
270
+
271
+ * * * Sequence statistics * * *
272
+
273
+ 5'->3' sequence : atgcatgcaaaa
274
+ 3'->5' sequence : ttttgcatgcat
275
+ Translation 1 : MHAK
276
+ Translation 2 : CMQ
277
+ Translation 3 : ACK
278
+ Translation -1 : FCMH
279
+ Translation -2 : FAC
280
+ Translation -3 : LHA
281
+ Length : 12 bp
282
+ GC percent : 33 %
283
+ Composition : a - 6 ( 50.00 %)
284
+ c - 2 ( 16.67 %)
285
+ g - 2 ( 16.67 %)
286
+ t - 2 ( 16.67 %)
287
+ Codon usage :
288
+
289
+ *---------------------------------------------*
290
+ | | 2nd | |
291
+ | 1st |-------------------------------| 3rd |
292
+ | | U | C | A | G | |
293
+ |-------+-------+-------+-------+-------+-----|
294
+ | U U |F 0.0%|S 0.0%|Y 0.0%|C 0.0%| u |
295
+ | U U |F 0.0%|S 0.0%|Y 0.0%|C 0.0%| c |
296
+ | U U |L 0.0%|S 0.0%|* 0.0%|* 0.0%| a |
297
+ | UUU |L 0.0%|S 0.0%|* 0.0%|W 0.0%| g |
298
+ |-------+-------+-------+-------+-------+-----|
299
+ | CCCC |L 0.0%|P 0.0%|H 25.0%|R 0.0%| u |
300
+ | C |L 0.0%|P 0.0%|H 0.0%|R 0.0%| c |
301
+ | C |L 0.0%|P 0.0%|Q 0.0%|R 0.0%| a |
302
+ | CCCC |L 0.0%|P 0.0%|Q 0.0%|R 0.0%| g |
303
+ |-------+-------+-------+-------+-------+-----|
304
+ | A |I 0.0%|T 0.0%|N 0.0%|S 0.0%| u |
305
+ | A A |I 0.0%|T 0.0%|N 0.0%|S 0.0%| c |
306
+ | AAAAA |I 0.0%|T 0.0%|K 25.0%|R 0.0%| a |
307
+ | A A |M 25.0%|T 0.0%|K 0.0%|R 0.0%| g |
308
+ |-------+-------+-------+-------+-------+-----|
309
+ | GGGG |V 0.0%|A 0.0%|D 0.0%|G 0.0%| u |
310
+ | G |V 0.0%|A 0.0%|D 0.0%|G 0.0%| c |
311
+ | G GGG |V 0.0%|A 25.0%|E 0.0%|G 0.0%| a |
312
+ | GG G |V 0.0%|A 0.0%|E 0.0%|G 0.0%| g |
313
+ *---------------------------------------------*
314
+
315
+ Molecular weight : 3718.66444
316
+ Protein weight : 485.605
317
+ //
318
+
319
+
320
+ ���ߥλ�����ξ��ϰʲ��Τ褦�ˤʤ�ޤ���
321
+
322
+ bioruby> seqstat(pep)
323
+
324
+ * * * Sequence statistics * * *
325
+
326
+ N->C sequence : MHAK
327
+ Length : 4 aa
328
+ Composition : A Ala - 1 ( 25.00 %) alanine
329
+ H His - 1 ( 25.00 %) histidine
330
+ K Lys - 1 ( 25.00 %) lysine
331
+ M Met - 1 ( 25.00 %) methionine
332
+ Protein weight : 485.605
333
+ //
334
+
335
+ :composition
336
+
337
+ seqstat �����ɽ������Ƥ��������� composition �᥽�åɤ����뤳�Ȥ��Ǥ��ޤ���
338
+ ��̤�ʸ����ǤϤʤ� Hash ���֤����Τǡ��Ȥꤢ����ɽ�����Ƥߤ���ˤ�
339
+ puts ������� p ���ޥ�ɤ�Ȥ����ɤ��Ǥ��礦��
340
+
341
+ bioruby> p dna.composition
342
+ {"a"=>6, "c"=>2, "g"=>2, "t"=>2}
343
+
344
+ ==== �������󡢥��ߥλ�����Τ���¾�Υ᥽�å�
345
+
346
+ ¾�ˤ�������󡢥��ߥλ�������Ф��ƹԤ������Ͽ����Ȥ���ޤ���
347
+
348
+ :subseq(from, to)
349
+
350
+ ��ʬ�������Ф��ˤ� subseq �᥽�åɤ�Ȥ��ޤ���
351
+
352
+ bioruby> puts dna.subseq(1, 3)
353
+ atg
354
+
355
+ Ruby �ʤ�¿���Υץ�����ߥ󥰸����ʸ����� 1 ʸ���ܤ� 0 ��������ޤ�����
356
+ subseq �᥽�åɤ� 1 ����������ڤ�Ф���褦�ˤʤäƤ��ޤ���
357
+
358
+ bioruby> puts dna[0, 3]
359
+ atg
360
+
361
+ Ruby �� String ���饹������ slice �᥽�å� str[] ��Ŭ���Ȥ�ʬ�����
362
+ �褤�Ǥ��礦��
363
+
364
+ :window_search(len, step)
365
+
366
+ window_search �᥽�åɤ�Ȥ���Ĺ���������ʬ������η����֤���
367
+ ��ñ�˹Ԥ����Ȥ��Ǥ��ޤ���DNA ����򥳥ɥ���˽��������硢
368
+ ��ʸ�����Ĥ��餷�ʤ��飳ʸ�����ڤ�Ф��Ф褤�Τǰʲ��Τ褦�ˤʤ�ޤ���
369
+
370
+ bioruby> dna.window_search(3, 3) do |codon|
371
+ bioruby+ puts "#{codon}\t#{codon.translate}"
372
+ bioruby+ end
373
+ atg M
374
+ cat H
375
+ gca A
376
+ aaa K
377
+
378
+ ���Υ��������ü 1000bp �򥪡��С���åפ����ʤ��� 11000bp ���Ȥ�
379
+ �֥��ڤ�ˤ� FASTA �ե����ޥåȤ�����������ϰʲ��Τ褦�ˤʤ�ޤ���
380
+
381
+ bioruby> seq.window_search(11000, 10000) do |subseq|
382
+ bioruby+ puts subseq.to_fasta
383
+ bioruby+ end
384
+
385
+ �Ǹ�� 10000bp �������ʤ� 3' ü��;��������֤��ͤȤ���������Τǡ�
386
+ ɬ�פʾ������Ӽ�����ä�ɽ�����ޤ���
387
+
388
+ bioruby> i = 1
389
+ bioruby> remainder = seq.window_search(11000, 10000) do |subseq|
390
+ bioruby+ puts subseq.to_fasta("segment #{i*10000}", 60)
391
+ bioruby+ i += 1
392
+ bioruby+ end
393
+ bioruby> puts remainder.to_fasta("segment #{i*10000}", 60)
394
+
395
+ :splicing(position)
396
+
397
+ ��������� GenBank ���� position ʸ����ˤ���ڤ�Ф��� splicing
398
+ �᥽�åɤǹԤ��ޤ���
399
+
400
+ bioruby> puts dna
401
+ atgcatgcaaaa
402
+ bioruby> puts dna.splicing("join(1..3,7..9)")
403
+ atggca
404
+
405
+ :randomize
406
+
407
+ randomize �᥽�åɤϡ��������������¸�����ޤޥ�����������������ޤ���
408
+
409
+ bioruby> puts dna.randomize
410
+ agcaatagatac
411
+
412
+ :to_re
413
+
414
+ to_re �᥽�åɤϡ�ۣ��ʱ����ɽ����ޤ��������� atgc ������
415
+ �ѥ����󤫤�ʤ�����ɽ�����Ѵ����ޤ���
416
+
417
+ bioruby> ambiguous = seq("atgcyatgcatgcatgc")
418
+
419
+ bioruby> p ambiguous.to_re
420
+ /atgc[tc]atgcatgcatgc/
421
+
422
+ bioruby> puts ambiguous.to_re
423
+ (?-mix:atgc[tc]atgcatgcatgc)
424
+
425
+ seq �᥽�åɤ� ATGC �δ�ͭ�̤� 90% �ʲ����ȥ��ߥλ�����Ȥߤʤ��Τǡ�
426
+ ۣ��ʱ���¿���ޤޤ������ξ��� to_naseq �᥽�åɤ�Ȥä�
427
+ ����Ū�� Bio::Sequence::NA ���֥������Ȥ��Ѵ�����ɬ�פ�����ޤ���
428
+
429
+ bioruby> s = seq("atgcrywskmbvhdn").to_naseq
430
+ bioruby> p s.to_re
431
+ /atgc[ag][tc][at][gc][tg][ac][tgc][agc][atc][atg][atgc]/
432
+
433
+ bioruby> puts s.to_re
434
+ (?-mix:atgc[ag][tc][at][gc][tg][ac][tgc][agc][atc][atg][atgc])
435
+
436
+ :names
437
+
438
+ ���ޤ�Ȥ����ȤϤ���ޤ��󤬡���������̾�䥢�ߥλ�̾���Ѵ�����
439
+ �᥽�åɤǤ���
440
+
441
+ bioruby> p dna.names
442
+ ["adenine", "thymine", "guanine", "cytosine", "adenine", "thymine",
443
+ "guanine", "cytosine", "adenine", "adenine", "adenine", "adenine"]
444
+
445
+ bioruby> p pep.names
446
+ ["methionine", "histidine", "alanine", "lysine"]
447
+
448
+ :codes
449
+
450
+ ���ߥλ������ʸ�������ɤ��Ѵ����� names �Ȼ����᥽�åɤǤ���
451
+
452
+ bioruby> p pep.codes
453
+ ["Met", "His", "Ala", "Lys"]
454
+
455
+ :gc_percent
456
+
457
+ ��������� GC ���̤� gc_percent �᥽�åɤ������ޤ���
458
+
459
+ bioruby> p dna.gc_percent
460
+ 33
461
+
462
+ :to_fasta
463
+
464
+ FASTA �ե����ޥåȤ��Ѵ�����ˤ� to_fasta �᥽�åɤ�Ȥ��ޤ���
465
+
466
+ bioruby> puts dna.to_fasta("dna sequence")
467
+ >dna sequence
468
+ aaccggttacgt
469
+
470
+
471
+ === ����䥢�ߥλ��Υ����ɡ����ɥ�ɽ�򤢤Ĥ���
472
+
473
+ ���ߥλ������𡢥��ɥ�ơ��֥�����뤿��� aminoacids, nucleicacids,
474
+ codontables, codontable ���ޥ�ɤ�Ҳ𤷤ޤ���
475
+
476
+ --- aminoacids
477
+
478
+ ���ߥλ��ΰ����� aminoacids ���ޥ�ɤ�ɽ���Ǥ��ޤ���
479
+
480
+ bioruby> aminoacids
481
+ ? Pyl pyrrolysine
482
+ A Ala alanine
483
+ B Asx asparagine/aspartic acid
484
+ C Cys cysteine
485
+ D Asp aspartic acid
486
+ E Glu glutamic acid
487
+ F Phe phenylalanine
488
+ G Gly glycine
489
+ H His histidine
490
+ I Ile isoleucine
491
+ K Lys lysine
492
+ L Leu leucine
493
+ M Met methionine
494
+ N Asn asparagine
495
+ P Pro proline
496
+ Q Gln glutamine
497
+ R Arg arginine
498
+ S Ser serine
499
+ T Thr threonine
500
+ U Sec selenocysteine
501
+ V Val valine
502
+ W Trp tryptophan
503
+ Y Tyr tyrosine
504
+ Z Glx glutamine/glutamic acid
505
+
506
+ �֤��ͤ�û��ɽ�����б�����Ĺ��ɽ���Υϥå���ˤʤäƤ��ޤ���
507
+
508
+ bioruby> aa = aminoacids
509
+ bioruby> puts aa["G"]
510
+ Gly
511
+ bioruby> puts aa["Gly"]
512
+ glycine
513
+
514
+ --- nucleicacids
515
+
516
+ ����ΰ����� nucleicacids ���ޥ�ɤ�ɽ���Ǥ��ޤ���
517
+
518
+ bioruby> nucleicacids
519
+ a a Adenine
520
+ t t Thymine
521
+ g g Guanine
522
+ c c Cytosine
523
+ u u Uracil
524
+ r [ag] puRine
525
+ y [tc] pYrimidine
526
+ w [at] Weak
527
+ s [gc] Strong
528
+ k [tg] Keto
529
+ m [ac] aroMatic
530
+ b [tgc] not A
531
+ v [agc] not T
532
+ h [atc] not G
533
+ d [atg] not C
534
+ n [atgc]
535
+
536
+ �֤��ͤϱ���Σ�ʸ��ɽ���ȳ����������Υϥå���ˤʤäƤ��ޤ���
537
+
538
+ bioruby> na = nucleicacids
539
+ bioruby> puts na["r"]
540
+ [ag]
541
+
542
+ --- codontables
543
+
544
+ ���ɥ�ơ��֥�ΰ����� codontables ���ޥ�ɤ�ɽ���Ǥ��ޤ���
545
+
546
+ bioruby> codontables
547
+ 1 Standard (Eukaryote)
548
+ 2 Vertebrate Mitochondrial
549
+ 3 Yeast Mitochondorial
550
+ 4 Mold, Protozoan, Coelenterate Mitochondrial and Mycoplasma/Spiroplasma
551
+ 5 Invertebrate Mitochondrial
552
+ 6 Ciliate Macronuclear and Dasycladacean
553
+ 9 Echinoderm Mitochondrial
554
+ 10 Euplotid Nuclear
555
+ 11 Bacteria
556
+ 12 Alternative Yeast Nuclear
557
+ 13 Ascidian Mitochondrial
558
+ 14 Flatworm Mitochondrial
559
+ 15 Blepharisma Macronuclear
560
+ 16 Chlorophycean Mitochondrial
561
+ 21 Trematode Mitochondrial
562
+ 22 Scenedesmus obliquus mitochondrial
563
+ 23 Thraustochytrium Mitochondrial
564
+
565
+ �֤��ͤϥơ��֥��ֹ��̾���Υϥå���ˤʤäƤ��ޤ���
566
+
567
+ bioruby> ct = codontables
568
+ bioruby> puts ct[3]
569
+ Yeast Mitochondorial
570
+
571
+ --- codontable(num)
572
+
573
+ ���ɥ�ɽ���Τ� codontable ���ޥ�ɤ�ɽ���Ǥ��ޤ���
574
+
575
+ bioruby> codontable(11)
576
+
577
+ = Codon table 11 : Bacteria
578
+
579
+ hydrophilic: H K R (basic), S T Y Q N S (polar), D E (acidic)
580
+ hydrophobic: F L I M V P A C W G (nonpolar)
581
+
582
+ *---------------------------------------------*
583
+ | | 2nd | |
584
+ | 1st |-------------------------------| 3rd |
585
+ | | U | C | A | G | |
586
+ |-------+-------+-------+-------+-------+-----|
587
+ | U U | Phe F | Ser S | Tyr Y | Cys C | u |
588
+ | U U | Phe F | Ser S | Tyr Y | Cys C | c |
589
+ | U U | Leu L | Ser S | STOP | STOP | a |
590
+ | UUU | Leu L | Ser S | STOP | Trp W | g |
591
+ |-------+-------+-------+-------+-------+-----|
592
+ | CCCC | Leu L | Pro P | His H | Arg R | u |
593
+ | C | Leu L | Pro P | His H | Arg R | c |
594
+ | C | Leu L | Pro P | Gln Q | Arg R | a |
595
+ | CCCC | Leu L | Pro P | Gln Q | Arg R | g |
596
+ |-------+-------+-------+-------+-------+-----|
597
+ | A | Ile I | Thr T | Asn N | Ser S | u |
598
+ | A A | Ile I | Thr T | Asn N | Ser S | c |
599
+ | AAAAA | Ile I | Thr T | Lys K | Arg R | a |
600
+ | A A | Met M | Thr T | Lys K | Arg R | g |
601
+ |-------+-------+-------+-------+-------+-----|
602
+ | GGGG | Val V | Ala A | Asp D | Gly G | u |
603
+ | G | Val V | Ala A | Asp D | Gly G | c |
604
+ | G GGG | Val V | Ala A | Glu E | Gly G | a |
605
+ | GG G | Val V | Ala A | Glu E | Gly G | g |
606
+ *---------------------------------------------*
607
+
608
+
609
+ �֤��ͤ� Bio::CodonTable ���饹�Υ��֥������Ȥǡ����ɥ�ȥ��ߥλ���
610
+ �Ѵ����Ǥ�������Ǥʤ����ʲ��Τ褦�ʥǡ��������뤳�Ȥ��Ǥ��ޤ���
611
+
612
+ bioruby> ct = codontable(2)
613
+ bioruby> p ct["atg"]
614
+ "M"
615
+
616
+ :definition
617
+
618
+ ���ɥ�ɽ�����������
619
+
620
+ bioruby> puts ct.definition
621
+ Vertebrate Mitochondrial
622
+
623
+ :start
624
+
625
+ ���ϥ��ɥ����
626
+
627
+ bioruby> p ct.start
628
+ ["att", "atc", "ata", "atg", "gtg"]
629
+
630
+ :stop
631
+
632
+ ���ߥ��ɥ����
633
+
634
+ bioruby> p ct.stop
635
+ ["taa", "tag", "aga", "agg"]
636
+
637
+ :revtrans
638
+
639
+ ���ߥλ��򥳡��ɤ��륳�ɥ��Ĵ�٤�
640
+
641
+ bioruby> p ct.revtrans("V")
642
+ ["gtc", "gtg", "gtt", "gta"]
643
+
644
+ === �ե�åȥե�����Υ���ȥ�
645
+
646
+ �ǡ����١����Υ���ȥ�ȡ��ե�åȥե����뤽�Τ�Τ򰷤���ˡ��Ҳ𤷤ޤ���
647
+ GenBank �ǡ����١�������Ǥϡ��ե������Υ���ȥ꤬�ޤޤ�� gbphg.seq ��
648
+ �ե����륵�������������Τǡ����Υե��������Ȥ��ƻȤ��ޤ���
649
+
650
+ % wget ftp://ftp.hgc.jp/pub/mirror/ncbi/genbank/gbphg.seq.gz
651
+ % gunzip gbphg.seq.gz
652
+
653
+ --- ent(str)
654
+
655
+ seq ���ޥ�ɤ������������ޤ���������������Ǥʤ�����ȥ����Τ��������ˤ�
656
+ ent ���ޥ�ɤ�Ȥ��ޤ���seq ���ޥ��Ʊ�͡�ent ���ޥ�ɤǤ� OBDA, EMBOSS,
657
+ KEGG API �Υǡ����١��������Ѳ�ǽ�Ǥ�������ˤĤ��Ƥ� seq ���ޥ�ɤ�������
658
+ ���Ȥ��Ƥ���������
659
+
660
+ bioruby> entry = ent("genbank:AB044425")
661
+ bioruby> puts entry
662
+ LOCUS AB044425 1494 bp DNA linear PLN 28-APR-2001
663
+ DEFINITION Volvox carteri f. kawasakiensis chloroplast psaB gene for
664
+ photosystem I P700 chlorophyll a apoprotein A2,
665
+ strain:NIES-732.
666
+ (ά)
667
+
668
+ ent ���ޥ�ɤΰ����ˤ� db:entry_id ������ʸ����EMBOSS �� USA��
669
+ �ե����롢IO ��Ϳ����졢�ǡ����١����Σ�����ȥ�ʬ��ʸ�����֤���ޤ���
670
+ ����ǡ����١����˸¤餺����¿���Υǡ����١�������ȥ���б����Ƥ��ޤ���
671
+
672
+ --- flatparse(str)
673
+
674
+ ������������ȥ��ѡ��������ߤ����ǡ�����Ȥ�����ˤ� flatparse
675
+ ���ޥ�ɤ�Ȥ��ޤ���
676
+
677
+ bioruby> entry = ent("gbphg.seq")
678
+ bioruby> gb = flatparse(entry)
679
+ bioruby> puts gb.entry_id
680
+ AB000833
681
+ bioruby> puts gb.definition
682
+ Bacteriophage Mu DNA for ORF1, sheath protein gpL, ORF2, ORF3, complete cds.
683
+ bioruby> puts psaB.naseq
684
+ acggtcagacgtttggcccgaccaccgggatgaggctgacgcaggtcagaaatctttgtgacgacaaccgtatcaat
685
+ (ά)
686
+
687
+ --- obj(str)
688
+
689
+ obj ���ޥ�ɤϡ�ent �ǥ���ȥ��ʸ����Ȥ��Ƽ����� flatparse �ǥѡ�������
690
+ ���֥������Ȥ��Ѵ�����Τ�Ʊ���Ǥ���ent ���ޥ�ɤ�Ʊ������������դ��ޤ���
691
+ ��������������� seq������ȥ������������ ent���ѡ����������֥������Ȥ�
692
+ ����������� obj ��Ȥ����Ȥˤʤ�ޤ���
693
+
694
+ bioruby> gb = obj("gbphg.seq")
695
+ bioruby> puts gb.entry_id
696
+ AB000833
697
+
698
+ --- flatfile(file)
699
+
700
+ ent ���ޥ�ɤϣ�����ȥꤷ�������ʤ����ᡢ��������Υե�����򳫤���
701
+ �ƥ���ȥ���˽�����Ԥ��ˤ� flatfile ���ޥ�ɤ�Ȥ��ޤ���
702
+
703
+ bioruby> flatfile("gbphg.seq") do |entry|
704
+ bioruby+ # do something on entry
705
+ bioruby+ end
706
+
707
+ �֥��å�����ꤷ�ʤ����ϡ��ե�������κǽ�Υ���ȥ��������ޤ���
708
+
709
+ bioruby> entry = flatfile("gbphg.seq")
710
+ bioruby> gb = flatparse(entry)
711
+ bioruby> puts gb.entry_id
712
+
713
+ --- flatauto(file)
714
+
715
+ �ƥ���ȥ�� flatparse ��Ʊ�ͤ˥ѡ����������֤ǽ��֤˽������뤿��ˤϡ�
716
+ flatfile ���ޥ�ɤ������ flatauto ���ޥ�ɤ�Ȥ��ޤ���
717
+
718
+ bioruby> flatauto("gbphg.seq") do |entry|
719
+ bioruby+ print entry.entry_id
720
+ bioruby+ puts entry.definition
721
+ bioruby+ end
722
+
723
+ flatfile Ʊ�͡��֥��å�����ꤷ�ʤ����ϡ��ե�������κǽ�Υ���ȥ��
724
+ ���������ѡ����������֥������Ȥ��֤��ޤ���
725
+
726
+ bioruby> gb = flatfile("gbphg.seq")
727
+ bioruby> puts gb.entry_id
728
+
729
+ === �ե�åȥե�����Υ���ǥ�����
730
+
731
+ EMBOSS �� dbiflat �˻�����ǽ�Ȥ��ơ�BioRuby, BioPerl �ʤɤ˶��̤� BioFlat
732
+ �Ȥ�������ǥå��������������Ȥߤ�����ޤ������٥���ǥå�����
733
+ �������Ƥ����ȥ���ȥ�μ��Ф�����®�����ưפ˹Ԥ��ޤ���
734
+ ����ˤ�꼫ʬ���ѤΥǡ����١������ڤ˺�뤳�Ȥ��Ǥ��ޤ���
735
+
736
+ --- flatindex(db_name, *source_file_list)
737
+
738
+ GenBank �Υե�����������ե����� gbphg.seq �����äƤ��륨��ȥ���Ф���
739
+ mydb �Ȥ����ǡ����١���̾�ǥ���ǥå�����������ޤ���
740
+
741
+ bioruby> flatindex("mydb", "gbphg.seq")
742
+ Creating BioFlat index (.bioruby/bioflat/mydb) ... done
743
+
744
+ --- flatsearch(db_name, entry_id)
745
+
746
+ �������� mydb �ǡ����١������饨��ȥ��Ȥ�Ф��ˤ� flatsearch ���ޥ�ɤ�
747
+ �Ȥ��ޤ���
748
+
749
+ bioruby> entry = flatsearch("mydb", "AB004561")
750
+ bioruby> puts entry
751
+ LOCUS AB004561 2878 bp DNA linear PHG 20-MAY-1998
752
+ DEFINITION Bacteriophage phiU gene for integrase, complete cds, integration
753
+ site.
754
+ ACCESSION AB004561
755
+ (ά)
756
+
757
+ === �͡��� DB ������� FASTA �ե����ޥåȤ��Ѵ�������¸
758
+
759
+ FASTA �ե����ޥåȤ�����ǡ�����ɸ��Ū���Ѥ����Ƥ���ե����ޥåȤǤ���
760
+ ��>�׵���ǤϤ��ޤ룱���ܤ���������������ꡢ�����ܰʹߤ����󤬤ĤŤ��ޤ���
761
+ ������ζ���ʸ����̵�뤵��ޤ���
762
+
763
+ >entry_id definition ...
764
+ ACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGT
765
+ ACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGTACGT
766
+
767
+ ����������Ԥϡ��ǽ��ñ�줬����� ID �ˤʤäƤ��뤳�Ȥ�¿���ΤǤ�����
768
+ NCBI �� BLAST �ѥǡ����١����ǤϤ���˹��٤ʹ�¤���������ʤ��Ƥ��ޤ���
769
+
770
+ * ((<URL:ftp://ftp.ncbi.nih.gov/blast/documents/README.formatdb>))
771
+ * ((<URL:http://blast.wustl.edu/doc/FAQ-Indexing.html#Identifiers>))
772
+ * FASTA format (Wikipedia)
773
+ ((<URL:http://en.wikipedia.org/wiki/Fasta_format>))
774
+
775
+ BioRuby �Υǡ����١�������ȥ�Υ��饹�ˤϥ���ȥ�ID����������ˤĤ���
776
+ ���̤Υ᥽�åɤ��Ѱդ���Ƥ��ޤ���
777
+
778
+ * entry_id - ����ȥ� ID �����
779
+ * definition - ���ʸ�����
780
+ * seq - ��������
781
+
782
+ �����ζ��̥᥽�åɤ�Ȥ��ȡ��ɤ������ǡ����١�������ȥ�Ǥ�
783
+ FASTA �ե����ޥåȤ��Ѵ��Ǥ���ץ�����ब��ñ�˺��ޤ���
784
+
785
+ entry.seq.to_fasta("#{entry.entry_id} #{entry.definition}", 60)
786
+
787
+ ����ˡ�BioRuby �Ǥ����ϥǡ����١����η�����ưȽ�̤Ǥ��ޤ��Τǡ�
788
+ GenBank, UniProt �ʤ�¿���μ��פ�����ǡ����١����Ǥ�
789
+ �ե�����̾����ꤹ������� FASTA �ե����ޥåȤ��Ѵ��Ǥ��ޤ���
790
+
791
+ --- flatfasta(fasta_file, *source_file_list)
792
+
793
+ ���ϥǡ����١����Υե�����̾�Υꥹ�Ȥ��顢���ꤷ�� FASTA �ե����ޥåȤ�
794
+ �ե�������������륳�ޥ�ɤǤ��������ǤϤ����Ĥ��� GenBank �Υե������
795
+ FASTA �ե����ޥåȤ��Ѵ�����myfasta.fa �Ȥ����ե��������¸���Ƥ��ޤ���
796
+
797
+ bioruby> flatfasta("myfasta.fa", "gbphg.seq", "gbvrl1.seq", "gbvrl2.seq")
798
+ Saving fasta file (myfasta.fa) ...
799
+ converting -- gbphg.gbk
800
+ converting -- gbvrl1.gbk
801
+ converting -- gbvrl2.gbk
802
+ done
803
+
804
+ === KEGG API
805
+
806
+ BioRuby ������Ǥ� KEGG API �Υ����֥����ӥ����ñ�����ѤǤ��ޤ���
807
+
808
+ --- keggdbs
809
+
810
+ ���Υ�ͥåȤ� KEGG API ���̤������Ѳ�ǽ�ʥǡ����١����Υꥹ�Ȥ�ɽ�����ޤ���
811
+
812
+ bioruby> keggdbs
813
+ nt: Non-redundant nucleic acid sequence database
814
+ aa: Non-redundant protein sequence database
815
+ gb: GenBank nucleic acid sequence database
816
+ (ά)
817
+
818
+ --- keggorgs
819
+
820
+ KEGG �˼�Ͽ����Ƥ�������ʪ��Υꥹ�Ȥ�ɽ�����ޤ���
821
+
822
+ bioruby> keggorgs
823
+ aae: Aquifex aeolicus
824
+ aci: Acinetobacter sp. ADP1
825
+ afu: Archaeoglobus fulgidus
826
+ (ά)
827
+
828
+ --- keggpathways
829
+
830
+ KEGG �˼�Ͽ����Ƥ������ѥ��������Υꥹ�Ȥ�ɽ�����ޤ���
831
+
832
+ bioruby> keggpathways
833
+ path:map00010: Glycolysis / Gluconeogenesis - Reference pathway
834
+ path:map00020: Citrate cycle (TCA cycle) - Reference pathway
835
+ path:map00030: Pentose phosphate pathway - Reference pathway
836
+ (ά)
837
+
838
+ �����ˣ�ʸ���� KEGG ��ʪ�ﵭ��򤢤�����ȡ�������ʪ�����ѤǤ���
839
+ �ѥ������������ΰ������֤��ޤ�����IJ�� eco �ξ��ʲ��Τ褦�ˤʤ�ޤ���
840
+
841
+ bioruby> keggpathways("eco")
842
+ path:eco00010: Glycolysis / Gluconeogenesis - Escherichia coli K-12 MG1655
843
+ path:eco00020: Citrate cycle (TCA cycle) - Escherichia coli K-12 MG1655
844
+ path:eco00030: Pentose phosphate pathway - Escherichia coli K-12 MG1655
845
+ (ά)
846
+
847
+ --- keggapi
848
+
849
+ �����ʳ��� KEGG API �Υ᥽�åɤϡ�keggapi ��³���ƸƤӽФ����Ȥ�
850
+ ���ѤǤ��ޤ���
851
+
852
+ bioruby> p keggapi.get_genes_by_pathway("path:eco00010")
853
+ ["eco:b0114", "eco:b0115", "eco:b0116", "eco:b0356", "eco:b0688", (ά)
854
+
855
+ ���Ѳ�ǽ�ʥ᥽�åɤΰ����� KEGG API �Υޥ˥奢��򻲾Ȥ��Ƥ���������
856
+
857
+ * ((<URL:http://www.genome.jp/kegg/soap/doc/keggapi_manual_ja.html>))
858
+
859
+ === DBGET
860
+
861
+ ���Υ�ͥåȤ� DBGET �Υ��ޥ�ɤǤ��� binfo, bfind, bget, btit, bconv ��
862
+ KEGG API �����Ѥ��Ƥ��Τޤ޼¹ԤǤ���褦�ˤʤäƤ��ޤ���
863
+
864
+ --- binfo
865
+
866
+ bioruby> binfo
867
+ *** Last database updates ***
868
+ Date Database Release #Entries #Residues
869
+ -------- ------------- ------------------------ ------------ ----------------
870
+ 05/12/06 nr-nt 05-12-04 (Dec 05) 63,078,043 111,609,773,616
871
+ 05/12/06 nr-aa 05-12-05 (Dec 05) 2,682,790 890,953,839
872
+ 05/10/25 genbank 150.0 (Oct 05) 49,152,445 53,655,236,500
873
+ 05/12/06 genbank-upd 150.0+/12-04 (Dec 05) 7,470,976 6,357,888,366
874
+ (ά)
875
+
876
+ binfo ���ޥ�ɤ�³���ƥǡ����١���̾����ꤹ�뤳�ȤǤ��ܺ٤ʾ���
877
+ ɽ������ޤ���
878
+
879
+ bioruby> binfo "genbank"
880
+ genbank GenBank nucleic acid sequence database
881
+ gb Release 150.0, Oct 05
882
+ National Center for Biotechnology Information
883
+ 49,152,445 entries, 53,655,236,500 bases
884
+ Last update: 05/10/25
885
+ <dbget> <fasta> <blast>
886
+
887
+ --- bfind(keyword)
888
+
889
+ bfind ���ޥ�ɤǥǡ����١������Ф��륭����ɥ�������Ԥ����Ȥ��Ǥ��ޤ���
890
+ �ǡ����١���̾�ȸ���������������ɤ�ʸ������Ϥ��ޤ���
891
+
892
+ bioruby> list = bfind "genbank ebola human"
893
+ bioruby> puts list
894
+ gb:BD177378 [BD177378] A monoclonal antibody recognizing ebola virus.
895
+ gb:BD177379 [BD177379] A monoclonal antibody recognizing ebola virus.
896
+ (ά)
897
+
898
+ --- bget(entry_id)
899
+
900
+ bget ���ޥ�ɤǻ��ꤷ�� db:entry_id �Υǡ����١�������ȥ������Ǥ��ޤ���
901
+
902
+ bioruby> entry = bget "gb:BD177378"
903
+ bioruby> puts entry
904
+ LOCUS BD177378 24 bp DNA linear PAT 16-APR-2003
905
+ DEFINITION A monoclonal antibody recognizing ebola virus.
906
+ (ά)
907
+
908
+ === ������ץ�����
909
+
910
+ ��ȼ��򥹥���ץȲ�������¸���Ƥ������Ȥ�Ǥ��ޤ���
911
+
912
+ bioruby> script
913
+ -- 8< -- 8< -- 8< -- Script -- 8< -- 8< -- 8< --
914
+ bioruby> seq = seq("gbphg.seq")
915
+ bioruby> p seq
916
+ bioruby> p seq.translate
917
+ bioruby> script
918
+ -- >8 -- >8 -- >8 -- Script -- >8 -- >8 -- >8 --
919
+ Saving script (script.rb) ... done
920
+
921
+ �������줿 script.rb �ϰʲ��Τ褦�ˤʤ�ޤ���
922
+
923
+ #!/usr/bin/env bioruby
924
+
925
+ seq = seq("gbphg.seq")
926
+ p seq
927
+ p seq.translate
928
+
929
+ ���Υ�����ץȤ� bioruby ���ޥ�ɤǼ¹Ԥ��뤳�Ȥ��Ǥ��ޤ���
930
+
931
+ % bioruby script.rb
932
+
933
+ === �ʰץ����뵡ǽ
934
+
935
+ --- cd(dir)
936
+
937
+ �����ȥǥ��쥯�ȥ���ѹ����ޤ���
938
+
939
+ bioruby> cd "/tmp"
940
+ "/tmp"
941
+
942
+ �ۡ���ǥ��쥯�ȥ�����ˤϰ�����Ĥ����� cd ��¹Ԥ��ޤ���
943
+
944
+ bioruby> cd
945
+ "/home/k"
946
+
947
+ --- pwd
948
+
949
+ �����ȥǥ��쥯�ȥ��ɽ�����ޤ���
950
+
951
+ bioruby> pwd
952
+ "/home/k"
953
+
954
+ --- dir
955
+
956
+ �����ȥǥ��쥯�ȥ�Υե���������ɽ�����ޤ���
957
+
958
+ bioruby> dir
959
+ UGO Date Byte File
960
+ ------ ---------------------------- ----------- ------------
961
+ 40700 Tue Dec 06 07:07:35 JST 2005 1768 "Desktop"
962
+ 40755 Tue Nov 29 16:55:20 JST 2005 2176 "bin"
963
+ 100644 Sat Oct 15 03:01:00 JST 2005 42599518 "gbphg.seq"
964
+ (ά)
965
+
966
+ bioruby> dir "gbphg.seq"
967
+ UGO Date Byte File
968
+ ------ ---------------------------- ----------- ------------
969
+ 100644 Sat Oct 15 03:01:00 JST 2005 42599518 "gbphg.seq"
970
+
971
+ --- head(file, lines = 10)
972
+
973
+ �ƥ����ȥե�����䥪�֥������Ȥ���Ƭ 10 �Ԥ�ɽ�����ޤ���
974
+
975
+ bioruby> head "gbphg.seq"
976
+ GBPHG.SEQ Genetic Sequence Data Bank
977
+ October 15 2005
978
+
979
+ NCBI-GenBank Flat File Release 150.0
980
+
981
+ Phage Sequences
982
+
983
+ 2713 loci, 16892737 bases, from 2713 reported sequences
984
+
985
+ ɽ������Կ�����ꤹ�뤳�Ȥ�Ǥ��ޤ���
986
+
987
+ bioruby> head "gbphg.seq", 2
988
+ GBPHG.SEQ Genetic Sequence Data Bank
989
+ October 15 2005
990
+
991
+ �ƥ����Ȥ����äƤ����ѿ�����Ƭ�򸫤뤳�Ȥ�Ǥ��ޤ���
992
+
993
+ bioruby> entry = ent("gbphg.seq")
994
+ bioruby> head entry, 2
995
+ GBPHG.SEQ Genetic Sequence Data Bank
996
+ October 15 2005
997
+
998
+ --- disp(obj)
999
+
1000
+ �ƥ����ȥե�����䥪�֥������Ȥ���Ȥ�ڡ����㡼��ɽ�����ޤ���
1001
+ �����ǻ��Ѥ���ڡ����㡼�� pager ���ޥ�ɤ��ѹ����뤳�Ȥ��Ǥ��ޤ��ʸ�ҡˡ�
1002
+
1003
+ bioruby> disp "gbphg.seq"
1004
+ bioruby> disp entry
1005
+ bioruby> disp [1, 2, 3] * 4
1006
+
1007
+ === �ѿ�
1008
+
1009
+ --- ls
1010
+
1011
+ ���å������˺��������ѿ��ʥ��֥������ȡˤΰ�����ɽ�����ޤ���
1012
+
1013
+ bioruby> ls
1014
+ ["entry", "seq"]
1015
+
1016
+ bioruby> a = 123
1017
+ ["a", "entry", "seq"]
1018
+
1019
+ --- rm(symbol)
1020
+
1021
+ �ѿ���õ�ޤ���
1022
+
1023
+ bioruby> rm "a"
1024
+
1025
+ bioruby> ls
1026
+ ["entry", "seq"]
1027
+
1028
+ --- savefile(filename, object)
1029
+
1030
+ �ѿ�����¸����Ƥ������Ƥ�ƥ����ȥե��������¸���ޤ���
1031
+
1032
+ bioruby> savefile "testfile.txt", entry
1033
+ Saving data (testfile.txt) ... done
1034
+
1035
+ bioruby> disp "testfile.txt"
1036
+
1037
+ === �Ƽ�����
1038
+
1039
+ ��³���λ��ȤߤȤ��� BioRuby �����뽪λ���� session �ǥ��쥯�ȥ����
1040
+ �ҥ��ȥꡢ���֥������ȡ��Ŀͤ����꤬��¸���졢����ư���˼�ưŪ��
1041
+ �ɤ߹��ޤ�ޤ���
1042
+
1043
+ --- config
1044
+
1045
+ BioRuby ������γƼ������ɽ�����ޤ���
1046
+
1047
+ bioruby> config
1048
+ message = "...BioRuby in the shell..."
1049
+ marshal = [4, 8]
1050
+ color = false
1051
+ pager = nil
1052
+ echo = false
1053
+
1054
+ echo ɽ�����뤫�ɤ������ڤ��ؤ��ޤ���on �ξ��ϡ�puts �� p �ʤɤ�
1055
+ �Ĥ��ʤ��Ƥ�ɾ�������ͤ����̤�ɽ������ޤ���
1056
+ irb ���ޥ�ɤξ��Ͻ�����꤬ on �ˤʤäƤ��ޤ�����bioruby ���ޥ�ɤǤ�
1057
+ Ĺ������䥨��ȥ�ʤ�Ĺ���ʸ����򰷤����Ȥ�¿�����ᡢ�������Ǥ�
1058
+ off �ˤ��Ƥ��ޤ���
1059
+
1060
+ bioruby> config :echo
1061
+ Echo on
1062
+ ==> nil
1063
+
1064
+ bioruby> config :echo
1065
+ Echo off
1066
+
1067
+ ���ɥ�ɽ�ʤɡ���ǽ�ʾ��˥��顼ɽ�����뤫�ɤ������ڤ��ؤ��ޤ���
1068
+ ���顼ɽ���ξ�硢�ץ���ץȤˤ⿧���Ĥ��ޤ��Τ�Ƚ�̤Ǥ��ޤ���
1069
+
1070
+ bioruby> config :color
1071
+ bioruby> codontable
1072
+ (���դ�)
1073
+
1074
+ �¹Ԥ��뤿�Ӥ����꤬�ڤ��ؤ��ޤ���
1075
+
1076
+ bioruby> config :color
1077
+ bioruby> codontable
1078
+ (���ʤ�)
1079
+
1080
+ BioRuby �����뵯ư����ɽ������륹�ץ�å����å�������㤦ʸ�����
1081
+ �ѹ����ޤ������β��ϥץ����������ѤΥǥ��쥯�ȥ꤫����ꤷ�Ƥ����Τ�
1082
+ �褤�Ǥ��礦��
1083
+
1084
+ bioruby> config :message, "Kumamushi genome project"
1085
+
1086
+ K u m a m u s h i g e n o m e p r o j e c t
1087
+
1088
+ Version : BioRuby 0.8.0 / Ruby 1.8.4
1089
+
1090
+ �ǥե���Ȥ�ʸ������᤹�ˤϡ������ʤ��Ǽ¹Ԥ��ޤ���
1091
+
1092
+ bioruby> config :message
1093
+
1094
+ BioRuby �����뵯ư����ɽ������륹�ץ�å����å��ݥ���
1095
+ ���˥᡼�����ɽ�����뤫�ɤ������ڤ��ؤ��ޤ���
1096
+ �������¹Ԥ��뤿�Ӥ����꤬�ڤ��ؤ��ޤ���
1097
+
1098
+ bioruby> config :splash
1099
+ Splash on
1100
+
1101
+ --- pager(command)
1102
+
1103
+ disp ���ޥ�ɤǼºݤ����Ѥ���ڡ����㡼���ڤ��ؤ��ޤ���
1104
+
1105
+ bioruby> pager "lv"
1106
+ Pager is set to 'lv'
1107
+
1108
+ bioruby> pager "less -S"
1109
+ Pager is set to 'less -S'
1110
+
1111
+ �ڡ����㡼����Ѥ��ʤ�����ˤ�����ϰ����ʤ��Ǽ¹Ԥ��ޤ���
1112
+
1113
+ bioruby> pager
1114
+ Pager is set to 'off'
1115
+
1116
+ �ڡ����㡼�� off �λ��˰����ʤ��Ǽ¹Ԥ���ȴĶ��ѿ� PAGER ���ͤ����Ѥ��ޤ���
1117
+
1118
+ bioruby> pager
1119
+ Pager is set to 'less'
1120
+
1121
+ === �����ҥ�������������
1122
+
1123
+ --- doublehelix(sequence)
1124
+
1125
+ DNA ����򥢥����������Ȥ�ɽ�����륪�ޥ���ǽ������ޤ���
1126
+ Ŭ���ʱ������� seq ����������äݤ�ɽ�����Ƥߤޤ��礦��
1127
+
1128
+ bioruby> dna = seq("atgc" * 10).randomize
1129
+ bioruby> doublehelix dna
1130
+ ta
1131
+ t--a
1132
+ a---t
1133
+ a----t
1134
+ a----t
1135
+ t---a
1136
+ g--c
1137
+ cg
1138
+ gc
1139
+ a--t
1140
+ g---c
1141
+ c----g
1142
+ c----g
1143
+ (ά)
1144
+
1145
+ === �����Ҳ���
1146
+
1147
+ --- midifile(midifile, sequence)
1148
+
1149
+ DNA ����� MIDI �ե�������Ѵ����륪�ޥ���ǽ������ޤ���
1150
+ Ŭ���ʱ������� seq ��Ȥä��������� midifile.mid ��
1151
+ MIDI �ץ쥤�䡼�DZ��դ��Ƥߤޤ��礦��
1152
+
1153
+ bioruby> midifile("midifile.mid", seq)
1154
+ Saving MIDI file (midifile.mid) ... done
1155
+
1156
+ �ʾ�� BioRuby ������β���򽪤�ꡢ�ʲ��Ǥ� BioRuby �饤�֥�꼫�Τ�
1157
+ �����Ԥ��ޤ���
1158
+
1159
+
1160
+ == ���𡦥��ߥλ������������� (Bio::Sequence ���饹)
1161
+
1162
+ Bio::Sequence ���饹�ϡ�������Ф����͡�������Ԥ����Ȥ��Ǥ��ޤ���
1163
+ ��ñ����Ȥ��ơ�û���������� atgcatgcaaaa ��Ȥäơ���������ؤ��Ѵ���
1164
+ ��ʬ������ڤ�Ф������������η׻������ߥλ��ؤ�������ʬ���̷׻��ʤɤ�
1165
+ �ԤʤäƤߤޤ������ߥλ��ؤ������Ǥϡ�ɬ�פ˱����Ʋ������ܤ���������
1166
+ �Ϥ��뤫�ե졼�����ꤷ���ꡢcodontable.rb ���������Ƥ��륳�ɥ�ơ�
1167
+ �֥���椫����Ѥ����Τ���ꤷ���ꤹ������Ǥ��ޤ��ʥ��ɥ�ơ��֥��
1168
+ �ֹ�� ((<URL:http://www.ncbi.nlm.nih.gov/Taxonomy/Utils/wprintgc.cgi>))
1169
+ �򻲾ȡˡ�
1170
+
1171
+ #!/usr/bin/env ruby
1172
+
1173
+ require 'bio'
1174
+
1175
+ seq = Bio::Sequence::NA.new("atgcatgcaaaa")
1176
+
1177
+ puts seq # ��������
1178
+ puts seq.complement # �������� (Bio::Sequence::NA)
1179
+ puts seq.subseq(3,8) # 3 �����ܤ��� 8 �����ܤޤ�
1180
+
1181
+ p seq.gc_percent # GC ����� (Integer)
1182
+ p seq.composition # ���������� (Hash)
1183
+
1184
+ puts seq.translate # �������� (Bio::Sequence::AA)
1185
+ puts seq.translate(2) # ��ʸ���ܤ������������̤ϣ������
1186
+ puts seq.translate(1,9) # ���֤Υ��ɥ�ơ��֥�����
1187
+
1188
+ p seq.translate.codes # ���ߥλ���ʸ�������ɤ�ɽ�� (Array)
1189
+ p seq.translate.names # ���ߥλ���̾����ɽ�� (Array)
1190
+ p seq.translate.composition # ���ߥλ����� (Hash)
1191
+ p seq.translate.molecular_weight # ʬ���̤�׻� (Float)
1192
+
1193
+ puts seq.complement.translate # �������������
1194
+
1195
+ print, puts, p �����Ƥ���̤�ɽ�����뤿��� Ruby ɸ��᥽�åɤǤ���
1196
+ ���ܤȤʤ� print ����٤ơ�puts �ϲ��Ԥ�ư�ǤĤ��Ƥ���롢
1197
+ p ��ʸ���������ʳ��Υ��֥������Ȥ�ʹ֤����䤹���褦��ɽ�����Ƥ���롢
1198
+ �Ȥ�����ħ������ޤ��Τ�Ŭ���Ȥ�ʬ���ޤ�������ˡ�
1199
+
1200
+ require 'pp'
1201
+
1202
+ �Ȥ���лȤ���褦�ˤʤ� pp �᥽�åɤϡ�p ����ɽ�������䤹���ʤ�ޤ���
1203
+
1204
+ ��������� Bio::Sequence::NA ���饹�Ρ����ߥλ������ Bio::Sequence::AA
1205
+ ���饹�Υ��֥������Ȥˤʤ�ޤ������줾�� Bio::Sequence ���饹��Ѿ���
1206
+ �Ƥ��뤿�ᡢ¿���Υ᥽�åɤ϶��̤Ǥ���
1207
+
1208
+ ����� Bio::Sequence::NA, AA ���饹�� Ruby �� String ���饹��Ѿ����Ƥ���Τ�
1209
+ String ���饹�����ĥ᥽�åɤ�Ȥ������Ǥ��ޤ����㤨����ʬ������ڤ�Ф��ˤ�
1210
+ Bio::Sequence ���饹�� subseq(from,to) �᥽�åɤ�¾�ˡ�String ���饹��
1211
+ [] �᥽�åɤ�Ȥ����Ȥ�Ǥ��ޤ���
1212
+
1213
+ Ruby ��ʸ����� 1 ʸ���ܤ� 0 ���ܤȤ��ƿ��������ˤ����դ�ɬ�פǤ������Ȥ��С�
1214
+
1215
+ puts seq.subseq(1, 3)
1216
+ puts seq[0, 3]
1217
+
1218
+ �Ϥɤ���� seq �κǽ�Σ�ʸ�� atg ��ɽ�����ޤ���
1219
+
1220
+ ���Τ褦�ˡ�String �Υ᥽�åɤ�Ȥ����ϡ���ʪ�ؤ����̻��Ѥ���� 1 ʸ���ܤ�
1221
+ 1 ���ܤȤ��ƿ�������������� 1 �����ɬ�פ�����ޤ���subseq �᥽�åɤ�
1222
+ ����������Ǥ�äƤ��ޤ����ޤ���from, to �Τɤ��餫�Ǥ� 0 �ʲ��ξ���
1223
+ �㳰��ȯ������褦�ˤʤäƤ��ޤ��ˡ�
1224
+
1225
+ �����ޤǤν����� BioRuby ������ǻ�Ȱʲ��Τ褦�ˤʤ�ޤ���
1226
+
1227
+ # ���ιԤ� seq = seq("atgcatgcaaaa") �Ǥ�褤
1228
+ bioruby> seq = Bio::Sequence::NA.new("atgcatgcaaaa")
1229
+ # �������������ɽ��
1230
+ bioruby> puts seq
1231
+ atgcatgcaaaa
1232
+ # ���������ɽ��
1233
+ bioruby> puts seq.complement
1234
+ ttttgcatgcat
1235
+ # ��ʬ�����ɽ���ʣ������ܤ��飸�����ܤޤǡ�
1236
+ bioruby> puts seq.subseq(3,8)
1237
+ gcatgc
1238
+ # ����� GC% ��ɽ��
1239
+ bioruby> p seq.gc_percent
1240
+ 33
1241
+ # �����������ɽ��
1242
+ bioruby> p seq.composition
1243
+ {"a"=>6, "c"=>2, "g"=>2, "t"=>2}
1244
+ # ���ߥλ�����ؤ�����
1245
+ bioruby> puts seq.translate
1246
+ MHAK
1247
+ # ������򳫻ϱ���Ȥ�������
1248
+ bioruby> puts seq.translate(2)
1249
+ CMQ
1250
+ # ���֤Υ��ɥ�ơ��֥����Ѥ�������
1251
+ bioruby> puts seq.translate(1,9)
1252
+ MHAN
1253
+ # �������줿���ߥλ������ʸ�������ɤ�ɽ��
1254
+ bioruby> p seq.translate.codes
1255
+ ["Met", "His", "Ala", "Lys"]
1256
+ # �������줿���ߥλ�����򥢥ߥλ���̾����ɽ��
1257
+ bioruby> p seq.translate.names
1258
+ ["methionine", "histidine", "alanine", "lysine"]
1259
+ # �������줿���ߥλ������������ɽ��
1260
+ bioruby> p seq.translate.composition
1261
+ {"K"=>1, "A"=>1, "M"=>1, "H"=>1}
1262
+ # �������줿���ߥλ������ʬ���̤�ɽ��
1263
+ bioruby> p seq.translate.molecular_weight
1264
+ 485.605
1265
+ # �������������
1266
+ bioruby> puts seq.complement.translate
1267
+ FCMH
1268
+ # ��ʬ����ʣ������ܤ��飳�����ܤޤǡ�
1269
+ bioruby> puts seq.subseq(1, 3)
1270
+ atg
1271
+ # ��ʬ����ʣ������ܤ��飳�����ܤޤǡ�
1272
+ bioruby> puts seq[0, 3]
1273
+ atg
1274
+
1275
+ window_search(window_size, step_size) �᥽�åɤ�Ȥ��ȡ�������Ф��ƥ���
1276
+ ��ɥ��򤺤餷�ʤ��餽�줾�����ʬ������Ф��������Ԥ����Ȥ��Ǥ��ޤ���
1277
+ Ruby ����Ĺ�ΤҤȤĤǤ���֥֥��å��פˤ�äơ��֤��줾����Ф�������פ�
1278
+ �ʷ餫�����Ƥ˽񤯤��Ȥ���ǽ�Ǥ����ʲ�����Ǥϡ�subseq �Ȥ����ѿ��ˤ��줾��
1279
+ ��ʬ������������ʤ���֥��å��򷫤��֤��¹Ԥ��뤳�Ȥˤʤ�ޤ���
1280
+
1281
+ * 100 ���𤴤Ȥˡ�1���𤺤Ĥ��餷�ʤ����ʿ�� GC% ��׻�����ɽ������
1282
+
1283
+ seq.window_search(100) do |subseq|
1284
+ puts subseq.gc_percent
1285
+ end
1286
+
1287
+ �֥��å�����Ǽ��������ʬ����⡢����Ʊ�� Bio::Sequence::NA �ޤ���
1288
+ Bio::Sequence::AA ���饹�Υ��֥������ȤʤΤǡ����󥯥饹�λ������ƤΥ�
1289
+ ���åɤ�¹Ԥ��뤳�Ȥ��Ǥ��ޤ���
1290
+
1291
+ �ޤ��������ܤΰ����˰�ư������ꤹ�뤳�Ȥ������褦�ˤʤäƤ���Τǡ�
1292
+
1293
+ * ���ɥ�ñ�̤Ǥ��餷�ʤ��� 15 ����� 5 �Ĵ�Υڥץ��ɤ���������ɽ������
1294
+
1295
+ seq.window_search(15, 3) do |subseq|
1296
+ puts subseq.translate
1297
+ end
1298
+
1299
+ �Ȥ��ä����Ȥ��Ǥ��ޤ�������˰�ư���������ʤ���ü����ʬ�����᥽�å�
1300
+ ���Τ��֤��ͤȤ����᤹�褦�ˤʤäƤ���Τǡ�
1301
+
1302
+ * ���Υ������ 10000bp ���Ȥ˥֥��ڤ�ˤ��� FASTA �ե����ޥåȤ�������
1303
+ ���ΤȤ���ü 1000bp �ϥ����С���åפ�����10000bp �������ʤ� 3' ü��
1304
+ ���Ӽ�����ä�ɽ������
1305
+
1306
+ i = 1
1307
+ remainder = seq.window_search(10000, 9000) do |subseq|
1308
+ puts subseq.to_fasta("segment #{i}", 60)
1309
+ i += 1
1310
+ end
1311
+ puts remainder.to_fasta("segment #{i}", 60)
1312
+
1313
+ �Τ褦�ʻ�����ȴ�ñ�ˤǤ��ޤ���
1314
+
1315
+ ������ɥ������Ȱ�ư����Ʊ���ˤ���ȥ����С���åפ��ʤ�������ɥ�����
1316
+ �����Ǥ���Τǡ�
1317
+
1318
+ * ���ɥ����٤������
1319
+
1320
+ codon_usage = Hash.new(0)
1321
+ seq.window_search(3, 3) do |subseq|
1322
+ codon_usage[subseq] += 1
1323
+ end
1324
+
1325
+ * 10 �Ĵ𤺤�ʬ���̤�׻�
1326
+
1327
+ seq.window_search(10, 10) do |subseq|
1328
+ puts subseq.molecular_weight
1329
+ end
1330
+
1331
+ �Ȥ��ä����Ѥ�ͤ����ޤ���
1332
+
1333
+ �ºݤˤ� Bio::Sequence::NA ���֥������Ȥϥե����뤫���ɤ߹����ʸ����
1334
+ �����������ꡢ�ǡ����١����������������Τ�Ȥä��ꤷ�ޤ������Ȥ��С�
1335
+
1336
+ #!/usr/bin/env ruby
1337
+
1338
+ require 'bio'
1339
+
1340
+ input_seq = ARGF.read # ������Ϳ����줿�ե���������Ԥ��ɤ߹���
1341
+
1342
+ my_naseq = Bio::Sequence::NA.new(input_seq)
1343
+ my_aaseq = my_naseq.translate
1344
+
1345
+ puts my_aaseq
1346
+
1347
+ ���Υץ������� na2aa.rb �Ȥ��ơ��ʲ��α�������
1348
+
1349
+ gtggcgatctttccgaaagcgatgactggagcgaagaaccaaagcagtgacatttgtctg
1350
+ atgccgcacgtaggcctgataagacgcggacagcgtcgcatcaggcatcttgtgcaaatg
1351
+ tcggatgcggcgtga
1352
+
1353
+ ��񤤤��ե����� my_naseq.txt ���ɤ߹�������������
1354
+
1355
+ % ./na2aa.rb my_naseq.txt
1356
+ VAIFPKAMTGAKNQSSDICLMPHVGLIRRGQRRIRHLVQMSDAA*
1357
+
1358
+ �Τ褦�ˤʤ�ޤ������ʤߤˡ����Τ��餤����ʤ�û������ȣ��Ԥǽ񤱤ޤ���
1359
+
1360
+ % ruby -r bio -e 'p Bio::Sequence::NA.new($<.read).translate' my_naseq.txt
1361
+
1362
+ �����������������ե��������Τ����ݤʤΤǡ����ϥǡ����١�������ɬ�פ�
1363
+ �����������Ƥߤޤ���
1364
+
1365
+
1366
+ == GenBank �Υѡ��� (Bio::GenBank ���饹)
1367
+
1368
+ GenBank �����Υե�������Ѱդ��Ƥ��������ʼ긵�ˤʤ����ϡ�
1369
+ ftp://ftp.ncbi.nih.gov/genbank/ ���� .seq �ե���������������ɤ��ޤ��ˡ�
1370
+
1371
+ % wget ftp://ftp.hgc.jp/pub/mirror/ncbi/genbank/gbphg.seq.gz
1372
+ % gunzip gbphg.seq.gz
1373
+
1374
+ �ޤ��ϡ��ƥ���ȥ꤫�� ID ������ʸ���������Ф��� FASTA �������Ѵ�����
1375
+ �ߤޤ��礦��
1376
+
1377
+ Bio::GenBank::DELIMITER �� GenBank ���饹���������Ƥ�������ǡ�
1378
+ �ǡ����١������Ȥ˰ۤʤ륨��ȥ�ζ��ڤ�ʸ���ʤ��Ȥ��� GenBank �ξ��� //��
1379
+ ��Ф��Ƥ��ʤ��Ƥ��ɤ��褦�ˤʤäƤ��ޤ���
1380
+
1381
+ #!/usr/bin/env ruby
1382
+
1383
+ require 'bio'
1384
+
1385
+ while entry = gets(Bio::GenBank::DELIMITER)
1386
+ gb = Bio::GenBank.new(entry) # GenBank ���֥�������
1387
+
1388
+ print ">#{gb.accession} " # ACCESSION �ֹ�
1389
+ puts gb.definition # DEFINITION ��
1390
+ puts gb.naseq # ���������Sequence::NA ���֥������ȡ�
1391
+ end
1392
+
1393
+ �����������ν����Ǥ� GenBank �ե�����Υǡ�����¤�˰�¸���Ƥ��ޤ���
1394
+ �ե����뤫��Υǡ������Ϥ򰷤����饹 Bio::FlatFile ����Ѥ��뤳�Ȥǡ�
1395
+ �ʲ��Τ褦�˶��ڤ�ʸ���ʤɤ򵤤ˤ����񤯤��Ȥ��Ǥ��ޤ���
1396
+
1397
+ #!/usr/bin/env ruby
1398
+
1399
+ require 'bio'
1400
+
1401
+ ff = Bio::FlatFile.new(Bio::GenBank, ARGF)
1402
+ ff.each_entry do |gb|
1403
+ definition = "#{gb.accession} #{gb.definition}"
1404
+ puts gb.naseq.to_fasta(definition, 60)
1405
+ end
1406
+
1407
+ �����ΰ㤦�ǡ��������Ȥ���FASTA�ե����ޥåȤΥե�������ɤ߹���Ȥ��Ǥ⡢
1408
+
1409
+ #!/usr/bin/env ruby
1410
+
1411
+ require 'bio'
1412
+
1413
+ ff = Bio::FlatFile.new(Bio::FastaFormat, ARGF)
1414
+ ff.each_entry do |f|
1415
+ puts "definition : " + f.definition
1416
+ puts "nalen : " + f.nalen.to_s
1417
+ puts "naseq : " + f.naseq
1418
+ end
1419
+
1420
+ �Τ褦�ˡ�Ʊ���褦�ʽ����ǺѤޤ����ޤ���
1421
+
1422
+ ����ˡ��� Bio::DB ���饹�� open �᥽�åɤ�Ʊ�ͤΤ��Ȥ��Ǥ��ޤ������Ȥ��С�
1423
+
1424
+ #!/usr/bin/env ruby
1425
+
1426
+ require 'bio'
1427
+
1428
+ ff = Bio::GenBank.open("gbvrl1.seq")
1429
+ ff.each_entry do |gb|
1430
+ definition = "#{gb.accession} #{gb.definition}"
1431
+ puts gb.naseq.to_fasta(definition, 60)
1432
+ end
1433
+
1434
+ �ʤɤȽ񤯤��Ȥ��Ǥ��ޤ��ʤ����������ν����Ϥ��ޤ�Ȥ��Ƥ��ޤ���)��
1435
+
1436
+ ���ˡ�GenBank ��ʣ���� FEATURES �����ѡ�������ɬ�פʾ������Ф��ޤ���
1437
+ �ޤ��� /tranlation="���ߥλ�����" �Ȥ��� Qualifier �����������
1438
+ ���ߥλ��������Ф���ɽ�����Ƥߤޤ���
1439
+
1440
+ #!/usr/bin/env ruby
1441
+
1442
+ require 'bio'
1443
+
1444
+ ff = Bio::FlatFile.new(Bio::GenBank, ARGF)
1445
+
1446
+ # GenBank �Σ�����ȥꤴ�Ȥ�
1447
+ ff.each_entry do |gb|
1448
+
1449
+ # FEATURES �����Ǥ��Ĥ��Ľ���
1450
+ gb.features.each do |feature|
1451
+
1452
+ # Feature �˴ޤޤ�� Qualifier �����ƥϥå�����Ѵ�
1453
+ hash = feature.to_hash
1454
+
1455
+ # Qualifier �� translation �����������
1456
+ if hash['translation']
1457
+ # ����ȥ�Υ������å�����ֹ�����������ɽ��
1458
+ puts ">#{gb.accession}
1459
+ puts hash['translation']
1460
+ end
1461
+ end
1462
+ end
1463
+
1464
+ ����ˡ�Feature �Υݥ������˽񤫤�Ƥ�����󤫤饨��ȥ�α��������
1465
+ ���ץ饤���󥰤������������������Τ� /translation= �˽񤫤�Ƥ��������
1466
+ ξ��ɽ��������٤Ƥߤޤ��礦��
1467
+
1468
+ #!/usr/bin/env ruby
1469
+
1470
+ require 'bio'
1471
+
1472
+ ff = Bio::FlatFile.new(Bio::GenBank, ARGF)
1473
+
1474
+ # GenBank �Σ�����ȥꤴ�Ȥ�
1475
+ ff.each_entry do |gb|
1476
+
1477
+ # ACCESSION �ֹ����ʪ��̾��ɽ��
1478
+ puts "### #{gb.accession} - #{gb.organism}"
1479
+
1480
+ # FEATURES �����Ǥ��Ĥ��Ľ���
1481
+ gb.features.each do |feature|
1482
+
1483
+ # Feature �� position (join ...�ʤ�) ����Ф�
1484
+ position = feature.position
1485
+
1486
+ # Feature �˴ޤޤ�� Qualifier �����ƥϥå�����Ѵ�
1487
+ hash = feature.to_hash
1488
+
1489
+ # /translation= ���ʤ���Х����å�
1490
+ next unless hash['translation']
1491
+
1492
+ # /gene=, /product= �ʤɤ� Qualifier ���������̾�ʤɤξ���򽸤��
1493
+ gene_info = [
1494
+ hash['gene'], hash['product'], hash['note'], hash['function']
1495
+ ].compact.join(', ')
1496
+ puts "## #{gene_info}"
1497
+
1498
+ # ���������position �ξ���ˤ�äƥ��ץ饤���󥰡�
1499
+ puts ">NA splicing('#{position}')"
1500
+ puts gb.naseq.splicing(position)
1501
+
1502
+ # ���ߥλ�����ʥ��ץ饤���󥰤����������󤫤�������
1503
+ puts ">AA translated by splicing('#{position}').translate"
1504
+ puts gb.naseq.splicing(position).translate
1505
+
1506
+ # ���ߥλ������/translation= �˽񤫤�Ƥ����Τ�Ρ�
1507
+ puts ">AA original translation"
1508
+ puts hash['translation']
1509
+ end
1510
+ end
1511
+
1512
+ �⤷�����Ѥ���Ƥ��륳�ɥ�ơ��֥뤬�ǥե���� (universal) �Ȱ�ä��ꡢ
1513
+ �ǽ�Υ��ɥ� "atg" �ʳ����ä��ꡢ����Υ����ƥ��󤬴ޤޤ�Ƥ����ꡢ
1514
+ ���뤤�� BioRuby �˥Х�������С�������ɽ������룲�ĤΥ��ߥλ������
1515
+ �ۤʤ���ˤʤ�ޤ���
1516
+
1517
+ ������ǻ��Ѥ���Ƥ��� Bio::Sequence#splicing �᥽�åɤϡ�GenBank, EMBL,
1518
+ DDBJ �ե����ޥåȤǻȤ��Ƥ��� Location ��ɽ���򸵤ˡ��������󤫤�
1519
+ ��ʬ������ڤ�Ф����Ϥʥ᥽�åɤǤ���
1520
+
1521
+ ���� splicing �᥽�åɤΰ����ˤ� GenBank ���� Location ��ʸ����ʳ���
1522
+ BioRuby �� Bio::Locations ���֥������Ȥ��Ϥ����Ȥ��ǽ�Ǥ�����
1523
+ �̾�ϸ�����Ƥ��� Location ʸ���������ʬ����䤹�������Τ�ޤ���
1524
+ Location ʸ����Υե����ޥåȤ� Bio::Locations �ˤĤ��ƾܤ����Τꤿ������
1525
+ BioRuby �� bio/location.rb �򸫤Ƥ���������
1526
+
1527
+ * GenBank �����Υǡ����� Feature �ǻȤ��Ƥ��� Location ʸ�������
1528
+
1529
+ naseq.splicing('join(2035..2050,complement(1775..1818),13..345')
1530
+
1531
+ * ���餫���� Locations ���֥������Ȥ��Ѵ����Ƥ����Ϥ��Ƥ�褤
1532
+
1533
+ locs = Bio::Locations.new('join((8298.8300)..10206,1..855)')
1534
+ naseq.splicing(locs)
1535
+
1536
+ ���ʤߤˡ����ߥλ����� (Bio::Sequence::AA) �ˤĤ��Ƥ� splicing �᥽�å�
1537
+ ����Ѥ�����ʬ�������Ф����Ȥ���ǽ�Ǥ���
1538
+
1539
+ * ���ߥλ��������ʬ������ڤ�Ф��ʥ����ʥ�ڥץ��ɤʤɡ�
1540
+
1541
+ aaseq.splicing('21..119')
1542
+
1543
+
1544
+ === GenBank �ʳ��Υǡ����١���
1545
+
1546
+ BioRuby �Ǥϡ�GenBank �ʳ��Υǡ����١����ˤĤ��Ƥ����Ū�ʰ�������Ʊ���ǡ�
1547
+ �ǡ����١����Σ�����ȥ�ʬ��ʸ������б�����ǡ����١����Υ��饹���Ϥ��С�
1548
+ �ѡ������줿��̤����֥������Ȥˤʤä��֤äƤ��ޤ���
1549
+
1550
+ �ǡ����١����Υե�åȥե����뤫�飱����ȥꤺ�ļ��Ф��ƥѡ������줿
1551
+ ���֥������Ȥ���Ф��ˤϡ���ˤ�ФƤ��� Bio::FlatFile ��Ȥ��ޤ���
1552
+ Bio::FlatFile.new �ΰ����ˤϥǡ����١������б����� BioRuby �ǤΥ��饹
1553
+ ̾ (Bio::GenBank �� Bio::KEGG::GENES �ʤ�) ����ꤷ�ޤ���
1554
+
1555
+ ff = Bio::FlatFile.new(Bio::�ǡ����١������饹̾, ARGF)
1556
+
1557
+ �����������Ф餷�����Ȥˡ��¤� FlatFile ���饹�ϥǡ����١����μ�ưǧ����
1558
+ �Ǥ��ޤ��Τǡ�
1559
+
1560
+ ff = Bio::FlatFile.auto(ARGF)
1561
+
1562
+ ��Ȥ��Τ����ִ�ñ�Ǥ���
1563
+
1564
+ #!/usr/bin/env ruby
1565
+
1566
+ require 'bio'
1567
+
1568
+ ff = Bio::FlatFile.auto(ARGF)
1569
+
1570
+ ff.each_entry do |entry|
1571
+ p entry.entry_id # ����ȥ�� ID
1572
+ p entry.definition # ����ȥ������ʸ
1573
+ p entry.seq # ����ǡ����١����ξ��
1574
+ end
1575
+
1576
+ ff.close
1577
+
1578
+ ����ˡ��������ǡ����١������Ĥ�˺���ʤ�������ˤ� Ruby �Υ֥��å���
1579
+ ���Ѥ��ưʲ��Τ褦�˽񤯤Τ��褤�Ǥ��礦��
1580
+
1581
+ #!/usr/bin/env ruby
1582
+
1583
+ require 'bio'
1584
+
1585
+ Bio::FlatFile.auto(ARGF) do |ff|
1586
+ ff.each_entry do |entry|
1587
+ p entry.entry_id # ����ȥ�� ID
1588
+ p entry.definition # ����ȥ������ʸ
1589
+ p entry.seq # ����ǡ����١����ξ��
1590
+ end
1591
+ end
1592
+
1593
+ �ѡ������줿���֥������Ȥ��顢����ȥ���Τ��줾�����ʬ����Ф������
1594
+ �᥽�åɤϥǡ����١�����˰ۤʤ�ޤ����褯������ܤˤĤ��Ƥ�
1595
+
1596
+ * entry_id �᥽�å� �� ����ȥ�� ID �ֹ椬�֤�
1597
+ * definition �᥽�å� �� ����ȥ������Ԥ��֤�
1598
+ * reference �᥽�å� �� ��ե���󥹥��֥������Ȥ��֤�
1599
+ * organism �᥽�å� �� ��ʪ��̾
1600
+ * seq �� naseq �� aaseq �᥽�å� �� �б��������󥪥֥������Ȥ��֤�
1601
+
1602
+ �ʤɤΤ褦�˶��̲����褦�Ȥ��Ƥ��ޤ��������ƤΥ᥽�åɤ���������Ƥ����
1603
+ ���ǤϤ���ޤ���ʶ��̲��λؿˤ� bio/db.rb ���ȡˡ��ޤ����٤�����ʬ�ϳ�
1604
+ �ǡ����١����ѡ�����˰ۤʤ�Τǡ����줾��Υɥ�����Ȥ˽����ޤ���
1605
+
1606
+ ��§�Ȥ��ơ��᥽�å�̾��ʣ�����ξ��ϡ����֥������Ȥ�����Ȥ����֤�ޤ���
1607
+ ���Ȥ��� references �᥽�åɤ���ĥ��饹��ʣ���� Bio::Reference ���֥���
1608
+ ���Ȥ� Array �ˤ����֤��ޤ������̤Υ��饹�Ǥ�ñ������ reference �᥽�å�
1609
+ �����ʤ������Ĥ� Bio::Reference ���֥������Ȥ������֤����Ȥ��ä������Ǥ���
1610
+
1611
+ == PDB �Υѡ��� (Bio::PDB ���饹)
1612
+
1613
+ Bio::PDB �ϡ�PDB �������ɤ߹��ि��Υ��饹�Ǥ���PDB �ǡ����١�����
1614
+ PDB, mmCIF, XML (PDBML) �Σ�����Υե����ޥåȤ��󶡤���Ƥ��ޤ�����
1615
+ �����Τ��� BioRuby ���б����Ƥ���Τ� PDB �ե����ޥåȤǤ���
1616
+
1617
+ PDB �ե����ޥåȤλ��ͤϡ��ʲ��� Protein Data Bank Contents Guide ��
1618
+ ���Ȥ��Ƥ���������
1619
+
1620
+ * ((<URL:http://www.rcsb.org/pdb/file_formats/pdb/pdbguide2.2/guide2.2_frame.html>))
1621
+
1622
+ === PDB �ǡ������ɤ߹���
1623
+
1624
+ PDB �Σ�����ȥ꤬ 1bl8.pdb �Ȥ����ե�����˳�Ǽ����Ƥ�����ϡ�
1625
+ Ruby �Υե������ɤ߹��ߵ�ǽ��Ȥä�
1626
+
1627
+ entry = File.read("1bl8.pdb")
1628
+
1629
+ �Τ褦�ˤ��뤳�Ȥǡ�����ȥ�����Ƥ�ʸ����Ȥ��� entry �Ȥ����ѿ���
1630
+ �������뤳�Ȥ��Ǥ��ޤ�������ȥ�����Ƥ�ѡ�������ˤ�
1631
+
1632
+ pdb = Bio::PDB.new(entry)
1633
+
1634
+ �Ȥ��ޤ�������ǥ���ȥ꤬ Bio::PDB ���֥������ȤȤʤꡢǤ�դΥǡ�����
1635
+ ���Ф���褦�ˤʤ�ޤ���
1636
+
1637
+ PDB �ե����ޥåȤ� Bio::FlatFile �ˤ�뼫ưǧ�����ǽ�Ǥ��������ߤ�
1638
+ ���ե������ʣ������ȥ��ޤ���ˤ��б����Ƥ��ޤ���
1639
+ Bio::FlatFile ��Ȥäƣ�����ȥ�ʬ�����ɤ߹���ˤϡ�
1640
+
1641
+ pdb = Bio::FlatFile.auto("1bl8.pdb") { |ff| ff.next_entry }
1642
+
1643
+ �Ȥ��ޤ����ɤ������ˡ�Ǥ��ѿ� pdb �ˤ�Ʊ����̤������ޤ���
1644
+
1645
+ === ���֥������Ȥγ��ع�¤
1646
+
1647
+ �� PDB ����ȥ�ϡ��ѿ�����ʸ������ʤ� ID ���դ����Ƥ��ޤ���
1648
+ Bio::PDB ���֥������Ȥ��� ID ����Ф��ˤ� entry_id �᥽�åɤ�Ȥ��ޤ���
1649
+
1650
+ p pdb.entry_id # => "1BL8"
1651
+
1652
+ ����ȥ�γ��פ˴ؤ��������б�����᥽�åɤǼ��Ф����Ȥ��Ǥ��ޤ���
1653
+
1654
+ p pdb.definition # => "POTASSIUM CHANNEL (KCSA) FROM STREPTOMYCES LIVIDANS"
1655
+ p pdb.keywords # => ["POTASSIUM CHANNEL", "INTEGRAL MEMBRANE PROTEIN"]
1656
+
1657
+ ¾�ˡ���Ͽ�Ԥ�ʸ�����¸���ˡ�ʤɤξ��������Ǥ��ޤ��ʤ��줾��
1658
+ authors, jrnl, method �᥽�åɡˡ�
1659
+
1660
+ PDB �ǡ����ϡ�����Ū�ˤϣ��Ԥ����ĤΥ쥳���ɤ�������Ƥ��ޤ���
1661
+ ���Ԥ����꤭��ʤ��ǡ�����ʣ���Ԥ˳�Ǽ���� continuation �Ȥ���
1662
+ ���Ȥߤ��Ѱդ���Ƥ��ޤ��������ܤϣ��ԣ��쥳���ɤǤ���
1663
+
1664
+ �ƹԤ���Ƭ��ʸ�������ιԤΥǡ����μ���򼨤�̾���ʥ쥳���ɡˤˤʤ�ޤ���
1665
+ BioRuby �Ǥϡ�HEADER �쥳���ɤ��Ф��Ƥ� Bio::PDB::Record::HEADER ���饹��
1666
+ TITLE �쥳���ɤ��Ф��Ƥ� Bio::PDB::Record::TITLE ���饹���Ȥ����褦��
1667
+ ����Ū�ˤϳƥ쥳���ɤ��б����륯�饹�򣱤��Ѱդ��Ƥ��ޤ���
1668
+ ��������REMARK �� JRNL �쥳���ɤ˴ؤ��Ƥϡ����줾��ʣ���Υե����ޥåȤ�
1669
+ ¸�ߤ��뤿�ᡢʣ���Υ��饹���Ѱդ��Ƥ��ޤ���
1670
+
1671
+ �ƥ쥳���ɤ˥������������äȤ�ñ�����ˡ�� record �᥽�åɤǤ���
1672
+
1673
+ pdb.record("HELIX")
1674
+
1675
+ �Τ褦�ˤ���ȡ����� PDB ����ȥ�˴ޤޤ�����Ƥ� HELIX �쥳���ɤ�
1676
+ Bio::PDB::Record::HELIX ���饹�Υ��֥������Ȥ�����Ȥ��Ƽ����Ǥ��ޤ���
1677
+
1678
+ ���Τ��Ȥ�դޤ����ʲ��Ǥϡ�PDB ����ȥ�Υᥤ������ƤǤ���Ω�ι�¤��
1679
+ �ؤ���ǡ�����¤�ΰ������򸫤Ƥ����ޤ���
1680
+
1681
+ ==== ����: Bio::PDB::Record::ATOM, Bio::PDB::Record::HETATM ���饹
1682
+
1683
+ PDB ����ȥ�ϡ�����ѥ������˻���DNA,RNA�ˤ䤽��¾��ʬ�Ҥ�Ω�ι�¤��
1684
+ ����Ū�ˤϸ��ҤΣ�������ɸ��ޤ�Ǥ��ޤ���
1685
+
1686
+ ����ѥ����ޤ��ϳ˻��θ��Ҥκ�ɸ�ϡ�ATOM �쥳���ɤ˳�Ǽ����Ƥ��ޤ���
1687
+ �б����륯�饹�ϡ�Bio::PDB::Record::ATOM ���饹�Ǥ���
1688
+
1689
+ ����ѥ������˻��ʳ��θ��Ҥκ�ɸ�ϡ�HETATM �쥳���ɤ˳�Ǽ����Ƥ��ޤ���
1690
+ �б����륯�饹�ϡ�Bio::PDB::Record::HETATM ���饹�Ǥ���
1691
+
1692
+ HETATM�����饹�� ATOM ���饹��Ѿ����Ƥ��뤿�ᡢATOM �� HETATM ��
1693
+ �᥽�åɤλȤ����Ϥޤä���Ʊ���Ǥ���
1694
+
1695
+ ==== ���ߥλ��Ĵ�ʤޤ��ϱ����: Bio::PDB::Residue ���饹
1696
+
1697
+ �����ߥλ��ޤ��ϣ�����ñ�̤Ǹ��Ҥ�ޤȤ᤿�Τ� Bio::PDB::Residue �Ǥ���
1698
+ Bio::PDB::Residue ���֥������Ȥϡ����İʾ�� Bio::PDB::Record::ATOM
1699
+ ���֥������Ȥ�ޤߤޤ���
1700
+
1701
+ ==== ����ʪ: Bio::PDB::Heterogen ���饹
1702
+
1703
+ ����ѥ������˻��ʳ���ʬ�Ҥθ��Ҥϡ�����Ū�ˤ�ʬ��ñ�̤�
1704
+ Bio::PDB::Heterogen �ˤޤȤ���Ƥ��ޤ���
1705
+ Bio::PDB::Heterogen ���֥������Ȥϡ����İʾ��
1706
+ Bio::PDB::Record::HETATM ���֥������Ȥ�ޤߤޤ���
1707
+
1708
+ ==== ���ʥ��������: Bio::PDB::Chain ���饹
1709
+
1710
+ Bio::PDB::Chain �ϡ�ʣ���� Bio::PDB::Residue ���֥������Ȥ���ʤ�
1711
+ ���ĤΥ���ѥ����ޤ��ϳ˻��ȡ�ʣ���� Bio::PDB::Heterogen ���֥�������
1712
+ ����ʤ룱�İʾ�Τ���ʳ���ʬ�Ҥ��Ǽ����ǡ�����¤�Ǥ���
1713
+
1714
+ �ʤ�����Ⱦ�ξ��ϡ�����ѥ������˻���Bio::PDB::Residue�ˤ���
1715
+ ����ʳ���ʬ�ҡ�Bio::PDB::Heterogen�ˤΤɤ��餫����ष�������ޤ���
1716
+ Chain ��ҤȤĤ����ޤޤʤ� PDB ����ȥ�Ǥ�ξ�����ľ�礬����褦�Ǥ���
1717
+
1718
+ �� Chain �ˤϡ��ѿ�����ʸ���� ID ���դ��Ƥ��ޤ���Chain ��ҤȤĤ���
1719
+ �ޤޤʤ� PDB ����ȥ�ξ��϶���ʸ���ΤȤ��⤢��ޤ��ˡ�
1720
+
1721
+ ==== ��ǥ�: Bio::PDB::Model
1722
+
1723
+ ���İʾ�� Bio::PDB::Chain �����ޤä���Τ� Bio::PDB::Model �Ǥ���
1724
+ �����뾽��¤�ξ�硢Model ���̾�Ĥ����Ǥ�����NMR ��¤�ξ�硢
1725
+ ʣ���� Model ��¸�ߤ��뤳�Ȥ�����ޤ���
1726
+ ʣ���� Model ��¸�ߤ����硢�� Model �ˤϥ��ꥢ���ֹ椬�դ��ޤ���
1727
+
1728
+ �����ơ����İʾ�� Model �����ޤä���Τ���Bio::PDB ���֥������Ȥˤʤ�ޤ���
1729
+
1730
+ === ���Ҥ˥�����������᥽�å�
1731
+
1732
+ Bio::PDB#each_atom �����Ƥ� ATOM ����֤ˣ��Ĥ���é�륤�ƥ졼���Ǥ���
1733
+
1734
+ pdb.each_atom do |atom|
1735
+ p atom.xyz
1736
+ end
1737
+
1738
+ ���� each_atom �᥽�åɤ� Model, Chain, Residue ���֥������Ȥ��Ф��Ƥ�
1739
+ ���Ѥ��뤳�Ȥ��Ǥ������줾�졢���� Model, Chain, Residue �����Τ��٤Ƥ�
1740
+ ATOM �򤿤ɤ륤�ƥ졼���Ȥ���Ư���ޤ���
1741
+
1742
+ Bio::PDB#atoms �����Ƥ� ATOM ������Ȥ����֤��᥽�åɤǤ���
1743
+
1744
+ p pdb.atoms.size # => 2820 �Ĥ� ATOM ���ޤޤ�뤳�Ȥ��狼��
1745
+
1746
+ each_atom ��Ʊ�ͤ� atoms �᥽�åɤ� Model, Chain, Residue ���֥�������
1747
+ ���Ф��ƻ��Ѳ�ǽ�Ǥ���
1748
+
1749
+ pdb.chains.each do |chain|
1750
+ p chain.atoms.size # => �� Chain ��� ATOM ����ɽ�������
1751
+ end
1752
+
1753
+ Bio::PDB#each_hetatm �ϡ����Ƥ� HETATM ����֤ˣ��Ĥ���é�륤�ƥ졼���Ǥ���
1754
+
1755
+ pdb.each_hetatm do |hetatm|
1756
+ p hetatm.xyz
1757
+ end
1758
+
1759
+ Bio::PDB#hetatms ���Ƥ� HETATM ������Ȥ����֤��Τ� hetatms �᥽�åɤǤ���
1760
+
1761
+ p pdb.hetatms.size
1762
+
1763
+ ������ atoms �ξ���Ʊ�ͤˡ�Model, Chain, Heterogen ���֥������Ȥ�
1764
+ �Ф��ƻ��Ѳ�ǽ�Ǥ���
1765
+
1766
+ ==== Bio::PDB::Record::ATOM, Bio::PDB::Record::HETATM ���饹�λȤ���
1767
+
1768
+ ATOM �ϥ���ѥ������˻���DNA��RNA�ˤ������븶�ҡ�HETATM �Ϥ���ʳ���
1769
+ ���Ҥ��Ǽ���뤿��Υ��饹�Ǥ�����HETATM �� ATOM ���饹��Ѿ����Ƥ��뤿��
1770
+ �����Υ��饹�ǥ᥽�åɤλȤ����Ϥޤä���Ʊ���Ǥ���
1771
+
1772
+ p atom.serial # ���ꥢ���ֹ�
1773
+ p atom.name # ̾��
1774
+ p atom.altLoc # Alternate location indicator
1775
+ p atom.resName # ���ߥλ�������̾�ޤ��ϲ���ʪ̾
1776
+ p atom.chainID # Chain �� ID
1777
+ p atom.resSeq # ���ߥλ��Ĵ�Υ��������ֹ�
1778
+ p atom.iCode # Code for insertion of residues
1779
+ p atom.x # X ��ɸ
1780
+ p atom.y # Y ��ɸ
1781
+ p atom.z # Z ��ɸ
1782
+ p atom.occupancy # Occupancy
1783
+ p atom.tempFactor # Temperature factor
1784
+ p atom.segID # Segment identifier
1785
+ p atom.element # Element symbol
1786
+ p atom.charge # Charge on the atom
1787
+
1788
+ �����Υ᥽�å�̾�ϡ���§�Ȥ��� Protein Data Bank Contents Guide ��
1789
+ ���ܤ˹�碌�Ƥ��ޤ����᥽�å�̾�� resName �� resSeq �Ȥ��ä���̾ˡ
1790
+ ��CamelCase�ˤ���Ѥ��Ƥ���ΤϤ��Τ���Ǥ���
1791
+ ���줾��Υ᥽�åɤ��֤��ǡ����ΰ�̣�ϡ����ͽ�򻲹ͤˤ��Ƥ���������
1792
+
1793
+ ����¾�ˤ⡢�����Ĥ��������ʥ᥽�åɤ��Ѱդ��Ƥ��ޤ���
1794
+ xyz �᥽�åɤϡ���ɸ�򣳼����Υ٥��ȥ�Ȥ����֤��᥽�åɤǤ���
1795
+ ���Υ᥽�åɤϡ�Ruby �� Vector ���饹��Ѿ����ƣ������Υ٥��ȥ��
1796
+ �ò������� Bio::PDB::Coordinate ���饹�Υ��֥������Ȥ��֤��ޤ�
1797
+ ����: Vector��Ѿ��������饹���������ΤϤ��ޤ�侩����ʤ��褦�ʤΤǡ�
1798
+ ���衢Vector���饹�Υ��֥������Ȥ��֤��褦�����ѹ����뤫�⤷��ޤ���ˡ�
1799
+
1800
+ p atom.xyz
1801
+
1802
+ �٥��ȥ�ʤΤǡ�­�����������������Ѥʤɤ���뤳�Ȥ��Ǥ��ޤ���
1803
+
1804
+ # ���Ҵ֤ε�Υ�����
1805
+ p (atom1.xyz - atom2.xyz).r # r �ϥ٥��ȥ�������ͤ����᥽�å�
1806
+
1807
+ # ���Ѥ����
1808
+ p atom1.xyz.inner_product(atom2.xyz)
1809
+
1810
+ ¾�ˤϡ����θ��Ҥ��б����� TER, SIGATM, ANISOU �쥳���ɤ��������
1811
+ ter, sigatm, anisou �᥽�åɤ��Ѱդ���Ƥ��ޤ���
1812
+
1813
+ === ���ߥλ��Ĵ� (Residue) �˥�����������᥽�å�
1814
+
1815
+ Bio::PDB#each_residue �ϡ����Ƥ� Residue ����֤�é�륤�ƥ졼���Ǥ���
1816
+ each_residue �᥽�åɤϡ�Model, Chain ���֥������Ȥ��Ф��Ƥ�
1817
+ ���Ѥ��뤳�Ȥ��Ǥ������줾��� Model, Chain �˴ޤޤ�����Ƥ�
1818
+ Residue ��é�륤�ƥ졼���Ȥ���Ư���ޤ���
1819
+
1820
+ pdb.each_residue do |residue|
1821
+ p residue.resName
1822
+ end
1823
+
1824
+ Bio::PDB#residues �ϡ����Ƥ� Residue ������Ȥ����֤��᥽�åɤǤ���
1825
+ each_residue ��Ʊ�ͤˡ�Model, Chain ���֥������Ȥ��Ф��Ƥ���Ѳ�ǽ�Ǥ���
1826
+
1827
+ p pdb.residues.size
1828
+
1829
+ === ����ʪ (Heterogen) �˥�����������᥽�å�
1830
+
1831
+ Bio::PDB#each_heterogen �����Ƥ� Heterogen ����֤ˤ��ɤ륤�ƥ졼����
1832
+ Bio::PDB#heterogens �����Ƥ� Heterogen ������Ȥ����֤��᥽�åɤǤ���
1833
+
1834
+ pdb.each_heterogen do |heterogeon|
1835
+ p heterogen.resName
1836
+ end
1837
+
1838
+ p pdb.heterogens.size
1839
+
1840
+ �����Υ᥽�åɤ� Residue ��Ʊ�ͤ� Model, Chain ���֥������Ȥ��Ф��Ƥ�
1841
+ ���Ѳ�ǽ�Ǥ���
1842
+
1843
+ === Chain, Model �˥�����������᥽�å�
1844
+
1845
+ Ʊ�ͤˡ�Bio::PDB#each_chain �����Ƥ� Chain ����֤ˤ��ɤ륤�ƥ졼����
1846
+ Bio::PDB#chains �����Ƥ� Chain ������Ȥ����֤��᥽�åɤǤ���
1847
+ �����Υ᥽�åɤ� Model ���֥������Ȥ��Ф��Ƥ���Ѳ�ǽ�Ǥ���
1848
+
1849
+ Bio::PDB#each_model �����Ƥ� Model ����֤ˤ��ɤ륤�ƥ졼����
1850
+ Bio::PDB#models �����Ƥ� Model ������Ȥ����֤��᥽�åɤǤ���
1851
+
1852
+ === PDB Chemical Component Dictionary �Υǡ������ɤ߹���
1853
+
1854
+ Bio::PDB::ChemicalComponent ���饹�ϡ�PDB Chemical Component Dictionary
1855
+ �ʵ�̾�� HET Group Dictionary�ˤΥѡ����Ǥ���
1856
+
1857
+ PDB Chemical Component Dictionary �ˤĤ��Ƥϰʲ��Υڡ����򻲾Ȥ��Ƥ���������
1858
+
1859
+ * ((<URL:http://deposit.pdb.org/cc_dict_tut.html>))
1860
+
1861
+ �ǡ����ϰʲ��ǥ���������ɤǤ��ޤ���
1862
+
1863
+ * ((<URL:http://deposit.pdb.org/het_dictionary.txt>))
1864
+
1865
+ ���Υ��饹�ϡ�RESIDUE ����Ϥޤäƶ��Ԥǽ���룱����ȥ��ѡ������ޤ�
1866
+ ��PDB �ե����ޥåȤˤΤ��б����Ƥ��ޤ��ˡ�
1867
+
1868
+ Bio::FlatFile �ˤ��ե����������ưȽ�̤��б����Ƥ��ޤ���
1869
+ ���Υ��饹���Τ� ID ���鲽��ʪ�򸡺������ꤹ�뵡ǽ�ϻ��äƤ��ޤ���
1870
+ br_bioflat.rb �ˤ�륤��ǥå��������ˤ��б����Ƥ��ޤ��Τǡ�
1871
+ ɬ�פʤ餽�������Ѥ��Ƥ���������
1872
+
1873
+ Bio::FlatFile.auto("het_dictionary.txt") |ff|
1874
+ ff.each do |het|
1875
+ p het.entry_id # ID
1876
+ p het.hetnam # HETNAM �쥳���ɡʲ���ʪ��̾�Ρ�
1877
+ p het.hetsyn # HETSYM �쥳���ɡʲ���ʪ����̾�������
1878
+ p het.formul # FORMUL �쥳���ɡʲ���ʪ����������
1879
+ p het.conect # CONECT �쥳����
1880
+ end
1881
+ end
1882
+
1883
+ �Ǹ�� conect �᥽�åɤϡ�����ʪ�η��� Hash �Ȥ����֤��ޤ���
1884
+ ���Ȥ��С������Ρ���Υ���ȥ�ϼ��Τ褦�ˤʤ�ޤ�����
1885
+
1886
+ RESIDUE EOH 9
1887
+ CONECT C1 4 C2 O 1H1 2H1
1888
+ CONECT C2 4 C1 1H2 2H2 3H2
1889
+ CONECT O 2 C1 HO
1890
+ CONECT 1H1 1 C1
1891
+ CONECT 2H1 1 C1
1892
+ CONECT 1H2 1 C2
1893
+ CONECT 2H2 1 C2
1894
+ CONECT 3H2 1 C2
1895
+ CONECT HO 1 O
1896
+ END
1897
+ HET EOH 9
1898
+ HETNAM EOH ETHANOL
1899
+ FORMUL EOH C2 H6 O1
1900
+
1901
+ ���Υ���ȥ���Ф��� conect �᥽�åɤ�Ƥ֤�
1902
+
1903
+ { "C1" => [ "C2", "O", "1H1", "2H1" ],
1904
+ "C2" => [ "C1", "1H2", "2H2", "3H2" ],
1905
+ "O" => [ "C1", "HO" ],
1906
+ "1H1" => [ "C1" ],
1907
+ "1H2" => [ "C2" ],
1908
+ "2H1" => [ "C1" ],
1909
+ "2H2" => [ "C2" ],
1910
+ "3H2" => [ "C2" ],
1911
+ "HO" => [ "O" ] }
1912
+
1913
+ �Ȥ��� Hash ���֤��ޤ���
1914
+
1915
+ �����ޤǤν����� BioRuby ������ǻ�Ȱʲ��Τ褦�ˤʤ�ޤ���
1916
+
1917
+ # PDB ����ȥ� 1bl8 ��ͥåȥ����ͳ�Ǽ���
1918
+ bioruby> ent_1bl8 = ent("pdb:1bl8")
1919
+ # ����ȥ����Ȥ��ǧ
1920
+ bioruby> head ent_1bl8
1921
+ # ����ȥ��ե��������¸
1922
+ bioruby> savefile("1bl8.pdb", ent_1bl8)
1923
+ # ��¸���줿�ե��������Ȥ��ǧ
1924
+ bioruby> disp "data/1bl8.pdb"
1925
+ # PDB ����ȥ��ѡ���
1926
+ bioruby> pdb_1bl8 = flatparse(ent_1bl8)
1927
+ # PDB �Υ���ȥ� ID ��ɽ��
1928
+ bioruby> pdb_1bl8.entry_id
1929
+ # ent("pdb:1bl8") ���� flatparse ��������ˡ��ʲ��Ǥ�OK
1930
+ bioruby> obj_1bl8 = obj("pdb:1bl8")
1931
+ bioruby> obj_1bl8.entry_id
1932
+ # �� HETEROGEN ���Ȥ˻Ĵ�̾��ɽ��
1933
+ bioruby> pdb_1bl8.each_heterogen { |heterogen| p heterogen.resName }
1934
+
1935
+ # PDB Chemical Component Dictionary �����
1936
+ bioruby> het_dic = open("http://deposit.pdb.org/het_dictionary.txt").read
1937
+ # ���������ե�����ΥХ��ȿ����ǧ
1938
+ bioruby> het_dic.size
1939
+ # ���������ե��������¸
1940
+ bioruby> savefile("data/het_dictionary.txt", het_dic)
1941
+ # �ե��������Ȥ��ǧ
1942
+ bioruby> disp "data/het_dictionary.txt"
1943
+ # �����Τ���˥���ǥå������� het_dic �Ȥ����ǡ����١��������
1944
+ bioruby> flatindex("het_dic", "data/het_dictionary.txt")
1945
+ # ID �� EOH �Υ����Ρ���Υ���ȥ�򸡺�
1946
+ bioruby> ethanol = flatsearch("het_dic", "EOH")
1947
+ # ������������ȥ��ѡ���
1948
+ bioruby> osake = flatparse(ethanol)
1949
+ # ���Ҵ֤η��ơ��֥��ɽ��
1950
+ bioruby> sake.conect
1951
+
1952
+ == ���饤���� (Bio::Alignment ���饹)
1953
+
1954
+ Bio::Alignment ���饹������Υ��饤���Ȥ��Ǽ���뤿��Υ���ƥʤǤ���
1955
+ Ruby �� Hash �� Array �˻�������ǽ�ǡ�BioPerl �� Bio::SimpleAlign ��
1956
+ ���������ˤʤäƤ��ޤ����ʲ��˴�ñ�ʻȤ����򼨤��ޤ���
1957
+
1958
+ require 'bio'
1959
+
1960
+ seqs = [ 'atgca', 'aagca', 'acgca', 'acgcg' ]
1961
+ seqs = seqs.collect{ |x| Bio::Sequence::NA.new(x) }
1962
+
1963
+ # ���饤���ȥ��֥������Ȥ����
1964
+ a = Bio::Alignment.new(seqs)
1965
+
1966
+ # ���󥻥󥵥������ɽ��
1967
+ p a.consensus # ==> "a?gc?"
1968
+
1969
+ # IUPAC ɸ���ۣ��ʱ������Ѥ������󥻥󥵥������ɽ��
1970
+ p a.consensus_iupac # ==> "ahgcr"
1971
+
1972
+ # ������ˤĤ��Ʒ����֤�
1973
+ a.each { |x| p x }
1974
+ # ==>
1975
+ # "atgca"
1976
+ # "aagca"
1977
+ # "acgca"
1978
+ # "acgcg"
1979
+
1980
+ # �ƥ����ȤˤĤ��Ʒ����֤�
1981
+ a.each_site { |x| p x }
1982
+ # ==>
1983
+ # ["a", "a", "a", "a"]
1984
+ # ["t", "a", "c", "c"]
1985
+ # ["g", "g", "g", "g"]
1986
+ # ["c", "c", "c", "c"]
1987
+ # ["a", "a", "a", "g"]
1988
+
1989
+ # Clustal W ����Ѥ��ƥ��饤���Ȥ�Ԥ���
1990
+ # 'clustalw' ���ޥ�ɤ������ƥ�˥��󥹥ȡ��뤵��Ƥ���ɬ�פ����롣
1991
+ factory = Bio::ClustalW.new
1992
+ a2 = a.do_align(factory)
1993
+
1994
+
1995
+ == FASTA �ˤ����Ʊ��������Ԥ���Bio::Fasta ���饹��
1996
+
1997
+ FASTA ����������ե����� query.pep ���Ф��ơ���ʬ�Υޥ���(��������)���뤤��
1998
+ ���󥿡��ͥåȾ�Υ�����(��⡼��)�� FASTA �ˤ����Ʊ��������Ԥ���ˡ�Ǥ���
1999
+ ��������ξ��� SSEARCH �ʤɤ�Ʊ�ͤ˻Ȥ����Ȥ��Ǥ��ޤ���
2000
+
2001
+ === ���������
2002
+
2003
+ FASTA �����󥹥ȡ��뤵��Ƥ��뤳�Ȥ��ǧ���Ƥ����������ʲ�����Ǥϡ�
2004
+ ���ޥ��̾�� fasta34 �ǥѥ����̤ä��ǥ��쥯�ȥ�˥��󥹥ȡ���
2005
+ ����Ƥ���������ꤷ�Ƥ��ޤ���
2006
+
2007
+ * ((<URL:ftp://ftp.virginia.edu/pub/fasta/>))
2008
+
2009
+ �����оݤȤ��� FASTA �����Υǡ����١����ե����� target.pep �ȡ�FASTA
2010
+ �������䤤��碌���󤬤����Ĥ����ä��ե����� query.pep ��������ޤ���
2011
+
2012
+ ������Ǥϡ����䤤��碌���󤴤Ȥ� FASTA ������¹Ԥ����ҥåȤ��������
2013
+ evalue �� 0.0001 �ʲ��Τ�Τ�����ɽ�����ޤ���
2014
+
2015
+ #!/usr/bin/env ruby
2016
+
2017
+ require 'bio'
2018
+
2019
+ # FASTA ��¹Ԥ���Ķ����֥������Ȥ����ssearch �ʤɤǤ��ɤ���
2020
+ factory = Bio::Fasta.local('fasta34', ARGV.pop)
2021
+
2022
+ # �ե�åȥե�������ɤ߹��ߡ�FastaFormat ���֥������ȤΥꥹ�Ȥˤ���
2023
+ ff = Bio::FlatFile.new(Bio::FastaFormat, ARGF)
2024
+
2025
+ # ������ȥꤺ�Ĥ� FastaFormat ���֥������Ȥ��Ф�
2026
+ ff.each do |entry|
2027
+ # '>' �ǻϤޤ륳���ȹԤ����Ƥ�ʹԾ���������ɸ�२�顼���Ϥ�ɽ��
2028
+ $stderr.puts "Searching ... " + entry.definition
2029
+
2030
+ # FASTA �ˤ����Ʊ��������¹ԡ���̤� Fasta::Report ���֥�������
2031
+ report = factory.query(entry)
2032
+
2033
+ # �ҥåȤ�����Τ��줾����Ф�
2034
+ report.each do |hit|
2035
+ # evalue �� 0.0001 �ʲ��ξ��
2036
+ if hit.evalue < 0.0001
2037
+ # ���� evalue �ȡ�̾���������С���å��ΰ��ɽ��
2038
+ print "#{hit.query_id} : evalue #{hit.evalue}\t#{hit.target_id} at "
2039
+ p hit.lap_at
2040
+ end
2041
+ end
2042
+ end
2043
+
2044
+ ������ factory �Ϸ����֤� FASTA ��¹Ԥ��뤿��ˡ����餫�����äƤ���
2045
+ �¹ԴĶ��Ǥ���
2046
+
2047
+ �嵭�Υ�����ץȤ� search.rb �Ȥ���ȡ��䤤��碌����ȥǡ����١��������
2048
+ �ե�����̾������ˤ��ơ��ʲ��Τ褦�˼¹Ԥ��ޤ���
2049
+
2050
+ % ruby search.rb query.pep target.pep > search.out
2051
+
2052
+ FASTA ���ޥ�ɤ˥��ץ�����Ϳ��������硢�����ܤΰ����� FASTA ��
2053
+ ���ޥ�ɥ饤�󥪥ץ�����񤤤��Ϥ��ޤ�����������ktup �ͤ�����
2054
+ �᥽�åɤ�Ȥäƻ��ꤹ�뤳�ȤˤʤäƤ��ޤ���
2055
+ ���Ȥ��� ktup �ͤ� 1 �ˤ��ơ��ȥå� 10 �̰���ΥҥåȤ��������
2056
+ ���ץ����ϡ��ʲ��Τ褦�ˤʤ�ޤ���
2057
+
2058
+ factory = Bio::Fasta.local('fasta34', 'target.pep', '-b 10')
2059
+ factory.ktup = 1
2060
+
2061
+ Bio::Fasta#query �᥽�åɤʤɤ��֤��ͤ� Bio::Fasta::Report ���֥�������
2062
+ �Ǥ������� Report ���֥������Ȥ��顢�͡��ʥ᥽�åɤ� FASTA �ν��Ϸ�̤�
2063
+ �ۤ����Ƥ�ͳ�˼��Ф���褦�ˤʤäƤ��ޤ������Ȥ��С��ҥåȤ˴ؤ���
2064
+ �������ʤɤμ�ʾ���ϡ�
2065
+
2066
+ report.each do |hit|
2067
+ puts hit.evalue # E-value
2068
+ puts hit.sw # Smith-Waterman ������ (*)
2069
+ puts hit.identity # % identity
2070
+ puts hit.overlap # �����С���åפ��Ƥ����ΰ��Ĺ��
2071
+ puts hit.query_id # �䤤��碌����� ID
2072
+ puts hit.query_def # �䤤��碌����Υ�����
2073
+ puts hit.query_len # �䤤��碌�����Ĺ��
2074
+ puts hit.query_seq # �䤤��碌����
2075
+ puts hit.target_id # �ҥåȤ�������� ID
2076
+ puts hit.target_def # �ҥåȤ�������Υ�����
2077
+ puts hit.target_len # �ҥåȤ��������Ĺ��
2078
+ puts hit.target_seq # �ҥåȤ�������
2079
+ puts hit.query_start # ��Ʊ�ΰ���䤤��碌����Ǥγ��ϻĴ����
2080
+ puts hit.query_end # ��Ʊ�ΰ���䤤��碌����Ǥν�λ�Ĵ����
2081
+ puts hit.target_start # ��Ʊ�ΰ�Υ������å�����Ǥγ��ϻĴ����
2082
+ puts hit.target_end # ��Ʊ�ΰ�Υ������å�����Ǥν�λ�Ĵ����
2083
+ puts hit.lap_at # �嵭�����֤ο��ͤ�����
2084
+ end
2085
+
2086
+ �ʤɤΥ᥽�åɤǸƤӽФ��ޤ��������Υ᥽�åɤ�¿���ϸ����������
2087
+ Bio::Blast::Report ���饹�ȶ��̤ˤ��Ƥ���ޤ����嵭�ʳ��Υ᥽�åɤ�
2088
+ FASTA ��ͭ���ͤ���Ф��᥽�åɤ�ɬ�פʾ��ϡ�Bio::Fasta::Report
2089
+ ���饹�Υɥ�����Ȥ򻲾Ȥ��Ƥ���������
2090
+
2091
+ �⤷���ѡ����������μ��ä��Ƥ��ʤ� fasta ���ޥ�ɤμ¹Է�̤�ɬ�פ�
2092
+ ���ˤϡ�
2093
+
2094
+ report = factory.query(entry)
2095
+ puts factory.output
2096
+
2097
+ �Τ褦�ˡ�query �᥽�åɤ�¹Ԥ������ factory ���֥������Ȥ� output
2098
+ �᥽�åɤ�ȤäƼ��Ф����Ȥ��Ǥ��ޤ���
2099
+
2100
+
2101
+ === ��⡼�Ȥξ��
2102
+
2103
+ ���ΤȤ��� GenomeNet (fasta.genome.jp) �Ǥθ����Τߥ��ݡ��Ȥ��Ƥ��ޤ���
2104
+ ��⡼�Ȥξ��ϻ��Ѳ�ǽ�ʸ����оݥǡ����١�������ޤäƤ��ޤ����������
2105
+ �������ˤĤ��Ƥ� Bio::Fasta.remote �� Bio::Fasta.local ��Ʊ���褦�˻Ȥ�
2106
+ ���Ȥ��Ǥ��ޤ���
2107
+
2108
+ GenomeNet �ǻ��Ѳ�ǽ�ʸ����оݥǡ����١�����
2109
+
2110
+ * ���ߥλ�����ǡ����١���
2111
+ * nr-aa, genes, vgenes.pep, swissprot, swissprot-upd, pir, prf, pdbstr
2112
+
2113
+ * ��������ǡ����١���
2114
+ * nr-nt, genbank-nonst, gbnonst-upd, dbest, dbgss, htgs, dbsts,
2115
+ embl-nonst, embnonst-upd, genes-nt, genome, vgenes.nuc
2116
+
2117
+ �ޤ��������椫�鸡���������ǡ����١��������򤷤ޤ����䤤��碌����μ���
2118
+ �ȸ�������ǡ����١����μ���ˤ�äƥץ������Ϸ�ޤ�ޤ���
2119
+
2120
+ * �䤤��碌���󤬥��ߥλ��ΤȤ�
2121
+ * �оݥǡ����١��������ߥλ�����ǡ����١����ξ�硢program �� 'fasta'
2122
+ * �оݥǡ����١������˻�����ǡ����١����ξ�硢program �� 'tfasta'
2123
+
2124
+ * �䤤��碌���󤬳˻�����ΤȤ�
2125
+ * �оݥǡ����١������˻�����ǡ����١����ξ�硢program �� 'fasta'
2126
+ * (�оݥǡ����١��������ߥλ�����ǡ����١����ξ��ϸ�����ǽ?)
2127
+
2128
+ �ץ������ȥǡ����١������Ȥ߹礻����ޤä���
2129
+
2130
+ program = 'fasta'
2131
+ database = 'genes'
2132
+
2133
+ factory = Bio::Fasta.remote(program, database)
2134
+
2135
+ �Ȥ��ƥե����ȥ꡼���ꡢ��������ξ���Ʊ���褦�� factory.query �ʤ�
2136
+ �Υ᥽�åɤǸ�����¹Ԥ��ޤ���
2137
+
2138
+
2139
+ == BLAST �ˤ����Ʊ��������Ԥ���Bio::Blast ���饹��
2140
+
2141
+ BLAST ���������� GenomeNet (blast.genome.jp) �Ǥθ����򥵥ݡ��Ȥ���
2142
+ ���ޤ����Ǥ������ Bio::Fasta �� API ���̤ˤ��Ƥ��ޤ��Τǡ��嵭�����
2143
+ Bio::Blast �Ƚ񤭴����������Ǥ�����פʾ�礬¿���Ǥ���
2144
+
2145
+ ���Ȥ��С���� f_search.rb ��
2146
+
2147
+ # BLAST ��¹Ԥ���Ķ����֥������Ȥ���
2148
+ factory = Bio::Blast.local('blastp', ARGV.pop)
2149
+
2150
+ ���ѹ����������Ʊ���褦�˼¹ԤǤ��ޤ���
2151
+
2152
+ Ʊ�ͤˡ�GenomeNet ����Ѥ���BLAST��Ԥ����ˤ� Bio::Blast.remote ��Ȥ��ޤ���
2153
+ ���ξ�硢program�λ������Ƥ� FASTA �Ȱۤʤ�ޤ���
2154
+
2155
+ * �䤤��碌���󤬥��ߥλ��ΤȤ�
2156
+ * �оݥǡ����١��������ߥλ�����ǡ����١����ξ�硢program �� 'blastp'
2157
+ * �оݥǡ����١������˻�����ǡ����١����ξ�硢program �� 'tblastn'
2158
+
2159
+ * �䤤��碌���󤬱�������ΤȤ�
2160
+ * �оݥǡ����١��������ߥλ�����ǡ����١����ξ�硢program �� 'blastx'
2161
+ * �оݥǡ����١�������������ǡ����١����ξ�硢program �� 'blastn'
2162
+ * (�䤤��碌���ǡ����١�������6�ե졼��������Ԥ����� 'tblastx')
2163
+
2164
+ �򤽤줾����ꤷ�ޤ���
2165
+
2166
+ �Ȥ����ǡ�BLAST �Ǥ� "-m 7" ���ץ����ˤ�� XML ���ϥե����ޥååȤ�����
2167
+ ���������˭�٤ʤ��ᡢBio::Blast �� Ruby �Ѥ� XML �饤�֥��Ǥ���
2168
+ XMLParser �ޤ��� REXML �����Ѳ�ǽ�ʾ��ϡ�XML ���Ϥ����Ѥ��ޤ���
2169
+ ξ�����Ѳ�ǽ�ʾ�硢XMLParser �Τۤ�����®�ʤΤ�ͥ��Ū�˻��Ѥ���ޤ���
2170
+ �ʤ���Ruby 1.8.0 �ʹߤǤ� REXML �� Ruby ���Τ�ɸ��ź�դ���Ƥ��ޤ���
2171
+ �⤷ XML �饤�֥�꤬���󥹥ȡ��뤵��Ƥ��ʤ����� "-m 8" �Υ��ֶ��ڤ��
2172
+ ���Ϸ����򰷤��褦�ˤ��Ƥ��ޤ��������������Υե����ޥåȤǤ�������
2173
+ �ǡ������¤���Τǡ�"-m 7" �� XML �����ν��Ϥ�Ȥ����Ȥ򤪴��ᤷ�ޤ���
2174
+
2175
+ ���Ǥ˸����褦�� Bio::Fasta::Report �� Bio::Blast::Report �� Hit ���֥���
2176
+ ���ȤϤ����Ĥ����̤Υ᥽�åɤ���äƤ��ޤ���BLAST ��ͭ�Υ᥽�åɤ��ɤ���
2177
+ �������ʤ�Τˤ� bit_score �� midline �ʤɤ�����ޤ���
2178
+
2179
+ report.each do |hit|
2180
+ puts hit.bit_score # bit ������ (*)
2181
+ puts hit.query_seq # �䤤��碌����
2182
+ puts hit.midline # ���饤���Ȥ� midline ʸ���� (*)
2183
+ puts hit.target_seq # �ҥåȤ�������
2184
+
2185
+ puts hit.evalue # E-value
2186
+ puts hit.identity # % identity
2187
+ puts hit.overlap # �����С���åפ��Ƥ����ΰ��Ĺ��
2188
+ puts hit.query_id # �䤤��碌����� ID
2189
+ puts hit.query_def # �䤤��碌����Υ�����
2190
+ puts hit.query_len # �䤤��碌�����Ĺ��
2191
+ puts hit.target_id # �ҥåȤ�������� ID
2192
+ puts hit.target_def # �ҥåȤ�������Υ�����
2193
+ puts hit.target_len # �ҥåȤ��������Ĺ��
2194
+ puts hit.query_start # ��Ʊ�ΰ���䤤��碌����Ǥγ��ϻĴ����
2195
+ puts hit.query_end # ��Ʊ�ΰ���䤤��碌����Ǥν�λ�Ĵ����
2196
+ puts hit.target_start # ��Ʊ�ΰ�Υ������å�����Ǥγ��ϻĴ����
2197
+ puts hit.target_end # ��Ʊ�ΰ�Υ������å�����Ǥν�λ�Ĵ����
2198
+ puts hit.lap_at # �嵭�����֤ο��ͤ�����
2199
+ end
2200
+
2201
+ FASTA�Ȥ�API���̲��Τ���ȴ��ؤΤ��ᡢ�������ʤɤ����Ĥ��ξ����1���ܤ�
2202
+ Hsp (High-scoring segment pair) ���ͤ�Hit���֤��褦�ˤ��Ƥ��ޤ���
2203
+
2204
+ Bio::Blast::Report ���֥������Ȥϡ��ʲ��˼����褦�ʡ�BLAST�η�̽��Ϥ�
2205
+ �ǡ�����¤�򤽤Τޤ�ȿ�Ǥ�������Ū�ʥǡ�����¤����äƤ��ޤ�������Ū�ˤ�
2206
+
2207
+ * Bio::Blast::Report ���֥������Ȥ� @iteratinos ��
2208
+ * Bio::Blast::Report::Iteration ���֥������Ȥ� Array �����äƤ���
2209
+ Bio::Blast::Report::Iteration ���֥������Ȥ� @hits ��
2210
+ * Bio::Blast::Report::Hits ���֥������Ȥ� Array �����äƤ���
2211
+ Bio::Blast::Report::Hits ���֥������Ȥ� @hsps ��
2212
+ * Bio::Blast::Report::Hsp ���֥������Ȥ� Array �����äƤ���
2213
+
2214
+ �Ȥ������ع�¤�ˤʤäƤ��ꡢ���줾�줬�������ͤ���Ф�����Υ᥽�åɤ�
2215
+ ���äƤ��ޤ��������Υ᥽�åɤξܺ٤䡢BLAST �¹Ԥ����׾���ʤɤ��ͤ�
2216
+ ɬ�פʾ��ˤϡ� bio/appl/blast/*.rb ��Υɥ�����Ȥ�ƥ��ȥ����ɤ�
2217
+ ���Ȥ��Ƥ���������
2218
+
2219
+
2220
+ === ��¸�� BLAST ���ϥե������ѡ�������
2221
+
2222
+ BLAST ��¹Ԥ�����̥ե����뤬���Ǥ���¸���Ƥ��äơ��������Ϥ��������
2223
+ �ˤϡ�Bio::Blast ���֥������Ȥ��餺�ˡ� Bio::Blast::Report ���֥�����
2224
+ �Ȥ��ꤿ�����Ȥ������Ȥˤʤ�ޤ�������ˤ� Bio::Blast.reports �᥽�å�
2225
+ ��Ȥ��ޤ����б����Ƥ���Τ� �ǥե���Ƚ��ϥե����ޥå�("-m 0") �ޤ���
2226
+ "-m 7" ���ץ����� XML �ե����ޥåȽ��ϤǤ���
2227
+
2228
+ #!/usr/bin/env ruby
2229
+
2230
+ require 'bio'
2231
+
2232
+ # BLAST���Ϥ��˥ѡ������� Bio::Blast::Report ���֥������Ȥ��֤�
2233
+ Bio::Blast.reports(ARGF) do |report|
2234
+ puts "Hits for " + report.query_def + " against " + report.db
2235
+ report.each do |hit|
2236
+ print hit.target_id, "\t", hit.evalue, "\n" if hit.evalue < 0.001
2237
+ end
2238
+ end
2239
+
2240
+ �Τ褦�ʥ�����ץ� hits_under_0.001.rb ��񤤤ơ�
2241
+
2242
+ % ./hits_under_0.001.rb *.xml
2243
+
2244
+ �ʤɤȼ¹Ԥ���С�������Ϳ���� BLAST �η�̥ե����� *.xml ����֤˽�����
2245
+ ���ޤ���
2246
+
2247
+ Blast �ΥС������� OS �ʤɤˤ�äƽ��Ϥ���� XML �η������ۤʤ��ǽ��
2248
+ �����ꡢ���� XML �Υѡ��������ޤ��Ȥ��ʤ����Ȥ�����褦�Ǥ������ξ���
2249
+ Blast 2.2.5 �ʹߤΥС������򥤥󥹥ȡ��뤹�뤫 -D �� -m �ʤɤΥ��ץ���
2250
+ ����Ȥ߹礻���Ѥ��ƻ�ƤߤƤ���������
2251
+
2252
+
2253
+ === ��⡼�ȸ��������Ȥ��ɲä���ˤ�
2254
+
2255
+ ��: ���Υ��������Ͼ��桼�������Ǥ�����ǽ�Ǥ���� SOAP �ʤɤˤ��
2256
+ �����֥����ӥ������Ѥ��������褤�Ǥ��礦��
2257
+
2258
+ Blast ������ NCBI ��Ϥ����͡��ʥ����Ȥǥ����ӥ�����Ƥ��ޤ��������ΤȤ�
2259
+ �� BioRuby �Ǥ� GenomeNet �ʳ��ˤ��б����Ƥ��ޤ��󡣤����Υ����Ȥϡ�
2260
+
2261
+ * CGI ��ƤӽФ��ʥ��ޥ�ɥ饤�󥪥ץ����Ϥ��Υ������Ѥ˽��������
2262
+ * -m 8 �ʤ� BioRuby ���ѡ�������äƤ�����ϥե����ޥåȤ� blast ��
2263
+ ���Ϥ���Ф�
2264
+
2265
+ ���Ȥ����Ǥ���С�query �������äƸ�����̤� Bio::Blast::Report.new ��
2266
+ �Ϥ��褦�ʥ᥽�åɤ������������ǻȤ���褦�ˤʤ�ޤ�������Ū�ˤϡ�����
2267
+ �᥽�åɤ��exec_������̾�פΤ褦��̾���� Bio::Blast �� private �᥽�å�
2268
+ �Ȥ�����Ͽ����ȡ������ܤΰ����ˡ֥�����̾�פ���ꤷ��
2269
+
2270
+ factory = Bio::Blast.remote(program, db, option, '������̾')
2271
+
2272
+ �Τ褦�˸ƤӽФ���褦�ˤʤäƤ��ޤ������������� BioRuby �ץ��������Ȥ�
2273
+ �����äƤ�館��м����ޤ���ĺ���ޤ���
2274
+
2275
+
2276
+ == PubMed ������ư���ʸ���ꥹ�Ȥ��� (Bio::PubMed ���饹)
2277
+
2278
+ ���ϡ�NCBI ��ʸ���ǡ����١��� PubMed �򸡺����ư���ʸ���ꥹ�Ȥ����������Ǥ���
2279
+
2280
+ #!/usr/bin/env ruby
2281
+
2282
+ require 'bio'
2283
+
2284
+ ARGV.each do |id|
2285
+ entry = Bio::PubMed.query(id) # PubMed ��������륯�饹�᥽�å�
2286
+ medline = Bio::MEDLINE.new(entry) # Bio::MEDLINE ���֥�������
2287
+ reference = medline.reference # Bio::Reference ���֥�������
2288
+ puts reference.bibtex # BibTeX �ե����ޥåȤǽ���
2289
+ end
2290
+
2291
+ ���Υ�����ץȤ� pmfetch.rb �ʤɹ�����̾������¸����
2292
+
2293
+ % ./pmfetch.rb 11024183 10592278 10592173
2294
+
2295
+ �ʤɰ��Ѥ�������ʸ�� PubMed ID (PMID) ��������¤٤�� NCBI �˥���������
2296
+ �� MEDLINE �ե����ޥåȤ�ѡ����� BibTeX �ե����ޥåȤ��Ѵ����ƽ��Ϥ���
2297
+ �����Ϥ��Ǥ���
2298
+
2299
+ ¾�ˡ�������ɤǸ������뵡ǽ�⤢��ޤ���
2300
+
2301
+ #!/usr/bin/env ruby
2302
+
2303
+ require 'bio'
2304
+
2305
+ # ���ޥ�ɥ饤���Ϳ����������ɤΥꥹ�Ȥ򣱤Ĥ�ʸ����ˤ���
2306
+ keywords = ARGV.join(' ')
2307
+
2308
+ # PubMed �򥭡���ɤǸ���
2309
+ entries = Bio::PubMed.search(keywords)
2310
+
2311
+ entries.each do |entry|
2312
+ medline = Bio::MEDLINE.new(entry) # Bio::MEDLINE ���֥�������
2313
+ reference = medline.reference # Bio::Reference ���֥�������
2314
+ puts reference.bibtex # BibTeX �ե����ޥåȤǽ���
2315
+ end
2316
+
2317
+ ���Υ�����ץȤ� pmsearch.rb �ʤɹ�����̾������¸��
2318
+
2319
+ % ./pmsearch.rb genome bioinformatics
2320
+
2321
+ �ʤɸ���������������ɤ�������¤٤Ƽ¹Ԥ���ȡ�PubMed �򥭡����
2322
+ �������ƥҥåȤ�����ʸ�Υꥹ�Ȥ� BibTeX �ե����ޥåȤǽ��Ϥ��ޤ���
2323
+
2324
+ �Ƕ�Ǥϡ�NCBI �� E-Utils �Ȥ��������֥��ץꥱ��������Ȥ����Ȥ�
2325
+ �侩����Ƥ���Τǡ������ Bio::PubMed.esearch �᥽�åɤ����
2326
+ Bio::PubMed.efetch �᥽�åɤ�Ȥ������ɤ��Ǥ��礦��
2327
+
2328
+ #!/usr/bin/env ruby
2329
+
2330
+ require 'bio'
2331
+
2332
+ keywords = ARGV.join(' ')
2333
+
2334
+ options = {
2335
+ 'maxdate' => '2003/05/31',
2336
+ 'retmax' => 1000,
2337
+ }
2338
+
2339
+ entries = Bio::PubMed.esearch(keywords, options)
2340
+
2341
+ Bio::PubMed.efetch(entries).each do |entry|
2342
+ medline = Bio::MEDLINE.new(entry)
2343
+ reference = medline.reference
2344
+ puts reference.bibtex
2345
+ end
2346
+
2347
+ ���Υ�����ץȤǤϡ��嵭�� pmsearch.rb �Ȥۤ�Ʊ���褦��ư���ޤ�������ˡ�
2348
+ NCBI E-Utils ����Ѥ��뤳�Ȥˤ�ꡢ�����оݤ����դ����ҥåȷ���ʤɤ�
2349
+ ����Ǥ���褦�ˤʤäƤ���Τǡ����ⵡǽ�Ǥ������ץ�����Ϳ������
2350
+ �����ˤĤ��Ƥ� ((<E-Utils �Υإ�ץڡ���|URL:http://eutils.ncbi.nlm.nih.gov/entrez/query/static/eutils_help.html>)) �򻲾Ȥ��Ƥ���������
2351
+
2352
+ ���ʤߤˡ������Ǥ� bibtex �᥽�åɤ� BibTeX �ե����ޥåȤ��Ѵ����Ƥ��ޤ�
2353
+ ������ҤΤ褦�� bibitem �᥽�åɤ�Ȥ���¾���ʶ�Ĵ�䥤����å��ʤ�
2354
+ ʸ���ν����ϤǤ��ޤ��󤬡�nature �᥽�åɤ� nar �ʤɡ������Ĥ��λ����
2355
+ �ե����ޥåȤˤ��б����Ƥ��ޤ���
2356
+
2357
+ === BibTeX �λȤ����Υ��
2358
+
2359
+ �嵭����ǽ��᤿ BibTeX �ե����ޥåȤΥꥹ�Ȥ� TeX �ǻȤ���ˡ���ñ�ˤ�
2360
+ �Ȥ�Ƥ����ޤ������Ѥ�������ʸ����
2361
+
2362
+ % ./pmfetch.rb 10592173 >> genoinfo.bib
2363
+ % ./pmsearch.rb genome bioinformatics >> genoinfo.bib
2364
+
2365
+ �ʤɤȤ��� genoinfo.bib �ե�����˽������¸���Ƥ�����
2366
+
2367
+ \documentclass{jarticle}
2368
+ \begin{document}
2369
+ \bibliographystyle{plain}
2370
+ �ۤˤ��� KEGG �ǡ����١���~\cite{PMID:10592173}�Ϥդ��ۤ��Ǥ��롣
2371
+ \bibliography{genoinfo}
2372
+ \end{document}
2373
+
2374
+ �Ȥ����ե����� hoge.tex ��񤤤ơ�
2375
+
2376
+ % platex hoge
2377
+ % bibtex hoge # �� genoinfo.bib ���
2378
+ % platex hoge # �� ʸ���ꥹ�Ȥκ���
2379
+ % platex hoge # �� ʸ���ֹ�
2380
+
2381
+ �Ȥ����̵�� hoge.dvi ���Ǥ�������ޤ���
2382
+
2383
+ === bibitem �λȤ����Υ��
2384
+
2385
+ ʸ���Ѥ��̤� .bib �ե�������ꤿ���ʤ����� Reference#bibitem �᥽��
2386
+ �ɤν��Ϥ�Ȥ��ޤ����嵭�� pmfetch.rb �� pmsearch.rb ��
2387
+
2388
+ puts reference.bibtex
2389
+
2390
+ �ιԤ�
2391
+
2392
+ puts reference.bibitem
2393
+
2394
+ �˽񤭴�����ʤɤ��ơ����Ϸ�̤�
2395
+
2396
+ \documentclass{jarticle}
2397
+ \begin{document}
2398
+ �ۤˤ��� KEGG �ǡ����١���~\cite{PMID:10592173}�Ϥդ��ۤ��Ǥ��롣
2399
+
2400
+ \begin{thebibliography}{00}
2401
+
2402
+ \bibitem{PMID:10592173}
2403
+ Kanehisa, M., Goto, S.
2404
+ KEGG: kyoto encyclopedia of genes and genomes.,
2405
+ {\em Nucleic Acids Res}, 28(1):27--30, 2000.
2406
+
2407
+ \end{thebibliography}
2408
+ \end{document}
2409
+
2410
+ �Τ褦�� \begin{thebibliography} �ǰϤߤޤ�������� hoge.tex �Ȥ����
2411
+
2412
+ % platex hoge # �� ʸ���ꥹ�Ȥκ���
2413
+ % platex hoge # �� ʸ���ֹ�
2414
+
2415
+ �ȣ����������ФǤ�������Ǥ���
2416
+
2417
+
2418
+ = OBDA
2419
+
2420
+ OBDA (Open Bio Database Access) �Ȥϡ�Open Bioinformatics Foundation
2421
+ �ˤ�ä����ꤵ�줿������ǡ����١����ؤζ��̥���������ˡ�Ǥ�������ϡ�
2422
+ 2002 ǯ��1���2��� Arizona �� Cape Town �ˤƳ��Ť��줿 BioHackathon
2423
+ �ˤ����ơ�BioPerl, BioJava, BioPython, BioRuby �ʤɤγƥץ��������Ȥ�
2424
+ ���С������ä��ƺ�������ޤ�����
2425
+
2426
+ * BioRegistry (Directory)
2427
+ * �ǡ����١�����������ɤ��ˤɤΤ褦�˼��˹Ԥ�������ꤹ����Ȥ�
2428
+
2429
+ * BioFlat
2430
+ * �ե�åȥե������ 2 ʬ�ڤޤ��� BDB ��Ȥä�����ǥå�������
2431
+
2432
+ * BioFetch
2433
+ * HTTP ��ͳ�ǥǡ����١������饨��ȥ��������륵���Фȥ��饤�����
2434
+
2435
+ * BioSQL
2436
+ * MySQL �� PostgreSQL �ʤɤδط��ǡ����١���������ǡ������Ǽ����
2437
+ ����� schema �ȡ�����ȥ����Ф�����Υ᥽�å�
2438
+
2439
+ �ܺ٤� ((<URL:http://obda.open-bio.org/>)) �򻲾Ȥ��Ƥ���������
2440
+ ���줾��λ��ͽ�� cvs.open-bio.org �� CVS��ݥ��ȥ���֤��Ƥ���ޤ���
2441
+ �ޤ��ϡ�((<URL:http://cvs.open-bio.org/cgi-bin/viewcvs/viewcvs.cgi/obda-specs/?cvsroot=obf-common>)) ���黲�ȤǤ��ޤ���
2442
+
2443
+
2444
+ == BioRegistry
2445
+
2446
+ BioRegistry�Ȥϡ�����ե�����ˤ�äƳƥǡ����١����Υ���ȥ������ˡ��
2447
+ ���ꤹ�뤳�Ȥˤ�ꡢ�ɤ����ˡ��ȤäƤ��뤫��ۤȤ�ɰռ������ǡ�����
2448
+ �������뤳�Ȥ��ǽ�Ȥ��뤿��λ��ȤߤǤ���
2449
+ ����ե������ͥ���̤�
2450
+
2451
+ * (�᥽�åɤΥѥ�᡼����)���ꤷ���ե�����
2452
+ * ~/.bioinformatics/seqdatabase.ini
2453
+ * /etc/bioinformatics/seqdatabase.ini
2454
+ * http://www.open-bio.org/registry/seqdatabase.ini
2455
+
2456
+ �Ǹ�� open-bio.org ������ϡ��������������ե����뤬���Ĥ���ʤ�����
2457
+ �������Ȥ��ޤ���
2458
+
2459
+ BioRuby �θ��ߤμ����Ǥϡ����٤ƤΥ������������ե�������ɤ߹��ߡ�
2460
+ Ʊ��̾�������꤬ʣ��¸�ߤ������ϡ��ǽ�˸��Ĥ��ä�������������Ѥ���ޤ���
2461
+ ��������Ѥ���ȡ����Ȥ��С������ƥ�����Ԥ� /etc/bioinformatics/ ���֤���
2462
+ ����Τ����Ŀ�Ū���ѹ���������Τ��� ~/.bioinformatics/ �Ǿ�񤭤��뤳�Ȥ�
2463
+ �Ǥ��ޤ�������ץ�� seqdatabase.ini �ե����뤬 bioruby �Υ������˴ޤޤ��
2464
+ ���ޤ��Τǻ��Ȥ��Ƥ���������
2465
+
2466
+ ����ե��������Ȥ� stanza �ե����ޥåȤȸƤФ��񼰤ǵ��Ҥ��ޤ���
2467
+
2468
+ [�ǡ����١���̾]
2469
+ protocol=�ץ��ȥ���̾
2470
+ location=������̾
2471
+
2472
+ ���Τ褦�ʥ���ȥ��ƥǡ����١����ˤĤ��Ƶ��Ҥ��뤳�Ȥˤʤ�ޤ���
2473
+ �ǡ����١���̾�ϡ���ʬ�����Ѥ��뤿��Υ�٥�ʤΤ�ʬ����䤹����Τ�
2474
+ �Ĥ�����ɤ����ºݤΥǡ����١�����̾���ȰۤʤäƤ��Ƥ⹽��ʤ��褦�Ǥ���
2475
+ Ʊ��̾���Υǡ����١�����ʣ������Ȥ��Ϻǽ�˽񤫤�Ƥ����Τ�����
2476
+ ��³���褦�˻��ͽ�Ǥ���Ƥ���Ƥ��ޤ��������ΤȤ��� BioRuby �Ǥ�
2477
+ ����ˤ��б����Ƥ��ޤ���
2478
+
2479
+ �ޤ����ץ��ȥ���μ���ˤ�äƤ� location �ʳ��ˤ��MySQL �Υ桼��̾�ʤɡ�
2480
+ �ɲäΥ��ץ����򵭽Ҥ���ɬ�פ�����ޤ������ߤΤȤ��������ͽ�ǵ��ꤵ��
2481
+ �Ƥ��� protocol �Ȥ��Ƥϰʲ��Τ�Τ�����ޤ���
2482
+
2483
+ * index-flat
2484
+ * index-berkeleydb
2485
+ * biofetch
2486
+ * biosql
2487
+ * bsane-corba
2488
+ * xembl
2489
+
2490
+ ���ΤȤ��� BioRuby �ǻ��Ѳ�ǽ�ʤΤ� index-flat, index-berkleydb, biofetch
2491
+ �� biosql �����Ǥ����ޤ���BioRegistry��ƥץ��ȥ���λ��ͤ��ѹ�����뤳��
2492
+ ������ޤ�����BioRuby�Ϥ�����ɽ��Ǥ��Ƥ��ʤ����⤷��ޤ���
2493
+
2494
+ BioRegistry ��Ȥ��ˤϡ��ޤ� Bio::Registry���֥������Ȥ�������ޤ���
2495
+ ����ȡ�����ե����뤬�ɤ߹��ޤ�ޤ���
2496
+
2497
+ reg = Bio::Registry.new
2498
+
2499
+ # ����ե�����˽񤤤��ǡ����١���̾�ǥ����Ф���³
2500
+ serv = reg.get_database('genbank')
2501
+
2502
+ # ID ����ꤷ�ƥ���ȥ�����
2503
+ entry = serv.get_by_id('AA2CG')
2504
+
2505
+ ������ serv ������ե������ [genbank] ����ǻ��ꤷ�� protocol �ץ��ȥ�
2506
+ ����б����륵���Х��֥������Ȥǡ�Bio::SQL �� Bio::Fetch �ʤɤΥ��󥹥�
2507
+ �󥹤��֤äƤ���Ϥ��Ǥ��ʥǡ����١���̾�����Ĥ���ʤ��ä����� nil�ˡ�
2508
+
2509
+ ���Ȥ� OBDA ���̤Υ���ȥ�����᥽�å� get_by_id ��Ƥ���ꡢ�����Х�
2510
+ �֥���������˸�ͭ�Υ᥽�åɤ�Ƥ֤��Ȥˤʤ�ޤ��Τǡ��ʲ��� BioFetch ��
2511
+ BioSQL �β���򻲾Ȥ��Ƥ���������
2512
+
2513
+
2514
+ == BioFlat
2515
+
2516
+ BioFlat �ϥե�åȥե�������Ф��ƥ���ǥå����������������ȥ���®��
2517
+ ���Ф����ȤߤǤ�������ǥå����μ���ϡ�RUby�γ�ĥ�饤�֥��˰�¸���ʤ�
2518
+ index-flat �� Berkeley DB (bdb) ��Ȥä� index-berkeleydb ��2���ब¸��
2519
+ ���ޤ����ʤ���index-berkeleydb ����Ѥ���ˤϡ�BDB �Ȥ��� Ruby �γ�ĥ
2520
+ �饤�֥������ӥ��󥹥ȡ��뤹��ɬ�פ�����ޤ�������ǥå����κ����ˤ�
2521
+ bioruby �ѥå���������°���� br_bioflat.rb ���ޥ�ɤ�Ȥäơ�
2522
+
2523
+ % br_bioflat.rb --makeindex �ǡ����١���̾ [--format ���饹̾] �ե�����̾
2524
+
2525
+ �Τ褦�ˤ��ޤ���BioRuby�ϥǡ����ե����ޥåȤμ�ưǧ����ǽ����ܤ��Ƥ���
2526
+ �Τ� --format ���ץ����Ͼ�ά��ǽ�Ǥ��������줦�ޤ�ǧ�����ʤ��ä�����
2527
+ BioRuby �γƥǡ����١����Υ��饹̾����ꤷ�Ƥ��������������ϡ�
2528
+
2529
+ % bioflat �ǡ����١���̾ ����ȥ�ID
2530
+
2531
+ �Ȥ��ޤ�������Ū�� GenBank �� gbbct*.seq �ե�����˥���ǥå����������
2532
+ �Ƹ��������硢
2533
+
2534
+ % bioflat --makeindex my_bctdb --format GenBank gbbct*.seq
2535
+ % bioflat my_bctdb A16STM262
2536
+
2537
+ �Τ褦�ʴ����ˤʤ�ޤ���
2538
+
2539
+ Ruby �� bdb ��ĥ�⥸�塼��(�ܺ٤� http://raa.ruby-lang.org/project/bdb/ ����)
2540
+ �����󥹥ȡ��뤵��Ƥ������ Berkeley DB �����Ѥ��ƥ���ǥå������������
2541
+ ���Ȥ��Ǥ��ޤ������ξ�硢
2542
+
2543
+ % bioflat --makeindex-bdb �ǡ����١���̾ [--format ���饹̾] �ե�����̾
2544
+
2545
+ �Τ褦�� "--makeindex" �Τ����� "--makeindex-bdb" ����ꤷ�ޤ���
2546
+
2547
+
2548
+ == BioFetch
2549
+
2550
+ BioFetch �� CGI ���ͳ���ƥ����Ф���ǡ����١����Υ���ȥ������������
2551
+ �ǡ������Ф�������� CGI �Υ��ץ����̾�����顼�����ɤʤɤ������Ƥ�
2552
+ �ޤ������饤����Ȥ� HTTP ��Ȥäƥǡ����١�����ID���ե����ޥåȤʤɤ��
2553
+ �ꤷ������ȥ��������ޤ���
2554
+
2555
+ BioRuby �ץ��������ȤǤ� GenomeNet �� DBGET �����ƥ��Хå�����ɤȤ���
2556
+ BioFetch �����Ф�������Ƥ��ꡢbioruby.org �DZ��Ѥ��Ƥ��ޤ������Υ����Ф�
2557
+ �����������ɤ� BioRuby �� sample/ �ǥ��쥯�ȥ�����äƤ��ޤ������ߤΤȤ���
2558
+ BioFetch �����ФϤ��� bioruby.org �Τ�Τ� EBI ���󤫽ꤷ������ޤ���
2559
+
2560
+ BioFetch ��Ȥäƥ���ȥ���������ˤϡ������Ĥ�����ˡ������ޤ���
2561
+
2562
+ (1) �����֥֥饦�����鸡��������ˡ�ʰʲ��Υڡ����򳫤���
2563
+
2564
+ http://bioruby.org/cgi-bin/biofetch.rb
2565
+
2566
+ (2) BioRuby��°�� br_biofetch.rb ���ޥ�ɤ��Ѥ�����ˡ
2567
+
2568
+ % br_biofetch.rb db_name entry_id
2569
+
2570
+ (3) ������ץȤ��椫�� Bio::Fetch ���饹��ľ�ܻȤ���ˡ
2571
+
2572
+ serv = Bio::Fetch.new(server_url)
2573
+ entry = serv.fetch(db_name, entry_id)
2574
+
2575
+ (4) ������ץȤ���� BioRegistry ��ͳ�� Bio::Fetch ���饹�����Ū�˻Ȥ���ˡ
2576
+
2577
+ reg = Bio::Registry.new
2578
+ serv = reg.get_database('genbank')
2579
+ entry = serv.get_by_id('AA2CG')
2580
+
2581
+ �⤷ (4) ��Ȥ��������� seqdatabase.ini ��
2582
+
2583
+ [genbank]
2584
+ protocol=biofetch
2585
+ location=http://bioruby.org/cgi-bin/biofetch.rb
2586
+ biodbname=genbank
2587
+
2588
+ �ʤɤȻ��ꤷ�Ƥ���ɬ�פ�����ޤ���
2589
+
2590
+ === BioFetch �� Bio::KEGG::GENES, Bio::AAindex1 ���Ȥ߹�碌����
2591
+
2592
+ ���Υץ������ϡ�BioFetch ��Ȥä� KEGG �� GENES �ǡ����١�������źٶ�
2593
+ Halobacterium �ΥХ��ƥꥢ���ɥץ�������� (VNG1467G) ���äƤ��ơ�Ʊ��
2594
+ �褦�˥��ߥλ���ɸ�ǡ����١����Ǥ��� AAindex ��������������إ�å�����
2595
+ ��ɸ (BURA740101) ��Ȥäơ��� 15 �Ĵ�Υ�����ɥ��������򤹤���Ǥ���
2596
+
2597
+ #!/usr/bin/env ruby
2598
+
2599
+ require 'bio'
2600
+
2601
+ entry = Bio::Fetch.query('hal', 'VNG1467G')
2602
+ aaseq = Bio::KEGG::GENES.new(entry).aaseq
2603
+
2604
+ entry = Bio::Fetch.query('aax1', 'BURA740101')
2605
+ helix = Bio::AAindex1.new(entry).index
2606
+
2607
+ position = 1
2608
+ win_size = 15
2609
+
2610
+ aaseq.window_search(win_size) do |subseq|
2611
+ score = subseq.total(helix)
2612
+ puts [ position, score ].join("\t")
2613
+ position += 1
2614
+ end
2615
+
2616
+ �����ǻȤäƤ��륯�饹�᥽�å� Bio::Fetch.query �ϰ��ۤ� bioruby.org ��
2617
+ BioFetch �����Ф�Ȥ����ѤΥ��硼�ȥ��åȤǤ����ʤ��Υ����Ф�����Ū�ˤ�
2618
+ ���Υ�ͥåȤ���ǡ�����������Ƥ��ޤ���KEGG/GENES �ǡ����١����� hal ��
2619
+ AAindex �ǡ����١��� aax1 �Υ���ȥ�ϡ�¾�� BioFetch �����ФǤϼ����Ǥ�
2620
+ �ʤ����Ȥ⤢�äơ������� query �᥽�åɤ�ȤäƤ��ޤ�����
2621
+
2622
+ == BioSQL
2623
+
2624
+ to be written...
2625
+
2626
+ == BioRuby �Υ���ץ�ץ������λȤ���
2627
+
2628
+ BioRuby �Υѥå������ˤ� samples/ �ǥ��쥯�ȥ�ʲ��ˤ����Ĥ��Υ���ץ��
2629
+ ������ब�ޤޤ�Ƥ��ޤ����Ť���Τ⺮���äƤ��ޤ������̤�ȤƤ⽽ʬ�Ȥ�
2630
+ �����ʤ��Τǡ�����Ū�����򤤥���ץ���󶡤ϴ��ޤǤ���
2631
+
2632
+ to be written...
2633
+
2634
+ == ����ʤ����
2635
+
2636
+ ¾�Υ��塼�ȥꥢ��Ū�ʥɥ�����ȤȤ��Ƥϡ�BioRuby Wiki���֤��Ƥ���
2637
+ BioRuby in Anger ������ޤ���
2638
+
2639
+ =end
2640
+