[BioRuby-cvs] bioruby/doc Tutorial.rd,1.15,1.16

Pjotr Prins pjotr at dev.open-bio.org
Sat Feb 2 14:15:19 UTC 2008


Update of /home/repository/bioruby/bioruby/doc
In directory dev.open-bio.org:/tmp/cvs-serv31326

Modified Files:
	Tutorial.rd 
Log Message:
Modified tutorial

Index: Tutorial.rd
===================================================================
RCS file: /home/repository/bioruby/bioruby/doc/Tutorial.rd,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Tutorial.rd	2 Feb 2008 14:01:54 -0000	1.15
--- Tutorial.rd	2 Feb 2008 14:15:08 -0000	1.16
***************
*** 115,120 ****
      puts seq.complement.translate       # translation of complemental strand
  
!     counts = {'a'=>seq.count('a'),'c'=>seq.count('c'),'g'=>seq.count('g'),'t'=>seq.count('t')}
!     p randomseq = Bio::Sequence::NA.randomize(counts)  # reshuffle sequence with same freq.
  
  The p, print and puts methods are standard Ruby ways of outputting to
--- 115,122 ----
      puts seq.complement.translate       # translation of complemental strand
  
!     # reshuffle sequence with same frequencies:
!     counts = {'a'=>seq.count('a'),'c'=>seq.count('c'),
!               'g'=>seq.count('g'),'t'=>seq.count('t')}
!     p randomseq = Bio::Sequence::NA.randomize(counts)  
  
  The p, print and puts methods are standard Ruby ways of outputting to
***************
*** 265,269 ****
        print ">#{gb.accession} "         # Accession
        puts gb.definition                # Definition
!       puts gb.naseq                     # Nucleic acid sequence (Bio::Sequence::NA object)
      end
  
--- 267,272 ----
        print ">#{gb.accession} "         # Accession
        puts gb.definition                # Definition
!       puts gb.naseq                     # Nucleic acid sequence 
!                                         # (Bio::Sequence::NA object)
      end
  
***************
*** 387,391 ****
      aaseq.splicing('21..119')
  
