bio-ngs 0.4.6.alpha.01 → 0.4.6.alpha.02

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. data/Gemfile +4 -2
  2. data/Gemfile.lock +21 -21
  3. data/README.rdoc +51 -4
  4. data/VERSION +1 -1
  5. data/bin/biongs +1 -0
  6. data/bio-ngs.gemspec +36 -8
  7. data/features/cufflinks_gtf_parser.feature +22 -0
  8. data/features/cufflinks_gtf_parser_indexing.feature +20 -0
  9. data/features/step_definitions/cufflinks_gtf.rb +30 -0
  10. data/features/step_definitions/cufflinks_gtf_parser_indexing.rb +53 -0
  11. data/features/support/env.rb +2 -0
  12. data/lib/bio-ngs.rb +19 -5
  13. data/lib/bio/appl/ngs/cufflinks.rb +447 -281
  14. data/lib/bio/appl/ngs/cufflinks/gtf/gtf.rb +23 -0
  15. data/lib/bio/appl/ngs/cufflinks/gtf/gtf_parser.rb +248 -0
  16. data/lib/bio/appl/ngs/cufflinks/gtf/transcript.rb +154 -0
  17. data/lib/bio/ngs/fs.rb +46 -0
  18. data/lib/bio/ngs/illumina/fastq.rb +176 -0
  19. data/lib/bio/ngs/illumina/illumina.rb +64 -0
  20. data/lib/bio/ngs/illumina/project.rb +81 -0
  21. data/lib/bio/ngs/illumina/sample.rb +85 -0
  22. data/lib/bio/ngs/task.rb +1 -1
  23. data/lib/bio/ngs/utils.rb +124 -112
  24. data/lib/meta.rb +162 -0
  25. data/lib/tasks/convert.thor +14 -14
  26. data/lib/tasks/filter.thor +158 -23
  27. data/lib/tasks/quality.thor +24 -4
  28. data/lib/tasks/rna.thor +26 -0
  29. data/lib/wrapper.rb +28 -0
  30. data/spec/bio/ngs/fs_spec.rb +70 -0
  31. data/spec/bio/ngs/illumina/fastq_spec.rb +52 -0
  32. data/spec/bio/ngs/illumina/illumina_spec.rb +21 -0
  33. data/spec/bio/ngs/illumina/project_spec.rb +0 -0
  34. data/spec/bio/ngs/illumina/sample_spec.rb +0 -0
  35. data/spec/bio/ngs/illumina/samples_spec.rb +0 -0
  36. data/spec/filter_spec.rb +25 -0
  37. data/spec/fixture/table_filter_list.txt +3 -0
  38. data/spec/fixture/table_filter_list_first_column.txt +2 -0
  39. data/spec/fixture/table_filter_source.tsv +44 -0
  40. data/spec/fixture/test-filtered-reference.fastq.gz +0 -0
  41. data/spec/fixture/test-merged-reference.fastq.gz +0 -0
  42. data/spec/fixture/test.fastq.gz +0 -0
  43. data/spec/meta_spec.rb +117 -0
  44. data/spec/spec_helper.rb +1 -1
  45. metadata +97 -69
@@ -25,6 +25,13 @@ class Rna < Thor
25
25
  wrapper.run :arguments=>[bam], :separator => "="
26
26
  end
27
27
 
28
+ desc "quantdenovo GTF_guide OUTPUTDIR BAM ", "Genes and transcripts quantification discovering de novo transcripts"
29
+ Bio::Ngs::Cufflinks::QuantificationDenovo.new.thor_task(self, :quantdenovo) do |wrapper, task, gtf_guide, outputdir, bam|
30
+ wrapper.params = task.options
31
+ wrapper.params = {"num-threads" => 6, "output-dir" => outputdir, "GTF-guide" => gtf_guide }
32
+ wrapper.run :arguments=>[bam], :separator => "="
33
+ end
34
+
28
35
  #GTFS_QUANTIFICATION is a comma separated list of gtf file names
29
36
  desc "compare GTF_REF OUTPUTDIR GTFS_QUANTIFICATION", "GTFS_QUANTIFICATIONS, use a comma separated list of gtf"
30
37
  Bio::Ngs::Cufflinks::Compare.new.thor_task(self, :compare) do |wrapper, task, gtf_ref, outputdir, gtfs_quantification|
@@ -42,6 +49,25 @@ class Rna < Thor
42
49
  wrapper.run :arguments=>[gtfs_quantification.split(',')]
