Class: Bio::CdHitReport

Inherits:
Object
  • Object
show all
Defined in:
lib/bio-cd-hit-report/cd-hit-report.rb

Instance Method Summary collapse

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_membersObject



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_membersObject



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_clustersObject



15
16
17
# File 'lib/bio-cd-hit-report/cd-hit-report.rb', line 15

def total_clusters
  cluster_objs.size
end