- (EDITOR's NOTE: why use STRINGs here?)
  
  === More databases
--- 390,393 ----
***************
*** 494,498 ****
  and cut a sequence with an enzyme follow up with:
  
!    res = seq.cut_with_enzyme('EcoRII', {:max_permutations => 0}, {:view_ranges => true})
     if res.kind_of? Symbol #error
        err = Err.find_by_code(res.to_s)
--- 496,501 ----
  and cut a sequence with an enzyme follow up with:
  
!    res = seq.cut_with_enzyme('EcoRII', {:max_permutations => 0}, 
!      {:view_ranges => true})
     if res.kind_of? Symbol #error
        err = Err.find_by_code(res.to_s)
***************
*** 529,534 ****
  fasta34. FASTA can be downloaded from ftp://ftp.virginia.edu/pub/fasta/).
  First, you must prepare your FASTA-formatted database sequence file
! target.pep and FASTA-formatted query.pep.  (TRANSLATOR'S NOTE: I think
! we should provide sample data to readers.)
  
      #!/usr/bin/env ruby
--- 532,536 ----
  fasta34. FASTA can be downloaded from ftp://ftp.virginia.edu/pub/fasta/).
  First, you must prepare your FASTA-formatted database sequence file
! target.pep and FASTA-formatted query.pep. 
  
      #!/usr/bin/env ruby
***************
*** 536,547 ****
      require 'bio'
  
!     # Creates FASTA factory object ("ssearch" instead of "fasta34" can also work)
      factory = Bio::Fasta.local('fasta34', ARGV.pop)
      (EDITOR's NOTE: not consistent pop command)
  
-     # Reads FASTA-formatted files (TRANSLATOR'S NOTE: something wrong in Japanese text)
      ff = Bio::FlatFile.new(Bio::FastaFormat, ARGF)
  
!     # Iterates over each entry. the variable "entry" is a Bio::FastaFormat object.
      ff.each do |entry|
        # shows definition line (begins with '>') to the standard error output
--- 538,550 ----
      require 'bio'
  
!     # Creates FASTA factory object ("ssearch" instead of 
!     # "fasta34" can also work)
      factory = Bio::Fasta.local('fasta34', ARGV.pop)
      (EDITOR's NOTE: not consistent pop command)
  
      ff = Bio::FlatFile.new(Bio::FastaFormat, ARGF)
  
!     # Iterates over each entry. the variable "entry" is a 
!     # Bio::FastaFormat object:
      ff.each do |entry|
        # shows definition line (begins with '>') to the standard error output
***************
*** 555,559 ****
          # If E-value is smaller than 0.0001
          if hit.evalue < 0.0001
!           # shows identifier of query and hit, E-value, start and end positions of homologous region (TRANSLATOR'S NOTE: should I change Japanese document?)
            print "#{hit.query_id} : evalue #{hit.evalue}\t#{hit.target_id} at "
            p hit.lap_at
--- 558,563 ----
          # If E-value is smaller than 0.0001
          if hit.evalue < 0.0001
!           # shows identifier of query and hit, E-value, start and 
!           # end positions of homologous region 
            print "#{hit.query_id} : evalue #{hit.evalue}\t#{hit.target_id} at "
            p hit.lap_at
***************
*** 569,573 ****
  FASTA many times easily. Instead of using Fasta#query method,
  Bio::Sequence#fasta method can be used.
- (TRANSLATOR'S NOTE: Bio::Sequence#fasta are not so frequently used.)
  
      seq = ">test seq\nYQVLEEIGRGSFGSVRKVIHIPTKKLLVRKDIKYGHMNSKE"
--- 573,576 ----
***************
*** 585,589 ****
  with the Report object. For example, getting information for hits:
  
- 
      report.each do |hit|
        puts hit.evalue           # E-value
--- 588,591 ----
***************
*** 594,606 ****
        puts hit.query_def        # definition(comment line) of query sequence
        puts hit.query_len        # length of query sequence
!       puts hit.query_seq        # query sequence (TRANSLATOR'S NOTE: sequence of homologous region of query sequence)
        puts hit.target_id        # identifier of hit sequence
        puts hit.target_def       # definition(comment line) of hit sequence
        puts hit.target_len       # length of hit sequence
!       puts hit.target_seq       # hit sequence (TRANSLATOR'S NOTE: sequence of homologous region of hit sequence)
!       puts hit.query_start      # start position of homologous region in query sequence
!       puts hit.query_end        # end position of homologous region in query sequence
!       puts hit.target_start     # start posiotion of homologous region in hit(target) sequence
!       puts hit.target_end       # end position of homologous region in hit(target) sequence
        puts hit.lap_at           # array of above four numbers
      end
--- 596,612 ----
        puts hit.query_def        # definition(comment line) of query sequence
        puts hit.query_len        # length of query sequence
!       puts hit.query_seq        # sequence of homologous region
        puts hit.target_id        # identifier of hit sequence
        puts hit.target_def       # definition(comment line) of hit sequence
        puts hit.target_len       # length of hit sequence
!       puts hit.target_seq       # hit of homologous region of hit sequence
!       puts hit.query_start      # start position of homologous 
!                                 # region in query sequence
!       puts hit.query_end        # end position of homologous region 
!                                 # in query sequence
!       puts hit.target_start     # start posiotion of homologous region 
!                                 # in hit(target) sequence
!       puts hit.target_end       # end position of homologous region 
!                                 # in hit(target) sequence
        puts hit.lap_at           # array of above four numbers
      end
***************
*** 695,717 ****
  
      report.each do |hit|
!       puts hit.bit_score        # bit score (*)
!       puts hit.query_seq        # query sequence (TRANSLATOR'S NOTE: sequence of homologous region of query sequence)
!       puts hit.midline          # middle line string of alignment of homologous region (*)
!       puts hit.target_seq       # hit sequence (TRANSLATOR'S NOTE: sequence of homologous region of query sequence)
  
!       puts hit.evalue           # E-value
!       puts hit.identity         # % identity
!       puts hit.overlap          # length of overlapping region
!       puts hit.query_id         # identifier of query sequence
!       puts hit.query_def        # definition(comment line) of query sequence
!       puts hit.query_len        # length of query sequence
!       puts hit.target_id        # identifier of hit sequence
!       puts hit.target_def       # definition(comment line) of hit sequence
!       puts hit.target_len       # length of hit sequence
!       puts hit.query_start      # start position of homologous region in query sequence
!       puts hit.query_end        # end position of homologous region in query sequence
!       puts hit.target_start     # start position of homologous region in hit(target) sequence
!       puts hit.target_end       # end position of homologous region in hit(target) sequence
!       puts hit.lap_at           # array of above four numbers
      end
  
--- 701,723 ----
  
      report.each do |hit|
!       puts hit.bit_score       
!       puts hit.query_seq       
!       puts hit.midline         
!       puts hit.target_seq      
  
!       puts hit.evalue          
!       puts hit.identity        
!       puts hit.overlap         
!       puts hit.query_id        
!       puts hit.query_def       
!       puts hit.query_len       
!       puts hit.target_id       
!       puts hit.target_def      
!       puts hit.target_len      
!       puts hit.query_start     
!       puts hit.query_end       
!       puts hit.target_start    
!       puts hit.target_end      
!       puts hit.lap_at          
      end
  
***************
*** 1171,1175 ****
  == KEGG API
  
! Please refer to KEGG_API.rd.ja (TRANSLATOR'S NOTE: English version: ((<URL:http://www.genome.jp/kegg/soap/doc/keggapi_manual.html>)) ) and
  
    * ((<URL:http://www.genome.jp/kegg/soap/>))
--- 1177,1181 ----
  == KEGG API
  
! Please refer to KEGG_API.rd.ja (English version: ((<URL:http://www.genome.jp/kegg/soap/doc/keggapi_manual.html>)) ) and
  
    * ((<URL:http://www.genome.jp/kegg/soap/>))




More information about the bioruby-cvs mailing list