From: Christopher Dicely Date: 2008-02-23T00:52:33+09:00 Subject: Re: Bioruby-Name error: uninitialized constant I get the same problem if I install with "gem install bioruby" (which installs bioruby 0.6.4). If I do "gem install bio", which installs bioruby 1.2.1, I don't have the problem. (I didn't actually try loading anything, but Bio::Alignment::MultiFastaFormat produces an uninitialized constant error in the first case, and refers to a real class in the second.) On Fri, Feb 22, 2008 at 2:58 AM, Carl Olme wrote: > I'm very new to both programming in general and to programming in Ruby. > > I have tried to write a programme in BioRuby: > > require 'bio' > > fasta = open('../sequence.fasta') > fasta_string = fasta.read > > a = Bio::Alignment::MultiFastaFormat.new(fasta_string).alignment > > a.each_site do|bases_at_site| > puts bases_at_site.join('') > > > When I run the programme in irb, I get the following output: > > irb(main):001:0> require 'bio' > => true > irb(main):002:0> > > irb(main):003:0* fasta = open('../sequence.fasta') > => # > > irb(main):004:0> fasta_string = fasta.read > => ">ref|NT_039674.7|Mm18_39714_37:58262030-58293988 Mus musculus > chromosome 18 genomic contig, strain > C57BL/6J\r\nTTTCTATTTCAGCAGAAAAAAAAAAAGACGACTAGTCTTTGGGTT > #I cut out the rest of the file since it's very long. > > irb(main):005:0> > irb(main):006:0* a = > Bio::Alignment::MultiFastaFormat.new(fasta_string).alignment > NameError: uninitialized constant Bio::Alignment::MultiFastaFormat > from (irb):6 > > irb(main):007:0> > irb(main):008:0* a.each_site do|bases_at_site| > irb(main):009:1* puts bases_at_site.join('') > > The solution is probably very simple, but I have played around with the > code for half a day now and can't get any further. I realise that the > problem is with how I have used Bio::Alignment, but not sure where I > have gone wrong. > -- > Posted via http://www.ruby-forum.com/. > >