bio-samtools 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. data/VERSION +1 -1
  2. data/bio-samtools.gemspec +60 -6
  3. data/doc/Bio.html +171 -0
  4. data/doc/Bio/DB.html +163 -0
  5. data/doc/Bio/DB/Alignment.html +780 -0
  6. data/doc/Bio/DB/SAM.html +1241 -0
  7. data/doc/Bio/DB/SAM/Library.html +217 -0
  8. data/doc/Bio/DB/SAM/Tools.html +331 -0
  9. data/doc/Bio/DB/SAM/Tools/Bam1CoreT.html +159 -0
  10. data/doc/Bio/DB/SAM/Tools/Bam1T.html +220 -0
  11. data/doc/Bio/DB/SAM/Tools/BamHeaderT.html +249 -0
  12. data/doc/Bio/DB/SAM/Tools/BamPileup1T.html +159 -0
  13. data/doc/Bio/DB/SAM/Tools/SamfileT.html +171 -0
  14. data/doc/Bio/DB/SAM/Tools/SamfileTX.html +159 -0
  15. data/doc/Bio/DB/SAMException.html +205 -0
  16. data/doc/Bio/DB/Tag.html +254 -0
  17. data/doc/LICENSE_txt.html +881 -0
  18. data/doc/LibC.html +153 -0
  19. data/doc/Pileup.html +571 -0
  20. data/doc/Vcf.html +473 -0
  21. data/doc/created.rid +10 -1
  22. data/doc/images/add.png +0 -0
  23. data/doc/images/brick.png +0 -0
  24. data/doc/images/brick_link.png +0 -0
  25. data/doc/images/bug.png +0 -0
  26. data/doc/images/bullet_black.png +0 -0
  27. data/doc/images/bullet_toggle_minus.png +0 -0
  28. data/doc/images/bullet_toggle_plus.png +0 -0
  29. data/doc/images/date.png +0 -0
  30. data/doc/images/delete.png +0 -0
  31. data/doc/images/find.png +0 -0
  32. data/doc/images/loadingAnimation.gif +0 -0
  33. data/doc/images/macFFBgHack.png +0 -0
  34. data/doc/images/package.png +0 -0
  35. data/doc/images/page_green.png +0 -0
  36. data/doc/images/page_white_text.png +0 -0
  37. data/doc/images/page_white_width.png +0 -0
  38. data/doc/images/plugin.png +0 -0
  39. data/doc/images/ruby.png +0 -0
  40. data/doc/images/tag_blue.png +0 -0
  41. data/doc/images/tag_green.png +0 -0
  42. data/doc/images/transparent.png +0 -0
  43. data/doc/images/wrench.png +0 -0
  44. data/doc/images/wrench_orange.png +0 -0
  45. data/doc/images/zoom.png +0 -0
  46. data/doc/index.html +109 -21
  47. data/doc/js/darkfish.js +153 -0
  48. data/doc/js/jquery.js +18 -0
  49. data/doc/js/navigation.js +142 -0
  50. data/doc/js/search.js +94 -0
  51. data/doc/js/search_index.js +1 -0
  52. data/doc/js/searcher.js +228 -0
  53. data/doc/lib/bio-samtools_rb.html +115 -0
  54. data/doc/lib/bio/db/sam/bam_rb.html +121 -0
  55. data/doc/lib/bio/db/sam/faidx_rb.html +117 -0
  56. data/doc/lib/bio/db/sam/library_rb.html +115 -0
  57. data/doc/lib/bio/db/sam/pileup_rb.html +171 -0
  58. data/doc/lib/bio/db/sam/sam_rb.html +121 -0
  59. data/doc/lib/bio/db/sam/vcf_rb.html +124 -0
  60. data/doc/lib/bio/db/sam_rb.html +115 -0
  61. data/doc/rdoc.css +543 -0
  62. data/doc/table_of_contents.html +186 -0
  63. data/ext/Makefile-bioruby.patch +1 -1
  64. data/ext/Rakefile +8 -1
  65. data/ext/mkrf_conf.rb +8 -1
  66. data/lib/bio/db/sam.rb +140 -27
  67. data/lib/bio/db/sam/vcf.rb +0 -1
  68. data/test/basictest.rb +4 -4
  69. data/test/test_basic.rb +50 -34
  70. metadata +79 -25
  71. data/test/coverage.rb +0 -26
  72. data/test/coverage_plot.rb +0 -28
  73. data/test/feature.rb +0 -0
  74. data/test/test_pileup.rb +0 -68