43
50
  # Dir.chdir("../")
44
51
  end
52
+
53
+
54
+ desc "merge GTF_REF FASTA_REF ASSEMBLY_GTF_LIST", "GTFS_QUANTIFICATIONS, use a comma separated list of gtf"
55
+ Bio::Ngs::Cufflinks::Merge.new.thor_task(self, :merge) do |wrapper, task, gtf_ref, fasta_ref, assembly_gtf_list|
56
+ # unless Dir.exists?(outputdir)
57
+ # Dir.mkdir(outputdir)
58
+ # end
59
+ # Dir.chdir(outputdir)
60
+ # #I assume GTS_QUANTIFICATION is a comma separated list of single gtf files
61
+ # gtf_tracking_filename = "#{outputdir}.gtf_tracking"
62
+ # File.open(gtf_tracking_filename, 'w') do |file|
63
+ # file.puts gtfs_quantification.gsub(/,/,"\n")
64
+ # end #file
65
+ wrapper.params = task.options
66
+ wrapper.params = {"ref-gtf"=>gtf_ref, "ref-sequence"=>fasta_ref}
67
+ wrapper.run :arguments=>[assembly_gtf_list], :separator => "="
68
+ # Dir.chdir("../")
69
+ end
70
+
45
71
 
46
72
  desc "mapquant DIST INDEX OUTPUTDIR FASTQS", "map and quantify"
47
73
  method_option :paired, :type => :boolean, :default => false, :desc => 'Are reads paired? If you chose
@@ -43,6 +43,15 @@ module Bio
43
43
  @options = options
44
44
  @params = {}
45
45
  @pipe_ahead = []
46
+ @path = options.delete(:path) || "."
47
+ end
48
+
49
+ def path
50
+ @path
51
+ end
52
+
53
+ def path=(path)
54
+ @path=path
46
55
  end
47
56
 
48
57
  # Parameters are accepted ONLY if the key is present as
@@ -215,6 +224,15 @@ module Bio
215
224
  end
216
225
 
217
226
  module ClassMethods
227
+
228
+ # Propagate class variable in the superclass to the inherited class,
229
+ # so options defined in a previous wrap can be recicled.
230
+ def inherited(subclass)
231
+ self.instance_variables.each do |var|
232
+ subclass.instance_variable_set(var, self.instance_variable_get(var))
233
+ end
234
+ end
235
+
218
236
  #TODO: do I need to set a default program name using class name or not ?
219
237
  # or do we need to specify somewhere a defaitl path and looking for a real binary ?
220
238
 
@@ -242,6 +260,16 @@ module Bio
242
260
  @options = (@options || {}).merge(name.to_s=>opt)
243
261
  end
244
262
 
263
+ # Remove an option from the class
264
+ def delete_option(name)
265
+ @options.delete(name)
266
+ end
267
+
268
+ # An alias reuse the properties of a specific method and giving them another name
269
+ # def add_alias(source, dest)
270
+ # @options = (@options || {}).merge(name.to_s=>@options[dest.to_s]) unless @options[dest]
271
+ # end
272
+
245
273
  alias set_program program=
246
274
  alias set_sub_program sub_program=
247
275
 
