forgi 2.0.0 documentation

«  forgi.utilities.graph module   ::   Contents   ::   forgi.utilities.observedDict module  »

forgi.utilities.numbered_dotbracket module

class forgi.utilities.numbered_dotbracket.NumberedDotbracket(dotbracket_str='', residue_numbers=None, helix_ends=None)[source]
Parameters:
  • dotbracket_str – A string
  • numbers (residue) – A list of integers or forgi RESIDS. Same length as dotbracket_str
  • helix_ends
    If a basepair represents a helix or
    stem with missing residues, The helix end give the last/ first missing(condensed) residue number which is represented by this basepair. I.e. the basepair of the helix that is at the 3’ end of the forward strand. It is a list with the same length as residue_numers.
    • Example 1. Every nucleotide only represents itself::
      dotbracket_str (((..))) residue numbers 12345678 helix_ends 12345678
    • Example 2. The same helix as Ex. 1, now condensed.
      The helix 1-3,6-8 is represented by the basepair 1-8:: dotbracket_str (..) residue numbers 1458 helix_ends 3456 Here the nucleotide 1 represents one strand of the helix, going from 1 to 3. The nucleotide 8 represents the other strand, going from 6 to 8.

    The value for helix ends for unpaired nucleotides is undefined and should ignored.

condensed(remove_helices_shorter_than=3)[source]

Return input with consecutive basepairs remove_unpaired

Parameters:
  • dotbracket – A dotbracket string
  • residue_numbers – A list of residue numbers, with same length as dotbracket
count(pattern)[source]
without_short_helices(min_length)[source]

Check the stems if the correspond to the minimum length given by the Users

Parameters:min_length – minimum stem length
without_substr(pattern)[source]

Return number of occurrences of pattern and a NumberedDotbracket all occurrences removed.

Occurrences of the pattern are removed recursicvely. E.g.: The pattern “ab” will be removed from “aabb” two times. E.g.: two occurrences of “([)]” will be removed from “(([)][)]”

without_unpaired()[source]

Return NumberedDotbracket with dots removed

Parameters:
  • dotbracket – A dotbracket string
  • residue_numbers – A list of residue numbers, with same length as dotbracket

«  forgi.utilities.graph module   ::   Contents   ::   forgi.utilities.observedDict module  »