Permalink
Browse files

Bugfix for the to_s method

Bugfix induced in basictest.rb
  • Loading branch information...
1 parent 452f1ed commit 793f0b72640e26823e1455eb961943dddfa7b51f Ricardo H. Ramirez committed Jun 9, 2011
Showing with 5 additions and 2 deletions.
  1. +4 −1 lib/bio/db/sam.rb
  2. +1 −1 test/basictest.rb
View
@@ -82,7 +82,10 @@ def open()
#Prints a description of the sam file in a text format containg if it is binary or text, the path
#and the fasta file of the reference
def to_s()
- (@binary ? "Binary" : "Text") + " file: " + @sam + " with fasta: " + @fasta_path
+ string = "SAM FIle: "
+ string = string + (@binary ? "Binary" : "Text") + " file: " + @sam if @sam
+ string = " with fasta: " + @fasta_path if @fasta_path;
+ string
end
#Closes the sam file and destroys the C pointers using the functions provided by libbam
View
@@ -290,7 +290,7 @@ def test_avg_coverage
def test_avg_coverage_cached_name
sam = Bio::DB::Sam.new({:fasta=>@testReference, :bam=>@testBAMFile })
sam.open
- sam.fetch_chr_index("chr_1")
+ ind = sam.fetch_chr_index("chr_1")
p "The index for chr_1: " + ind.to_s
cov = sam.average_coverage("chr_1", 60, 30)

0 comments on commit 793f0b7

Please sign in to comment.