@@ -0,0 +1,70 @@
1
+ @TestDirectory = File.expand_path(File.join(File.dirname(__FILE__) + '/../../'))
2
+
3
+ require File.expand_path(File.join(@TestDirectory, 'spec_helper'))
4
+
5
+ describe "File System utilities for BioNGS" do
6
+
7
+ before(:each) do
8
+ @data_dir = File.join(File.expand_path(File.join(File.dirname(__FILE__) + '/../../')), 'fixture')
9
+ end
10
+
11
+
12
+ describe Bio::Ngs::FS, ".cat" do
13
+ it "concatenates the content of multiple files in just one file" do
14
+ fn_one=File.join(@data_dir, 'test.fastq.gz')
15
+ fn_two=File.join(@data_dir, 'test-filtered-reference.fastq.gz')
16
+ fn_merged=File.join(@data_dir, 'test-merged.fastq.gz')
17
+ fn_merged_reference=File.join(@data_dir, 'test-merged-reference.fastq.gz')
18
+ Bio::Ngs::FS.cat([fn_one, fn_two], fn_merged)
19
+
20
+ fmerged_reference=File.open(fn_merged_reference,"rb:binary").read
21
+ fmerged=File.open(fn_merged, "rb:binary").read
22
+ fmerged.to_s.should == fmerged_reference.to_s
23
+ end
24
+ end
25
+
26
+
27
+ describe Bio::Ngs::FS, ".files" do
28
+ context "when input is a string" do
29
+ context "representing an existing file" do
30
+ it "gives back an array with the file name" do
31
+ Bio::Ngs::FS.files(File.join(@data_dir, "test-filtered-reference.fastq.gz")).should =~ [File.join(@data_dir, "test-filtered-reference.fastq.gz")]
32
+ end
33
+ end
34
+ context "representing a non existing file" do
35
+ it "gives back nil" do
36
+ Bio::Ngs::FS.files(File.join(@data_dir, "fake.file")).should be_nil
37
+ end
38
+ end
39
+ context "representing a regular expression and there is not subdirectory in the path" do
40
+ it "gives back an array of file names" do
41
+ Bio::Ngs::FS.files(File.join(@data_dir, "*reference*")).should =~ [File.join(@data_dir, "test-filtered-reference.fastq.gz"), File.join(@data_dir, "test-merged-reference.fastq.gz")]
42
+ end
43
+ end
44
+ context "representing a regular expression and there are subdirectories in the path" do
45
+ it "gives back an array of file names without single subdirectories names" do
46
+ Bio::Ngs::FS.files(File.join(@data_dir,"../", "*spec*")).should =~ %w(converter_qseq_spec.rb cufflinks_spec.rb
47
+ quality_spec.rb sff_extract_spec.rb spec_helper.rb
48
+ tophat_spec.rb utils_spec.rb).map{|item| File.expand_path(File.join(@data_dir,"../", item)) }
49
+ end
50
+ end
51
+ context "representing a regular expression and there are subdirectories in the path to be traversed" do
52
+ it "gives back an array of file names without single subdirectories names" do
53
+ Bio::Ngs::FS.files(File.join(@data_dir,"../", "**/*.fastq")).should =~ %w(s_1_1_1108_qseq.fastq test.fastq).map{|item| File.expand_path(File.join(@data_dir, item))}
54
+ end
55
+ end
56
+ context "representing the local directory lib" do
57
+ it "gives back an array of file names in it" do
58
+ Bio::Ngs::FS.files("lib").should =~ %w(bio-ngs.rb development_tasks.rb enumerable.rb wrapper.rb).map{|item| File.expand_path(File.join(@data_dir,"../../lib/", item))}
59
+ end
60
+ end
61
+ context "representing the local directory lib with a specific suffix" do
62
+ it "gives back an array of file names in lib with suffix spec.rb" do
63
+ Bio::Ngs::FS.files("spec/fixture", ".fastq").should =~ %w(test.fastq s_1_1_1108_qseq.fastq).map{|item| File.expand_path(File.join(@data_dir, item))}
64
+ end
65
+ end
66
+ end
67
+ end #.files
68
+
69
+
70
+ end #File System utilities for BioNGS
@@ -0,0 +1,52 @@
1
+ # fastq_spec.rb
2
+ #require 'bio/ngs/illumina/fastq'
3
+ @TestDirectory = File.expand_path(File.join(File.dirname(__FILE__) + '/../../../'))
4
+
5
+ require File.expand_path(File.join(@TestDirectory, 'spec_helper'))
6
+
7
+
8
+ describe "Illumina Fastq compressed with Gzip" do
9
+
10
+ before(:each) do
11
+ @data_dir = File.join(File.expand_path(File.join(File.dirname(__FILE__) + '/../../../')), 'fixture')
12
+ end
13
+
14
+
15
+ describe Bio::Ngs::Illumina::FastqGz, "::gets_uncompressed" do
16
+ it "returns reads from Illumina fastq compressed archive" do
17
+ ftest=File.join(@data_dir, 'test.fastq.gz')
18
+ n_reads = Bio::Ngs::Illumina::FastqGz.gets_uncompressed(ftest) do |read_header, reader_seq, read_splitter, read_qual|
19
+ read_header
20
+ end
21
+ n_reads.should be 10
22
+ end
23
+ end
24
+
25
+ describe Bio::Ngs::Illumina::FastqGz, "::gets_filtered" do
26
+ it "returns the filterd reads from Illumina" do
27
+ reads_header = ""
28
+ ftest=File.join(@data_dir, 'test.fastq.gz')
29
+ n_reads = Bio::Ngs::Illumina::FastqGz.gets_filtered(ftest) do |read_header, reader_seq, read_splitter, read_qual|
30
+ reads_header+=read_header
31
+ end
32
+ reads_header.should eq "@H125:125:D0C0DACXX:5:1307:20682:66201 1:N:0:ATCACG\n@H125:125:D0C0DACXX:5:1307:20749:66215 1:N:0:ATCACG\n@H125:125:D0C0DACXX:5:1307:20707:66224 1:N:0:ATCACG\n@H125:125:D0C0DACXX:5:1307:20846:66039 1:N:0:ATCACG\n@H125:125:D0C0DACXX:5:1307:20878:66172 1:N:0:ATCACG\n@H125:125:D0C0DACXX:5:1307:20854:66177 1:N:0:ATCACG\n@H125:125:D0C0DACXX:5:1307:20830:66194 1:N:0:ATCACG\n@H125:125:D0C0DACXX:5:1307:20773:66233 1:N:0:ATCACG\n@H125:125:D0C0DACXX:5:1307:21088:66002 1:N:0:ATCACG\n"
33
+ n_reads.should be 9
34
+ end
35
+ end
36
+
37
+ describe Bio::Ngs::Illumina::FastqGz, "::gets_compressed" do
38
+ it "returns compressed reads by Gzip" do
39
+ reads=[]
40
+ ftest=File.join(@data_dir, 'test.fastq.gz')
41
+ ftest_filtered=File.join(@data_dir, 'test-filtered.fastq.gz')
42
+ Bio::Ngs::Illumina::FastqGz.gets_compressed(ftest_filtered) do |compress|
43
+ Bio::Ngs::Illumina::FastqGz.gets_filtered(ftest) do |read_header, reader_seq, read_splitter, read_qual|
44
+ compress.write(read_header + reader_seq + read_splitter + read_qual)
45
+ end
46
+ end #compress
47
+ #TODO: test
48
+ end
49
+ end
50
+
51
+
52
+ end #"Illumina Fastq compressed with Gzip"
@@ -0,0 +1,21 @@
1
+ # illumina_spec.rb
2
+ @TestDirectory = File.expand_path(File.join(File.dirname(__FILE__) + '/../../../'))
3
+
4
+ require File.expand_path(File.join(@TestDirectory, 'spec_helper'))
5
+
6
+
7
+ describe "Illumina" do
8
+
9
+ before(:each) do
10
+ @data_dir = File.join(File.expand_path(File.join(File.dirname(__FILE__) + '/../../../../')), 'test', 'data')
11
+ end
12
+
13
+
14
+ describe Bio::Ngs::Illumina, ".build" do
15
+ it "returns an array of projects" do
16
+ projects = Bio::Ngs::Illumina.build(@data_dir)
17
+ projects.should be nil
18
+ end
19
+ end
20
+
21
+ end #"Illumina Fastq compressed with Gzip"
File without changes
File without changes
File without changes
@@ -0,0 +1,25 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+ require 'thor/base'
3
+
4
+ describe Filter do
5
+ describe "#by_list" do
6
+ it 'finds rows with first column equal to TCONS_00000005 or TCONS_00000010' do
7
+ table = File.expand_path(File.dirname(__FILE__) + '/fixture/table_filter_source.tsv')
8
+ list = File.expand_path(File.dirname(__FILE__) + '/fixture/table_filter_list_first_column.txt')
9
+ filter = Filter.new
10
+
11
+ data = capture(:stdout){filter.invoke(:by_list, [table, list], :skip_table_header => true, :skip_list_header => false, :zero_index_system=>true)}
12
+ data.should == "TCONS_00000005 = uc001aaq.1 XLOC_000003 QUERTY,JIM - chr1:321083-321114 31 - 0 0 0 OK 0 0 0 OK 0 0 0 OK\nTCONS_00000010 = uc010nxu.1 XLOC_000006 OR4F16 - chr1:367658-368595 937 - 0 0 0 OK 0 0 0 OK 9.00455 0 27.0137 OK\n"
13
+ end
14
+
15
+ it 'finds rows with 5th column equal to JIM or WATSON or SAMD11' do
16
+ table = File.expand_path(File.dirname(__FILE__) + '/fixture/table_filter_source.tsv')
17
+ list = File.expand_path(File.dirname(__FILE__) + '/fixture/table_filter_list.txt')
18
+ filter = Filter.new
19
+
20
+ data = capture(:stdout){filter.invoke(:by_list, [table, list], :skip_table_header => true, :skip_list_header => false, :zero_index_system=>true, :tablekey=>4, :in_column_delimiter=>',')}
21
+ data.should == "TCONS_00000005 = uc001aaq.1 XLOC_000003 QUERTY,JIM - chr1:321083-321114 31 - 0 0 0 OK 0 0 0 OK 0 0 0 OK\nTCONS_00000014 = uc001abb.2 XLOC_000010 CRICK,WATSON - chr1:568843-568912 69 - 0 0 0 OK 0 0 0 OK 0 0 0 OK\nTCONS_00000023 = uc001abv.1 XLOC_000015 SAMD11 TSS7 chr1:860529-894679 490 - 1.40488 0 10.5489 OK 3.5127 0 12.9469 OK 372.514 0 4986.76 OK\nTCONS_00000024 = uc001abw.1 XLOC_000015 SAMD11 TSS8 chr1:860529-894679 2554 - 2.92757 0.0526766 5.80247 OK 2.54641 0 5.1809 OK 64.8329 0 645.748 OK\nTCONS_00000025 = uc001abx.1 XLOC_000015 SAMD11 TSS9 chr1:860529-894679 2121 - 7.77732 2.80074 12.7539 OK 45.2404 11.7902 78.6907 OK 176.15 0 750.086 OK\n"
22
+ end
23
+
24
+ end
25
+ end
@@ -0,0 +1,3 @@
1
+ JIM
2
+ WATSON
3
+ SAMD11
@@ -0,0 +1,2 @@
1
+ TCONS_00000005
2
+ TCONS_00000010
@@ -0,0 +1,44 @@
1
+ tracking_id class_code nearest_ref_id gene_id gene_short_name tss_id locus length coverage hESC_FPKM hESC_conf_lo hESC_conf_hi hESC_status Fibroblasts_FPKM Fibroblasts_conf_lo Fib
2
+ roblasts_conf_hi Fibroblasts_status iPS_FPKM iPS_conf_lo iPS_conf_hi iPS_status
3
+ TCONS_00000001 = uc001aaa.3 XLOC_000001 - TSS1 chr1:11873-29961 1652 - 0 0 0 OK 11.9107 3.85498 19.9665 OK 9.5637 0 23.6841 LOWDATA
4
+ TCONS_00000002 = uc010nxq.1 XLOC_000001 - TSS1 chr1:11873-29961 1488 - 0.723836 0 3.01108 OK 0 0 8.55378 OK 32.9344 17.9313 47.9376 OK
5
+ TCONS_00000003 = uc010nxr.1 XLOC_000001 - TSS1 chr1:11873-29961 1595 - 0 0 0 OK 4.49036 0 12.71 LOWDATA 11.5691 0 25.9784 LOWDATA
6
+ TCONS_00000004 = uc001aal.1 XLOC_000002 OR4F5 - chr1:69090-70008 918 - 0 0 0 OK 0 0 0 OK 0 0 0 OK
7
+ TCONS_00000005 = uc001aaq.1 XLOC_000003 QUERTY,JIM - chr1:321083-321114 31 - 0 0 0 OK 0 0 0 OK 0 0 0 OK
8
+ TCONS_00000006 = uc001aar.1 XLOC_000004 - - chr1:321145-321223 78 - 1.2e+06 162569 2.23743e+06 OK 22616.4 0 158315 OK 0 0 0 OK
9
+ TCONS_00000007 = uc009vjk.2 XLOC_000005 - TSS2 chr1:322036-328580 2750 - 595.704 503.466 687.941 OK 26.4917 1.43941 51.544 OK 511.421 215.823 807.019 OK
10
+ TCONS_00000008 = uc001aau.2 XLOC_000005 - TSS3 chr1:322036-328580 4369 - 543.316 466.279 620.352 OK 3.44334 0 9.11684 OK 160.528 1.55069 319.506 OK
11
+ TCONS_00000009 = uc001aav.3 XLOC_000005 - TSS3 chr1:322036-328580 4272 - 0.0145297 0 0.759868 OK 11.2294 0.0930141 22.3658 OK 272.359 82.1678 462.551 OK
12
+ TCONS_00000010 = uc010nxu.1 XLOC_000006 OR4F16 - chr1:367658-368595 937 - 0 0 0 OK 0 0 0 OK 9.00455 0 27.0137 OK
13
+ TCONS_00000011 = uc001aax.1 XLOC_000007 - TSS4 chr1:420205-421839 802 - 0 0 0 OK 0 0 0 OK 0 0 0 OK
14
+ TCONS_00000012 = uc001aaz.2 XLOC_000008 - - chr1:566461-568045 1584 - 0 0 0 OK 0 0 0 OK 0 0 0 OK
15
+ TCONS_00000013 = uc001aba.1 XLOC_000009 - - chr1:568148-568842 694 - 0 0 0 OK 0 0 0 OK 0 0 0 OK
16
+ TCONS_00000014 = uc001abb.2 XLOC_000010 CRICK,WATSON - chr1:568843-568912 69 - 0 0 0 OK 0 0 0 OK 0 0 0 OK
17
+ TCONS_00000015 = uc001abc.2 XLOC_000011 - - chr1:569326-570349 1023 - 0 0 0 OK 0 0 0 OK 0 0 0 OK
18
+ TCONS_00000016 = uc009vjn.1 XLOC_000012 - TSS5 chr1:763063-789740 510 - 0 0 0 OK 34.9207 0 96.2612 OK 17.4388 0 77.2131 OK
19
+ TCONS_00000017 = uc001abp.1 XLOC_000012 - TSS5 chr1:763063-789740 854 - 0 0 0 OK 0 0 42.2696 OK 0 0 0 OK
20
+ TCONS_00000018 = uc001abq.1 XLOC_000012 - TSS5 chr1:763063-789740 701 - 133.009 85.2827 180.735 OK 13.2916 0 61.5645 LOWDATA 0 0 0 OK
21
+ TCONS_00000019 = uc009vjo.1 XLOC_000012 - TSS5 chr1:763063-789740 517 - 0 0 0 OK 36.6304 0 97.0895 OK 114.161 0 230.929 OK
22
+ TCONS_00000020 = uc001abr.1 XLOC_000012 - TSS5 chr1:763063-789740 1543 - 163.639 123.583 203.694 OK 196.063 166.543 225.583 OK 206.249 62.4043 350.094 OK
23
+ TCONS_00000021 = uc001abs.2 XLOC_000013 - - chr1:791897-794579 2682 - 46.0811 34.122 58.0403 OK 70.4959 22.1574 118.834 OK 21.8276 2.67005 40.9851 OK
24
+ TCONS_00000022 = uc001abu.1 XLOC_000014 - TSS6 chr1:846814-850328 3043 - 45.1192 33.5358 56.7025 OK 0.515295 0 1.48694 OK 21.3767 3.02453 39.7289 OK
25
+ TCONS_00000023 = uc001abv.1 XLOC_000015 SAMD11 TSS7 chr1:860529-894679 490 - 1.40488 0 10.5489 OK 3.5127 0 12.9469 OK 372.514 0 4986.76 OK
26
+ TCONS_00000024 = uc001abw.1 XLOC_000015 SAMD11 TSS8 chr1:860529-894679 2554 - 2.92757 0.0526766 5.80247 OK 2.54641 0 5.1809 OK 64.8329 0 645.748 OK
27
+ TCONS_00000025 = uc001abx.1 XLOC_000015 SAMD11 TSS9 chr1:860529-894679 2121 - 7.77732 2.80074 12.7539 OK 45.2404 11.7902 78.6907 OK 176.15 0 750.086 OK
28
+ TCONS_00000026 = uc001aca.1 XLOC_000016 KLHL17 TSS10 chr1:895966-901095 2560 - 298.022 237.764 358.279 OK 122.511 40.1187 204.904 OK 168.624 44.5393 292.709 OK
29
+ TCONS_00000027 = uc001acb.1 XLOC_000016 KLHL17 TSS11 chr1:895966-901095 955 - 278.216 184.728 371.703 OK 52.7344 0 302.971 OK 150.602 0 392.283 OK
30
+ TCONS_00000028 = uc001acc.1 XLOC_000016 KLHL17 TSS12 chr1:895966-901095 2003 - 353.647 280.621 426.674 OK 87.9438 20.0799 155.808 OK 70.8841 0 183.538 OK
31
+ TCONS_00000029 = uc010nyb.1 XLOC_000016 KLHL17 TSS13 chr1:895966-901095 1149 - 301.147 217.831 384.464 OK 54.9418 0 239.78 OK 81.363 0 282.265 OK
32
+ TCONS_00000030 = uc001acd.2 XLOC_000017 PLEKHN1 TSS14 chr1:901876-910482 2398 - 20.9859 6.94352 35.0283 OK 4.71542 0 22.2944 OK 15.2268 1.51879 28.9348 OK
33
+ TCONS_00000031 = uc001ace.2 XLOC_000017 PLEKHN1 TSS14 chr1:901876-910482 2554 - 16.0979 3.29643 28.8994 OK 29.6547 2.71604 56.5934 OK 0.000219517 0 5.22308 OK
34
+ TCONS_00000032 = uc001acf.2 XLOC_000017 PLEKHN1 TSS14 chr1:901876-910482 2293 - 0 0 0 OK 16.1706 0 35.9766 OK 0 0 0 OK
35
+ TCONS_00000033 = uc001acj.3 XLOC_000018 ISG15 TSS15 chr1:948846-949915 662 - 1610.23 1305.56 1914.9 OK 3203.25 1608.81 4797.68 OK 1484.47 595.792 2373.14 OK
36
+ TCONS_00000034 = uc001ack.1 XLOC_000019 AGRN TSS16 chr1:955502-991492 7319 - 3024.77 1584.21 4465.34 OK 2468.9 1169.65 3768.16 OK 422.846 233.227 612.465 OK
37
+ TCONS_00000035 = uc009vjs.1 XLOC_000020 - TSS17 chr1:995082-1001833 673 - 1.54186 0 7.69648 OK 2.84929 0 8.58809 OK 6.59269 0 33.843 OK
38
+ TCONS_00000036 = uc001acl.1 XLOC_000020 - TSS17 chr1:995082-1001833 971 - 49.4519 29.6823 69.2214 OK 46.8237 5.06013 88.5873 OK 53.6594 10.0201 97.2987 OK
39
+ TCONS_00000037 = uc001acv.2 XLOC_000021 - TSS18 chr1:1072396-1079432 1616 - 2.67097 0 6.3719 OK 0 0 0 OK 0 0 0 OK
40
+ TCONS_00000038 = uc001acw.2 XLOC_000022 - - chr1:1102483-1102578 95 - 0 0 0 OK 0 0 0 OK 0 0 0 OK
41
+ TCONS_00000039 = uc010nye.1 XLOC_000023 - - chr1:1103242-1103332 90 - 0 0 0 OK 0 0 0 OK 0 0 0 OK
42
+ TCONS_00000040 = uc010nyf.1 XLOC_000024 - - chr1:1104384-1104467 83 - 0 0 0 OK 0 0 0 OK 0 0 0 OK
43
+ TCONS_00000041 = uc001acy.2 XLOC_000025 TTLL10 TSS19 chr1:1108435-1133313 2259 - 15.4348 7.53054 23.3391 OK 0 0 0 OK 0 0 0 OK
44
+ TCONS_00000042 = uc010nyg.1 XLOC_000025 TTLL10 TSS19 chr1:1108435-1133313 2278 - 0.0037386 0 1.45822 OK 0 0 0 OK 0 0 0 OK
@@ -0,0 +1,117 @@
1
+ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
2
+ require 'thor/base'
3
+ require 'meta'
4
+
5
+ describe do
6
+ context Meta::Data do
7
+
8
+ mf = Meta::Data.new('filename.rb', {type:'generic', user:'duck', group:'workers'})
9
+
10
+ it 'has name' do
11
+ mf.name.should == 'filename.rb'
12
+ end #name
13
+
14
+ it 'has tags' do
15
+ mf.metadata.should == {type:'generic', user:'duck', group:'workers', :name => "filename.rb"}
16
+ end #name
17
+
18
+ end #File
19
+
20
+
21
+
22
+ describe Meta::Pool do
23
+ before(:each) do
24
+ @mf = Meta::Data.new('filename.rb', {type:'generic', user:'duck', group:'workers'})
25
+ @mp = Meta::Pool.new(:my_pool)
26
+ end
27
+
28
+ describe "instance variables" do
29
+ it 'has name' do
30
+ @mp.name.should == :my_pool
31
+ end
32
+
33
+ it 'has a pool' do
34
+ @mp.pool.should_not be nil
35
+ end
36
+ end
37
+
38
+ describe "#add" do
39
+ it 'adds a file to the pool' do
40
+ @mp.add @mf
41
+ @mp.pool.first[1].should == Meta::Data.new("filename.rb", {:type=>"generic", :user=>"duck", :group=>"workers"})
42
+ end
43
+ end
44
+
45
+ describe '#get_by_name' do
46
+ it do
47
+ @mp.add @mf
48
+ @mp.get_by_name('filename.rb').should == Meta::Data.new("filename.rb", {:type=>"generic", :user=>"duck", :group=>"workers"})
49
+ end
50
+ end
51
+
52
+ describe '#get_by_tag' do
53
+ it do
54
+ @mp.add @mf
55
+ @mp.add Meta::Data.new('filename_spec.rb', {type:'spec', user:'donald', group:'workers'})
56
+ @mp.get(:type).pool.should == @mp.pool
57
+ #[ Meta::Data.new('filename.rb', {type:'generic', user:'duck', group:'workers'}), Meta::Data.new('filename_spec.rb', {type:'spec', user:'donald', group:'workers'})]
58
+ end
59
+ end
60
+
61
+ describe '#get_by_tag_and_value' do
62
+ it do
63
+ @mp.add @mf
64
+ @mp.add Meta::Data.new('filename_spec.rb', {type:'spec', user:'donald', group:'workers'})
65
+ @mp.get_by_tag_and_value(:group, "workers").pool.should == @mp.pool
66
+ #[ Meta::Data.new('filename.rb', {type:'generic', user:'duck', group:'workers'}), Meta::Data.new('filename_spec.rb', {type:'spec', user:'donald', group:'workers'})]
67
+ end
68
+ end
69
+
70
+
71
+ describe "#get" do
72
+ before(:each) do
73
+ @mp.add @mf
74
+ end
75
+ it 'looks for name' do
76
+ @mp.add Meta::Data.new('filename_spec.rb', {type:'spec', user:'donald', group:'workers'})
77
+ @mp.get('filename.rb').should == Meta::Data.new('filename.rb', {type:'generic', user:'duck', group:'workers'})
78
+ end
79
+ it 'looks for tag' do
80
+ @mp.add Meta::Data.new('filename_spec.rb', {type:'spec', user:'donald', group:'workers', size:10})
81
+ @mp.get(:size).first.should == Meta::Data.new('filename_spec.rb', {type:'spec', user:'donald', group:'workers', size:10})
82
+ end
83
+ it 'looks for value' do
84
+ @mp.add Meta::Data.new('filename_spec.rb', {type:'spec', user:'donald', group:'workers'})
85
+ @mp.get("workers").pool.should == @mp.pool
86
+ #[ Meta::Data.new('filename.rb', {type:'generic', user:'duck', group:'workers'}),
87
+ #Meta::Data.new('filename_spec.rb', {type:'spec', user:'donald', group:'workers'})]
88
+ end
89
+ end
90
+
91
+
92
+ describe "#get_by_value" do
93
+ before(:each) do
94
+ @mp.add @mf
95
+ end
96
+ it 'gets only one file' do
97
+ mft = Meta::Data.new('filename_spec.rb', {type:'spec', user:'donald', group:'workers'})
98
+ @mp.add mft
99
+ @mp.get_by_value("donald").first.should == mft
100
+ end
101
+
102
+ it 'gets multiple files' do
103
+ mft = Meta::Data.new('filename_spec.rb', {type:'spec', user:'donald', group:'workers'})
104
+ @mp.add mft
105
+ @mp.get_by_value("workers").pool.should == @mp.pool #[ Meta::Data.new('filename.rb', {type:'generic', user:'duck', group:'workers'}), Meta::Data.new('filename_spec.rb', {type:'spec', user:'donald', group:'workers'})]
106
+ end
107
+
108
+ end
109
+
110
+ # it 'gets a file by one of its tag name and value' do
111
+ # should fail
112
+ # #mp.add Meta::File.new('filename_spec.rb', {type:'spec', user:'donald', group:'workers'})
113
+ # #mp.get('filename.rb').should == Meta::File.new("filename.rb", {:type=>"generic", :user=>"duck", :group=>"workers"})
114
+ # end
115
+
116
+ end #Pool
117
+ end #Meta
@@ -25,7 +25,7 @@ ARGV.clear
25
25
  Thor::Base.shell = Thor::Shell::Basic
26
26
 
27
27
  # Load fixtures
28
- %w(bwa history project quality rna sff_extract).each do |task|
28
+ %w(bwa history project quality rna sff_extract filter).each do |task|
29
29
  load File.join(File.dirname(__FILE__), "..", "lib", "tasks", "#{task}.thor" )
30
30
  end
31
31