Class: Bio::Ngs::Illumina::Project
- Inherits:
-
Meta::Pool
- Object
- Meta::Data
- Meta::Pool
- Bio::Ngs::Illumina::Project
- Defined in:
- lib/bio/ngs/illumina/project.rb
Instance Attribute Summary collapse
-
#root_dir ⇒ Object
Returns the value of attribute root_dir.
-
#sample_sheet ⇒ Object
Returns the value of attribute sample_sheet.
-
#samples ⇒ Object
Sets the attribute samples.
Attributes inherited from Meta::Pool
Attributes inherited from Meta::Data
Instance Method Summary collapse
-
#initialize(name, root_dir = ".") ⇒ Project
constructor
A new instance of Project.
- #path ⇒ Object
- #samples_path ⇒ Object
- #to_json(*a) ⇒ Object
Methods inherited from Meta::Pool
#add, #each, #empty?, #get, #get_by_name, #get_by_tag, #get_by_tag_and_value, #get_by_value, #get_down_to_childer, json_create, #names
Methods included from Enumerable
#average, #sample_variance, #standard_deviation, #sum
Methods inherited from Meta::Data
#==, #[], #has_tag?, #has_value?, json_create, #name, #name=
Constructor Details
#initialize(name, root_dir = ".") ⇒ Project
Returns a new instance of Project.
11 12 13 14 15 16 |
# File 'lib/bio/ngs/illumina/project.rb', line 11 def initialize(name, root_dir=".") super(name) @sample_sheet = nil @root_dir = root_dir [:path]=root_dir end |
Instance Attribute Details
#root_dir ⇒ Object
Returns the value of attribute root_dir.
10 11 12 |
# File 'lib/bio/ngs/illumina/project.rb', line 10 def root_dir @root_dir end |
#sample_sheet ⇒ Object
Returns the value of attribute sample_sheet.
10 11 12 |
# File 'lib/bio/ngs/illumina/project.rb', line 10 def sample_sheet @sample_sheet end |
#samples=(value) ⇒ Object
Sets the attribute samples
10 11 12 |
# File 'lib/bio/ngs/illumina/project.rb', line 10 def samples=(value) @samples = value end |
Instance Method Details
#path ⇒ Object
20 21 22 |
# File 'lib/bio/ngs/illumina/project.rb', line 20 def path File.join(@root_dir, (name=~/Undetermined_indices/ ? name : "Project_#{name}")) end |
#samples_path ⇒ Object
24 25 26 27 28 |
# File 'lib/bio/ngs/illumina/project.rb', line 24 def samples_path @samples.each_key.map do |sample_name| @samples[sample_name].filenames_paths end.flatten end |
#to_json(*a) ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/bio/ngs/illumina/project.rb', line 29 def to_json(*a) { "json_class" => self.class.name, "name" => name, "sample_sheet" => sample_sheet, "samples" => samples#each_key.map{|k| samples[k].to_json } }.to_json(*a) end |