You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then ran these commands in irb:
require 'bio-alignment'
require 'bigbio' # for the Fasta reader
include Bio::BioAlignment # Namespace
aln = Alignment.new
fasta = FastaReader.new('short_trial.aln.fasta')
fasta.each do | rec |
aln.sequences << rec
end
aln[3][0]
And at this point I get the error:
irb(main):012:0> aln[3][0]
NoMethodError: undefined method []' for #<FastaRecord:0x0000000251f3e0> from (irb):12 from /usr/bin/irb:12:in
which worked fine. I just wanted to let you know, because in the file doc/bio-alignment-design.md beginning on line 130 there is a code example that appears to do what I was doing above, but would not work.
I'll fix that. Note that it would be trivial to add a def [] method to FastaRecord (you can even add that yourself by just reopening the class definition in your source). The reason I don't add it in the original is that I have the policy to add minimal functionality to modules and classes - so as to keep them simple.
Hi pjotrp,
Was just trying to get some of your examples to work, and I ran into an issue, essentially I used this file 'short_trial.aln.fasta'
Then ran these commands in irb:
require 'bio-alignment'
require 'bigbio' # for the Fasta reader
include Bio::BioAlignment # Namespace
aln = Alignment.new
fasta = FastaReader.new('short_trial.aln.fasta')
fasta.each do | rec |
aln.sequences << rec
end
aln[3][0]
And at this point I get the error:
'irb(main):012:0> aln[3][0]
NoMethodError: undefined method
[]' for #<FastaRecord:0x0000000251f3e0> from (irb):12 from /usr/bin/irb:12:in
irb(main):013:0> aln[3]
=> #<FastaRecord:0x0000000251f3e0 @id="46P47B1/31054-31065", @Descr="46P47B1/31054-31065", @seq="gccaatatcgcc">
Am I messing this up somehow?
~josh
The text was updated successfully, but these errors were encountered: