[BioRuby-cvs] bioruby/test/unit/bio/db test_lasergene.rb,NONE,1.1

Trevor Wennblom trevor at dev.open-bio.org
Mon Jan 8 06:38:41 UTC 2007


Update of /home/repository/bioruby/bioruby/test/unit/bio/db
In directory dev.open-bio.org:/tmp/cvs-serv12129/test/unit/bio/db

Added Files:
	test_lasergene.rb 
Log Message:
Adding Bio::Lasergene file format

--- NEW FILE: test_lasergene.rb ---
#
# test/unit/bio/db/test_rebase.rb - Unit test for Bio::Lasergene
#
# Author::    Trevor Wennblom  <mailto:trevor at corevx.com>
# Copyright:: Copyright (c) 2007 Center for Biomedical Research Informatics, University of Minnesota (http://cbri.umn.edu)
# License::   Distributes under the same terms as Ruby
#
#  $Id: test_lasergene.rb,v 1.1 2007/01/08 06:38:39 trevor Exp $
#

require 'pathname'
libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4, 'lib')).cleanpath.to_s
$:.unshift(libpath) unless $:.include?(libpath)

require 'test/unit'
require 'bio'
require 'bio/db/lasergene'

module Bio #:nodoc:
  class TestLasergene < Test::Unit::TestCase #:nodoc:
    
    def setup
      file_format_1 = <<END
"Contig 1" (1,934)
  Contig Length:                  934 bases
  Average Length/Sequence:        467 bases
  Total Sequence Length:         1869 bases
  Top Strand:                       2 sequences
  Bottom Strand:                    2 sequences
  Total:                            4 sequences
^^
ATGACGTATCCAAAGAGGCGTTACCGGAGAAGAAGACACCGCCCCCGCAGTCCTCTTGGCCAGATCCTCCGCCGCCGCCCCTGGCTCGTCCACCCCCGCCACAGTTACCGCTGGAGAAGGAAAAATGGCATCTTCAWCACCCGCCTATCCCGCAYCTTCGGAWRTACTATCAAGCGAACCACAGTCAGAACGCCCTCCTGGGCGGTGGACATGATGAGATTCAATATTAATGACTTTCTTCCCCCAGGAGGGGGCTCAAACCCCCGCTCTGTGCCCTTTGAATACTACAGAATAAGAAAGGTTAAGGTTGAATTCTGGCCCTGCTCCCCGATCACCCAGGGTGACAGGGGAATGGGCTCCAGTGCTGWTATTCTAGMTGATRRCTTKGTAACAAAGRCCACAGCCCTCACCTATGACCCCTATGTAAACTTCTCCTCCCGCCATACCATAACCCAGCCCTTCTCCTACCRCTCCCGYTACTTTACCCCCAAACCTGTCCTWGATKCCACTATKGATKACTKCCAACCAAACAACAAAAGAAACCAGCTGTGGSTGAGACTACAWACTGCTGGAAATGTAGACCWCGTAGGCCTSGGCACTGCGTKCGAAAACAGTATATACGACCAGGAATACAATATCCGTGTMACCATGTATGTACAATTCAGAGAATTTAATCTTAAAGACCCCCCRCTTMACCCKTAATGAATAATAAMAACCATTACGAAGTGATAAAAWAGWCTCAGTAATTTATTYCATATGGAAATTCWSGGCATGGGGGGGAAAGGGTGACGAACKKGCCCCCTTCCTCCSTSGMYTKTTCYGTAGCATTCYTCCAMAAYACCWAGGCAGYAMTCCTCCSATCAAGAGcYTSYACAGCTGGGACAGCAGTTGAGGAGGACCATTCAAAGGGGGTCGGATTGCTGGTAATCAGA
END

      file_format_2 = <<END
^^:                                  350,935
Contig 1 (1,935)
  Contig Length:                  935 bases
  Average Length/Sequence:        580 bases
  Total Sequence Length:         2323 bases
  Top Strand:                       2 sequences
  Bottom Strand:                    2 sequences
  Total:                            4 sequences
