ivy.sequtil module

ivy.sequtil.find_stop_codons(seq, pos=0)[source]

Find stop codons within sequence (in reading frame)

Parameters:
  • seq (str) – A sequence
  • pos (int) – Starting position. Defaults to 0.
Yields:

tuple – The index where the stop codon starts and which stop codon was found.

ivy.sequtil.finditer(seq, substr, start=0)[source]

Find substrings within a sequence

Parameters:
  • seq (str) – A sequence.
  • substr (str) – A subsequence to search for
  • start (int) – Starting index. Defaults to 0
Yields:

int – Starting indicies of where the substr was found in seq

ivy.sequtil.gapidx(seq, gapchar=u'-')[source]

For a sequence with gaps, calculate site positions without gaps

Parameters:
  • seq (list) – Each element of the list is one character in a sequence.
  • gapchar (str) – The character gaps are coded as. Defaults to ‘-‘
Returns:

An array where the first element corresponds to range(number of characters that are not gaps) and the second element is the indicies of all characters that are not gaps.

Return type:

array