| Class | Bio::Shell::Demo |
| In: |
lib/bio/shell/demo.rb
|
| Parent: | Object |
# File lib/bio/shell/demo.rb, line 26
26: def initialize
27: @bind = Bio::Shell.cache[:binding]
28: end
# File lib/bio/shell/demo.rb, line 30
30: def all
31: sequence &&
32: entry &&
33: shell &&
34: pdb &&
35: true
36: end
# File lib/bio/shell/demo.rb, line 75
75: def entry
76: run(%q[kuma = getobj("gb:AF237819")], "Obtain an entry from GenBank database", false) &&
77: run(%q[kuma.definition], "Definition of the entry", true) &&
78: run(%q[kuma.naseq], "Sequence of the entry", true) &&
79: run(%q[kuma.naseq.translate], "Translate the sequence to protein", true) &&
80: run(%q[midifile("data/AF237819.mid", kuma.naseq)], "Generate gene music ...", false) &&
81: true
82: end
# File lib/bio/shell/demo.rb, line 44
44: def mito
45: run(%q[entry = getent("data/kumamushi.gb")], "Load kumamushi gene from GenBank database entry ...", false) &&
46: run(%q[disp entry], "Check the contents ...", false) &&
47: run(%q[kuma = flatparse(entry)], "Parse the database entry ...", true) &&
48: run(%q[web], "Start BioRuby on Rails...", false) &&
49: run(%q[puts kuma.entry_id], "Extract entry ID ...", false) &&
50: run(%q[puts kuma.definition], "Extract definition ...", false) &&
51: run(%q[gene = kuma.seq], "Extract DNA sequence of the gene ...", true) &&
52: run(%q[doublehelix(gene)], "Show the sequence in ascii art ...", false) &&
53: run(%q[seqstat(gene)], "Statistics of the gene ...", false) &&
54: run(%q[config :color], "Change to color mode...", false) &&
55: run(%q[seqstat(gene)], "Statistics of the gene ...", false) &&
56: #run(%q[codontable], "Codontalble ...", false) &&
57: run(%q[protein = gene.translate], "Translate DNA into protein ...", true) &&
58: run(%q[comp = protein.composition], "Composition of the amino acids ...", false) &&
59: run(%q[pp comp], "Check the composition ...", false) &&
60: run(%q[puts protein.molecular_weight], "Molecular weight ...", false) &&
61: run(%q[midifile("data/kumamushi.mid", gene)], "Gene to music ...", false) &&
62: run(%q[`open "data/kumamushi.mid"`], "Let's listen ...", false) &&
63: true
64: end
# File lib/bio/shell/demo.rb, line 91
91: def pdb
92: run(%q[ent_1bl8 = getent("pdb:1bl8")], "Retrieving PDB entry 1BL8 ...", false) &&
93: run(%q[head ent_1bl8], "Head part of the entry ...", false) &&
94: run(%q[savefile("1bl8.pdb", ent_1bl8)], "Saving the original entry in file ...", false) &&
95: run(%q[disp "data/1bl8.pdb"], "Look through the entire entry ...", false) &&
96: run(%q[pdb_1bl8 = flatparse(ent_1bl8)], "Parsing the entry ...", false) &&
97: run(%q[pdb_1bl8.entry_id], "Showing the entry ID ...", true) &&
98: run(%q[pdb_1bl8.each_heterogen { |heterogen| p heterogen.resName }], "Showing each heterogen object ...", false) &&
99: true
100: end
# File lib/bio/shell/demo.rb, line 102
102: def pdb_hetdic
103: # run(%q[het_dic = open("http://deposit.pdb.org/het_dictionary.txt").read],
104: # "Retrieving the het_dic database ...", false) &&
105: # run(%q[savefile("data/het_dictionary.txt", het_dic)],
106: # "Saving the file ... ", false) &&
107: run(%q[het_dic.size], "Bytes of the file ...", true) &&
108: run(%q[disp "data/het_dictionary.txt"], "Take a look on the contents ...", true) &&
109: run(%q[flatindex("het_dic", "data/het_dictionary.txt")],
110: "Creating index to make the seaarchable database ...", false) &&
111: run(%q[ethanol = flatsearch("het_dic", "EOH")], "Search an ethanol entry ...", true) &&
112: run(%q[osake = flatparse(ethanol)], "Parse the entry ...", true) &&
113: run(%q[osake.conect], "Showing connect table (conect) of the molecule ...", true) &&
114: true
115: end
# File lib/bio/shell/demo.rb, line 66
66: def sequence
67: run(%q[dna = getseq("atgc" * 100)], "Generating DNA sequence ...", true) &&
68: run(%q[doublehelix dna], "Double helix representation", false) &&
69: run(%q[protein = dna.translate], "Translate DNA into Protein ...", true) &&
70: run(%q[protein.molecular_weight], "Calculating molecular weight ...", true) &&
71: run(%q[protein.composition], "Amino acid composition ...", true) &&
72: true
73: end