^^
ATGTCGGGGAAATGCTTGACCGCGGGCTACTGCTCATCATTGCTTTCTTTGTGGTATATCGTGCCGTTCTGTTTTGCTGTGCTCGTCAACGCCAGCGGCGACAGCAGCTCTCATTTTCAGTCGATTTATAACTTGACGTTATGTGAGCTGAATGGCACGAACTGGCTGGCAGACAACTTTAACTGGGCTGTGGAGACTTTTGTCATCTTCCCCGTGTTGACTCACATTGTTTCCTATGGTGCACTCACTACCAGTCATTTTCTTGACACAGTTGGTCTAGTTACTGTGTCTACCGCCGGGTTTTATCACGGGCGGTACGTCTTGAGTAGCATCTACGCGGTCTGTGCTCTGGCTGCGTTGATTTGCTTCGCCATCAGGTTTGCGAAGAACTGCATGTCCTGGCGCTACTCTTGCACTAGATACACCAACTTCCTCCTGGACACCAAGGGCAGACTCTATCGTTGGCGGTCGCCTGTCATCATAGAGAAAGGGGGTAAGGTTGAGGTCGAAGGTCATCTGATCGATCTCAAAAGAGTTGTGCTTGATGGCTCTGTGGCGACACCTTTAACCAGAGTTTCAGCGGAACAATGGGGTCGTCCCTAGACGACTTTTGCCATGATAGTACAGCCCCACAGAAGGTGCTCTTGGCGTTTTCCATCACCTACACGCCAGTGATGATATATGCCCTAAAGGTAAGCCGCGGCCGACTTTTGGGGCTTCTGCACCTTTTGATTTTTTTGAACTGTGCCTTTACTTTCGGGTACATGACATTCGTGCACTTTCGGAGCACGAACAAGGTCGCGCTCACTATGGGAGCAGTAGTCGCACTCCTTTGGGGGGTGTACTCAGCCATAGAAACCTGGAAATTCATCACCTCCAGATGCCGTTGTGCTTGCTAGGCCGCAAGTACATTCTGGCCCCTGCCCACCACGTTG
END

      file_format_3 = <<END
LOCUS       PRU87392               15411 bp    RNA     linear   VRL 17-NOV-2000
DEFINITION  Porcine reproductive and respiratory syndrome virus strain VR-2332,
            complete genome.
ACCESSION   U87392 AF030244 U00153
VERSION     U87392.3  GI:11192298
[...cut...]
     3'UTR           15261..15411
     polyA_site      15409
ORIGIN      
^^
atgacgtataggtgttggctctatgccttggcatttgtattgtcaggagctgtgaccattggcacagcccaaaacttgctgcacagaaacacccttctgtgatagcctccttcaggggagcttagggtttgtccctagcaccttgcttccggagttgcactgctttacggtctctccacccctttaaccatgtctgggatacttgatcggtgcacgtgtacccccaatgccagggtgtttatggcggagggccaagtctactgcacacgatgcctcagtgcacggtctctccttcccctgaacctccaagtttctgagctcggggtgctaggcctattctacaggcccgaagagccactccggtggacgttgccacgtgcattccccactgttgagtgctcccccgccggggcctgctggctttctgcaatctttccaatcgcacgaatgaccagtggaaacctgaacttccaacaaagaatggtacgggtcgcagctgagctttacagagccggccagctcacccctgcagtcttgaaggctctacaagtttatgaacggggttgccgctggtaccccattgttggacctgtccctggagtggccgttttcgccaattccctacatgtgagtgataaacctttcccgggagcaactcacgtgttgaccaacctgccgctcccgcagagacccaagcctgaagacttttgcccctttgagtgtgctatggctactgtctatgacattggtcatgacgccgtcatgtatgtggccgaaaggaaagtctcctgggcccctcgtggcggggatgaagtgaaatttgaagctgtccccggggagttgaagttgattgcgaaccggctccgcacctccttcccgccccaccacacagtggacatgtctaagttcgccttcacagcccctgggtgtggtgtttctatgcgggtcgaacgccaacacggctgccttcccgctgacactgtccctga!
 aggcaactgctggtggagcttgtttgacttgcttccactggaagttcagaacaaagaaattcgccatgctaaccaatttggctaccagaccaagcatggtgtctctggcaagtacctacagcggaggctgca
