[BioRuby-cvs] bioruby/lib/bio/db/genbank genbank.rb,0.40,0.40.2.1

Naohisa Goto ngoto at dev.open-bio.org
Thu Feb 14 08:51:47 UTC 2008


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

Modified Files:
      Tag: BRANCH-biohackathon2008
	genbank.rb 
Log Message:
added new method Bio::GenBank#to_biosequence.


Index: genbank.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/db/genbank/genbank.rb,v
retrieving revision 0.40
retrieving revision 0.40.2.1
diff -C2 -d -r0.40 -r0.40.2.1
*** genbank.rb	5 Apr 2007 23:35:40 -0000	0.40
--- genbank.rb	14 Feb 2008 08:51:45 -0000	0.40.2.1
***************
*** 126,129 ****
--- 126,157 ----
    end
  
+   # converts Bio::GenBank to Bio::Sequence
+   # ---
+   # *Arguments*: 
+   # *Returns*:: Bio::Sequence object
+   def to_biosequence
+     sequence = Bio::Sequence.new(seq)
+     sequence.entry_id = self.entry_id
+ 
+     sequence.primary_accession = self.accession
+     sequence.secondary_accessions = self.accessions - [ self.accession ]
+ 
+     sequence.molecule_type = self.natype
+     sequence.division = self.division
+     sequence.topology = self.circular
+ 
+     sequence.sequence_version = self.version
+     seq.date_created = nil #????
+     sequence.date_modified = self.date
+ 
+     sequence.keywords = self.keywords
+     sequence.species = self.organism
+     sequence.classification = self.taxonomy
+     sequence.organnella = nil # not used
+     sequence.comments = self.comment
+     sequence.references = self.references
+     return sequence
+   end
+ 
  end # GenBank
  end # Bio




More information about the bioruby-cvs mailing list