Sha256: 348442b575c6b4735982612bfb9cda81769d7d84054adeb30e7781986b6cb561

Contents?: true

Size: 1.35 KB

Versions: 17

Compression:

Stored size: 1.35 KB

Contents

########################################################
# Author: Almudena Bocinos Rioboo                      
# 
# Defines the class Sequence's attribute                                                     
# 
########################################################

class Sequence
  #storages the name and the contains from fasta sequence
  def initialize(seq_name,seq_fasta,seq_qual, seq_comment = '')     
      
      @seq_fasta=seq_fasta
      @seq_name=seq_name
      @seq_qual=seq_qual           
      @seq_comment = seq_comment
      
      @seq_rejected=false   
      @seq_repeated=false
      @seq_reversed=false 
      
      @seq_rejected_by_message=''
      
      @ns_present = ns_present? 
      @xs_present = xs_present?    
      
      
      
      # puts "INIT SEQ >>>> #{seq_name} #{seq_specie}"
      
  end
  
  attr_accessor :seq_name, :seq_fasta, :seq_qual, :seq_comment , :seq_rejected, :seq_repeated , :seq_reversed 
  attr_accessor :seq_rejected_by_message
  
  def ns_present?
    return (@seq_fasta.index('N')  != nil)
  end
  
  def xs_present?
    return (@seq_fasta.index('X') != nil)
  end
  
  def seq_is_long_enough(seq_min_length)
    return (@seq_fasta.length>=seq_min_length)
  end
  
  def to_fasta
  		return ">"+@seq_name.to_s+"\n"+@seq_fasta  
  end
  
  def to_qual
  		return ">"+@seq_name.to_s+"\n"+"#{@seq_qual}"  
  end
  
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
seqtrimnext-2.0.51 lib/seqtrimnext/classes/sequence.rb
seqtrimnext-2.0.50 lib/seqtrimnext/classes/sequence.rb
seqtrimnext-2.0.49 lib/seqtrimnext/classes/sequence.rb
seqtrimnext-2.0.48 lib/seqtrimnext/classes/sequence.rb
seqtrimnext-2.0.46 lib/seqtrimnext/classes/sequence.rb
seqtrimnext-2.0.45 lib/seqtrimnext/classes/sequence.rb
seqtrimnext-2.0.42 lib/seqtrimnext/classes/sequence.rb
seqtrimnext-2.0.41 lib/seqtrimnext/classes/sequence.rb
seqtrimnext-2.0.39 lib/seqtrimnext/classes/sequence.rb
seqtrimnext-2.0.38 lib/seqtrimnext/classes/sequence.rb
seqtrimnext-2.0.36 lib/seqtrimnext/classes/sequence.rb
seqtrimnext-2.0.35 lib/seqtrimnext/classes/sequence.rb
seqtrimnext-2.0.33 lib/seqtrimnext/classes/sequence.rb
seqtrimnext-2.0.32 lib/seqtrimnext/classes/sequence.rb
seqtrimnext-2.0.31 lib/seqtrimnext/classes/sequence.rb
seqtrimnext-2.0.30 lib/seqtrimnext/classes/sequence.rb
seqtrimnext-2.0.29 lib/seqtrimnext/classes/sequence.rb