END

      @lc = Bio::Lasergene
      @obj1 = @lc.new(file_format_1)
      @obj2 = @lc.new(file_format_2)
      @obj3 = @lc.new(file_format_3)
    end

    def test_methods
      a1 = @obj1
      a1_seq = 'atgacgtatccaaagaggcgttaccggagaagaagacaccgcccccgcagtcctcttggccagatcctccgccgccgcccctggctcgtccacccccgccacagttaccgctggagaaggaaaaatggcatcttcawcacccgcctatcccgcaycttcggawrtactatcaagcgaaccacagtcagaacgccctcctgggcggtggacatgatgagattcaatattaatgactttcttcccccaggagggggctcaaacccccgctctgtgccctttgaatactacagaataagaaaggttaaggttgaattctggccctgctccccgatcacccagggtgacaggggaatgggctccagtgctgwtattctagmtgatrrcttkgtaacaaagrccacagccctcacctatgacccctatgtaaacttctcctcccgccataccataacccagcccttctcctaccrctcccgytactttacccccaaacctgtcctwgatkccactatkgatkactkccaaccaaacaacaaaagaaaccagctgtggstgagactacawactgctggaaatgtagaccwcgtaggcctsggcactgcgtkcgaaaacagtatatacgaccaggaatacaatatccgtgtmaccatgtatgtacaattcagagaatttaatcttaaagaccccccrcttmacccktaatgaataataamaaccattacgaagtgataaaawagwctcagtaatttattycatatggaaattcwsggcatgggggggaaagggtgacgaackkgcccccttcctccstsgmytkttcygtagcattcytccamaayaccwaggcagyamtcctccsatcaagagcytsyacagctgggacagcagttgaggaggaccattcaaagggggtcggattgctggtaatcaga'
      a2 = @obj2
      a2_seq = 'atgtcggggaaatgcttgaccgcgggctactgctcatcattgctttctttgtggtatatcgtgccgttctgttttgctgtgctcgtcaacgccagcggcgacagcagctctcattttcagtcgatttataacttgacgttatgtgagctgaatggcacgaactggctggcagacaactttaactgggctgtggagacttttgtcatcttccccgtgttgactcacattgtttcctatggtgcactcactaccagtcattttcttgacacagttggtctagttactgtgtctaccgccgggttttatcacgggcggtacgtcttgagtagcatctacgcggtctgtgctctggctgcgttgatttgcttcgccatcaggtttgcgaagaactgcatgtcctggcgctactcttgcactagatacaccaacttcctcctggacaccaagggcagactctatcgttggcggtcgcctgtcatcatagagaaagggggtaaggttgaggtcgaaggtcatctgatcgatctcaaaagagttgtgcttgatggctctgtggcgacacctttaaccagagtttcagcggaacaatggggtcgtccctagacgacttttgccatgatagtacagccccacagaaggtgctcttggcgttttccatcacctacacgccagtgatgatatatgccctaaaggtaagccgcggccgacttttggggcttctgcaccttttgatttttttgaactgtgcctttactttcgggtacatgacattcgtgcactttcggagcacgaacaaggtcgcgctcactatgggagcagtagtcgcactcctttggggggtgtactcagccatagaaacctggaaattcatcacctccagatgccgttgtgcttgctaggccgcaagtacattctggcccctgcccaccacgttg'
      a3 = @obj3
      a3_seq = 'atgacgtataggtgttggctctatgccttggcatttgtattgtcaggagctgtgaccattggcacagcccaaaacttgctgcacagaaacacccttctgtgatagcctccttcaggggagcttagggtttgtccctagcaccttgcttccggagttgcactgctttacggtctctccacccctttaaccatgtctgggatacttgatcggtgcacgtgtacccccaatgccagggtgtttatggcggagggccaagtctactgcacacgatgcctcagtgcacggtctctccttcccctgaacctccaagtttctgagctcggggtgctaggcctattctacaggcccgaagagccactccggtggacgttgccacgtgcattccccactgttgagtgctcccccgccggggcctgctggctttctgcaatctttccaatcgcacgaatgaccagtggaaacctgaacttccaacaaagaatggtacgggtcgcagctgagctttacagagccggccagctcacccctgcagtcttgaaggctctacaagtttatgaacggggttgccgctggtaccccattgttggacctgtccctggagtggccgttttcgccaattccctacatgtgagtgataaacctttcccgggagcaactcacgtgttgaccaacctgccgctcccgcagagacccaagcctgaagacttttgcccctttgagtgtgctatggctactgtctatgacattggtcatgacgccgtcatgtatgtggccgaaaggaaagtctcctgggcccctcgtggcggggatgaagtgaaatttgaagctgtccccggggagttgaagttgattgcgaaccggctccgcacctccttcccgccccaccacacagtggacatgtctaagttcgccttcacagcccctgggtgtggtgtttctatgcgggtcgaacgccaacacggctgccttcccg!
 ctgacactgtccctgaaggcaactgctggtggagcttgtttgacttgcttccactggaagttcagaacaaagaaattcgccatgctaaccaatttggctaccagaccaagcatggtgtctctggcaagtacctacagcggaggctgca'
      
      assert_equal(a1_seq, a1.seq.seq)
      assert_equal(a2_seq, a2.seq.seq)
      assert_equal(a3_seq, a3.seq.seq)
      
      assert_equal('"Contig 1"', a1.entry_id)
      assert_equal('Contig 1', a2.name)
      assert_equal(nil, a3.name)
      
      assert_equal(4, a1.total_sequences)
      assert_equal(4, a2.total_sequences)
      assert_equal(nil, a3.total_sequences)

      assert_equal(true, a1.standard_comment?)
      assert_equal(true, a2.standard_comment?)
      assert_equal(false, a3.standard_comment?) 
    end

  end

end




More information about the bioruby-cvs mailing list