Class: Seq

Inherits:
Object
  • Object
show all
Defined in:
lib/full_lengther_next/cdhit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, comments, seq_fasta, master) ⇒ Seq

master = more representative sequence on a cluster



5
6
7
8
9
10
11
# File 'lib/full_lengther_next/cdhit.rb', line 5

def initialize(name, comments, seq_fasta, master) #master = more representative sequence on a cluster
	@name = name
	@comments = comments
	@seq_fasta = seq_fasta
	@db= parse_db(name, comments)
	@master = master
end

Instance Attribute Details

#commentsObject

Returns the value of attribute comments.



4
5
6
# File 'lib/full_lengther_next/cdhit.rb', line 4

def comments
  @comments
end

#dbObject

Returns the value of attribute db.



4
5
6
# File 'lib/full_lengther_next/cdhit.rb', line 4

def db
  @db
end

#masterObject

Returns the value of attribute master.



4
5
6
# File 'lib/full_lengther_next/cdhit.rb', line 4

def master
  @master
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/full_lengther_next/cdhit.rb', line 4

def name
  @name
end

#seq_fastaObject

Returns the value of attribute seq_fasta.



4
5
6
# File 'lib/full_lengther_next/cdhit.rb', line 4

def seq_fasta
  @seq_fasta
end

Instance Method Details

#parse_db(name, comments) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/full_lengther_next/cdhit.rb', line 13

def parse_db(name, comments)
	db=nil
	if name =~ /^[sp]/ || comments =~ /^[sp]/
		db='sp'
	elsif comments =~ /^[tr]/
		db='tr'
	end
	return db
end

#to_sObject



23
24
25
# File 'lib/full_lengther_next/cdhit.rb', line 23

def to_s
	return ">#{@name} #{@comments}\n#{@seq_fasta}"
end