[BioRuby-cvs] bioruby/lib/bio/db fasta.rb,1.28.2.2,1.28.2.3

Naohisa Goto ngoto at dev.open-bio.org
Fri Jun 20 13:43:38 UTC 2008


Update of /home/repository/bioruby/bioruby/lib/bio/db
In directory dev.open-bio.org:/tmp/cvs-serv21945

Modified Files:
      Tag: BRANCH-biohackathon2008
	fasta.rb 
Log Message:
Bio::FastaFormat#to_seq is renamed to to_biosequence with improvement.
The "to_seq" method is now an alias of to_biosequence.


Index: fasta.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/fasta.rb,v
retrieving revision 1.28.2.2
retrieving revision 1.28.2.3
diff -C2 -d -r1.28.2.2 -r1.28.2.3
*** fasta.rb	20 Jun 2008 13:30:14 -0000	1.28.2.2
--- fasta.rb	20 Jun 2008 13:43:36 -0000	1.28.2.3
***************
*** 28,31 ****
--- 28,32 ----
  require 'bio/db'
  require 'bio/sequence'
+ require 'bio/sequence/dblink'
  require 'bio/db/fasta/defline'
  
***************
*** 217,226 ****
      # because of efficiency.
      # 
!     def to_seq
        seq
        obj = Bio::Sequence.new(@seq)
!       obj.definition = self.definition
        obj
      end
  
      # Parsing FASTA Defline, and extract IDs.
--- 218,243 ----
      # because of efficiency.
      # 
!     def to_biosequence
        seq
        obj = Bio::Sequence.new(@seq)
!       d = self.identifiers
!       # accessions
!       obj.primary_accession = d.accessions.first
!       obj.secondary_accessions = d.accessions[1..-1]
!       # entry_id
!       obj.entry_id = d.locus unless d.locus.to_s.empty?
!       # GI
!       other = []
!       other.push Bio::Sequence::DBLink.new('GI', d.gi) if d.gi
!       obj.other_seqids = other unless other.empty?
!       # definition
!       if d.accessions.empty? and other.empty? then
!         obj.definition = self.definition
!       else
!         obj.definition = d.description
!       end
        obj
      end
+     alias to_seq to_biosequence
  
      # Parsing FASTA Defline, and extract IDs.




More information about the bioruby-cvs mailing list