parameters: (self, query_seq, min_score=0, min_len=0)
return_statement: return py_result
docstring: Perform the alignment of query against the object reference sequence
          @param query_seq Query sequence as a python string (case insensitive)
          @param min_score Minimal score of match. None will be return in case of filtering out
          @param min_len Minimal length of match. None will be return in case of filtering out
          @return A SSWAlignRes Object containing informations about the alignment.
docstring_summary: Perform the alignment of query against the object reference sequence
docstring_tokens: Perform the alignment of query against the object reference sequence
function: def align(self, query_seq, min_score=0, min_len=0):
          """
          Perform the alignment of query against the object reference sequence
          @param query_seq Query sequence as a python string (case insensitive)
          @param min_score Minimal score of match. None will be return in case of filtering out
          @param min_len Minimal length of match. None will be return in case of filtering out
          @return A SSWAlignRes Object containing informations about the alignment.
          """
          # Determine the size of the ref sequence and cast it in a c type integer matrix
          query_len = len(query_seq)
          query_seq = self._DNA_to_int_mat (query_seq, query_len)
  
          # Create the query profile using the query sequence
          profile = self.ssw_init(query_seq, # Query seq in c type integers
                                  c_int32(query_len), # Length of Queryseq in bites
                                  self.mat, # Score matrix
                                  5, # Square root of the number of elements in mat
                                  2) # flag = no estimation of the best alignment score
  
          # Setup the mask_len parameters = distance between the optimal and suboptimal alignment
          # if < 15, the function will NOT return the suboptimal alignment information
  
          if query_len > 30:
              mask_len = query_len/2
          else:
              mask_len = 15
  
          c_result = self.ssw_align (profile, # Query profile
                                  self.ref_seq, # Ref seq in c type integers
                                  c_int32(self.ref_len), # Length of Refseq in bites
                                  self.gap_open, # Absolute value of gap open penalty
                                  self.gap_extend, # absolute value of gap extend penalty
                                  1, # Bitwise FLAG for output values = return all
                                  0, # Score filter = return all
                                  0, # Distance filter = return all
                                  mask_len) # Distance between the optimal and suboptimal alignment
  
          # Transform the Cstructure into a python object if score and lenght match the requirements
          score = c_result.contents.score
          match_len  = c_result.contents.query_end - c_result.contents.query_begin + 1
  
          if score >= min_score and match_len >= min_len:
              py_result = PyAlignRes(c_result, query_len, self.report_secondary, self.report_cigar)
          else:
              py_result = None
  
          # Free reserved space by ssw.init and ssw_init methods.
          self._init_destroy(profile)
          self._align_destroy(c_result)
  
          # Return the object
          return py_result
function_tokens: def align ( self , query_seq , min_score = 0 , min_len = 0 ) : # Determine the size of the ref sequence and cast it in a c type integer matrix query_len = len ( query_seq ) query_seq = self . _DNA_to_int_mat ( query_seq , query_len ) # Create the query profile using the query sequence profile = self . ssw_init ( query_seq , # Query seq in c type integers c_int32 ( query_len ) , # Length of Queryseq in bites self . mat , # Score matrix 5 , # Square root of the number of elements in mat 2 ) # flag = no estimation of the best alignment score # Setup the mask_len parameters = distance between the optimal and suboptimal alignment # if < 15, the function will NOT return the suboptimal alignment information if query_len > 30 : mask_len = query_len / 2 else : mask_len = 15 c_result = self . ssw_align ( profile , # Query profile self . ref_seq , # Ref seq in c type integers c_int32 ( self . ref_len ) , # Length of Refseq in bites self . gap_open , # Absolute value of gap open penalty self . gap_extend , # absolute value of gap extend penalty 1 , # Bitwise FLAG for output values = return all 0 , # Score filter = return all 0 , # Distance filter = return all mask_len ) # Distance between the optimal and suboptimal alignment # Transform the Cstructure into a python object if score and lenght match the requirements score = c_result . contents . score match_len = c_result . contents . query_end - c_result . contents . query_begin + 1 if score >= min_score and match_len >= min_len : py_result = PyAlignRes ( c_result , query_len , self . report_secondary , self . report_cigar ) else : py_result = None # Free reserved space by ssw.init and ssw_init methods. self . _init_destroy ( profile ) self . _align_destroy ( c_result ) # Return the object return py_result