Class: Bio::CdHitReport
- Inherits:
-
Object
- Object
- Bio::CdHitReport
- Defined in:
- lib/bio-cd-hit-report/cd-hit-report.rb
Instance Method Summary collapse
- #each_cluster(&block) ⇒ Object
- #get_cluster(name) ⇒ Object
-
#initialize(file) ⇒ CdHitReport
constructor
A new instance of CdHitReport.
- #max_members ⇒ Object
- #min_members ⇒ Object
- #total_clusters ⇒ Object
Constructor Details
#initialize(file) ⇒ CdHitReport
Returns a new instance of CdHitReport.
7 8 9 |
# File 'lib/bio-cd-hit-report/cd-hit-report.rb', line 7 def initialize(file) @file = file end |
Instance Method Details
#each_cluster(&block) ⇒ Object
11 12 13 |
# File 'lib/bio-cd-hit-report/cd-hit-report.rb', line 11 def each_cluster(&block) cluster_objs.each(&block) end |
#get_cluster(name) ⇒ Object
19 20 21 |
# File 'lib/bio-cd-hit-report/cd-hit-report.rb', line 19 def get_cluster(name) cluster_objs.select{|cluster| cluster.name == name.to_s}.pop.members end |
#max_members ⇒ Object
23 24 25 |
# File 'lib/bio-cd-hit-report/cd-hit-report.rb', line 23 def max_members cluster_objs.map{|c|c.size}.max end |
#min_members ⇒ Object
27 28 29 |
# File 'lib/bio-cd-hit-report/cd-hit-report.rb', line 27 def min_members cluster_objs.map{|c| c.size}.min end |
#total_clusters ⇒ Object
15 16 17 |
# File 'lib/bio-cd-hit-report/cd-hit-report.rb', line 15 def total_clusters cluster_objs.size end |