data/test/coverage.rb DELETED
@@ -1,26 +0,0 @@
1
- $: << File.expand_path(File.dirname(__FILE__) + '/../lib')
2
- $: << File.expand_path('.')
3
-
4
- require "bio/db/sam"
5
- require "bio/db/sam/sam"
6
-
7
- bam_file = ARGV[0]
8
- fasta_file = ARGV[1]
9
- chromosmes = ARGV[2]
10
- i = 0
11
- sam = Bio::DB::Sam.new({:bam=>bam_file, :fasta=>fasta_file})
12
- sam.open
13
- File.open(chromosmes, "r") do |file|
14
- file.each_line{|line|
15
- $stderr.puts i.to_s + " done" if i%10 == 0
16
- ObjectSpace.each_object(Bio::DB::Sam) {|x| $stderr.puts x } if i%10 == 0
17
- count = ObjectSpace.each_object() {|x| } if i%10 == 0
18
- $stderr.puts count if i%10 == 0
19
- i = i + 1
20
- fetching = line.split(' ')[0]
21
-
22
- cov = sam.average_coverage(fetching, 0, 16000)
23
- puts fetching + " " + cov.to_s
24
- }
25
- end
26
- sam.close
@@ -1,28 +0,0 @@
1
- $: << File.expand_path(File.dirname(__FILE__) + '/../lib')
2
- $: << File.expand_path('.')
3
-
4
- require "bio/db/sam"
5
- require "bio/db/sam/sam"
6
-
7
- bam_file = ARGV[0]
8
- fasta_file = ARGV[1]
9
- chromosmes = ARGV[2]
10
-
11
-
12
- sam = Bio::DB::Sam.new({:bam=>bam_file, :fasta=>fasta_file})
13
- sam.open
14
- File.open(chromosmes, "r") do |file|
15
- file.each_line{|line|
16
-
17
-
18
-
19
-
20
- fetching = line.split()[0]
21
- last = line.split()[1].to_i
22
- covs = sam.chromosome_coverage(fetching, 0, last)
23
- puts "POS\tCOV"
24
- # puts "#{fetching}\t#{last}"
25
- covs.each_with_index{ |cov, i| puts "#{i}\t#{cov}" }
26
- }
27
- end
28
- sam.close
data/test/feature.rb DELETED
File without changes
data/test/test_pileup.rb DELETED
@@ -1,68 +0,0 @@
1
- $: << File.expand_path(File.dirname(__FILE__) + '/../lib')
2
- $: << File.expand_path('.')
3
-
4
- require "bio/db/sam/pileup"
5
- require "test/unit"
6
-
7
- class TestPileup < Test::Unit::TestCase
8
-
9
- def setup
10
- @six_col = Pileup.new("seq1\t272\tT\t24\t,.$.....,,.,.,...,,,.,..^+.\t<<<+;<<<<<<<<<<<=<;<;7<&")
11
- @ten_col = Pileup.new("seq2\t151\tG\tG\t36\t0\t99\t12\t...........A\t:9<;;7=<<<<<")
12
- @snp = Pileup.new("seq1\t272\tT\t24\t,.$.....,,.gGgGgGgGgGgGg^+.\t<<<+;<<<<<<<<<<<=<;<;7<&")
13
- @snp_2 = Pileup.new("seq1\t272\tT\t24\t......aaaaaaggggggcccccc$^+\t<<<+;<<<<<<<<<<<=<;<;7<&")
14
- @snp_3 = Pileup.new("seq1\t272\tT\t24\t......aaaaaaaagggggccccc$^+\t<<<+;<<<<<<<<<<<=<;<;7<&")
15
- end
16
-
17
- def test_new_from_6_column
18
- assert_equal("seq1", @six_col.ref_name)
19
- assert_equal(272, @six_col.pos)
20
- assert_equal("T", @six_col.ref_base)
21
- assert_equal(24, @six_col.coverage)
22
- assert_equal(",.$.....,,.,.,...,,,.,..^+.", @six_col.read_bases)
23
- assert_equal("<<<+;<<<<<<<<<<<=<;<;7<&", @six_col.read_quals)
24
- end
25
-
26
- def test_new_from_10_column
27
- assert_equal("seq2", @ten_col.ref_name)
28
- assert_equal(151, @ten_col.pos)
29
- assert_equal("G", @ten_col.ref_base)
30
- assert_equal("G", @ten_col.consensus)
31
- assert_equal(36, @ten_col.consensus_quality)
32
- assert_equal(0, @ten_col.snp_quality)
33
- assert_equal(99, @ten_col.rms_mapq)
34
- assert_equal(12, @ten_col.coverage)
35
- assert_equal("...........A", @ten_col.read_bases)
36
- assert_equal(":9<;;7=<<<<<", @ten_col.read_quals)
37
- end
38
-
39
- def test_non_refs
40
- assert_equal({:A => 1, :C => 0, :T => 0, :G => 0}, @ten_col.non_refs)
41
- assert_equal({:A => 0, :C => 0, :T => 0, :G => 0}, @six_col.non_refs)
42
- end
43
-
44
- def test_consensus
45
- assert_equal("G", @snp.consensus)
46
- assert_equal("ACGT", @snp_2.consensus)
47
- assert_equal("A", @snp_3.consensus)
48
- end
49
-
50
- def test_non_ref_count
51
- assert_equal(13,@snp.non_ref_count)
52
- assert_equal(18,@snp_2.non_ref_count)
53
- assert_equal(18,@snp_3.non_ref_count)
54
- end
55
-
56
- def test_ref_count
57
- assert_equal(11,@snp.ref_count)
58
- assert_equal(6,@snp_2.ref_count)
59
- assert_equal(6,@snp_3.ref_count)
60
- end
61
-
62
- def test_ref_plus_non_ref_equal_to_coverage
63
- assert_equal(@snp.coverage,@snp.ref_count + @snp.non_ref_count)
64
- assert_equal(@snp_2.coverage,@snp_2.ref_count + @snp_2.non_ref_count)
65
- assert_equal(@snp_3.coverage,@snp_3.ref_count + @snp_3.non_ref_count)
66
- end
67
-
68
- end