forgi 2.0.0 documentation

«  forgi.graph.residue module   ::   Contents   ::   forgi.graph.transform_graphs module  »

forgi.graph.sequence module

class forgi.graph.sequence.MissingResidue(resid, res_name)[source]

Bases: object

Parameters:
  • resid – A fgr.RESID instance of a string.
  • resname – A string. Probably one of “AUGC”.
classmethod from_bg_fields(parts)[source]

Used during loading of the bg_file.

Parameters:parts – A list of strings. If the first is not “missing”, None is returned
Returns:Either a MissingResidue instance or None
to_bg_string()[source]
class forgi.graph.sequence.SeqidList(arg)[source]

Bases: _abcoll.Sequence

index(elem)[source]
class forgi.graph.sequence.Sequence(seq, seqids, missing_residues=None, modifications=None)[source]

Bases: object

A class holding the RNA sequence.

It supports 2 indexing conventions (see below), missing residues and modified nucleotids.

The two indexing conventions are:

  • 1-based indexing into the sequence for which structure information is available This uses indices of type integer. Integer based indexing can not address missing residues!
  • Indexing using PDB-style numbers (They can start at any positive or negative number and may contain insertion codes or gaps.) This uses indices of type fgr.RESID PDB-Style indices may address missing residues (Reidues for which only sequence but no structure information is present).
Parameters:
  • seq – A string
  • missing_residues – A list of dictionaries with the following keys: “res_name”, “chain”, “ssseq”, “insertion”
backbone_breaks_after

Breakpoints as 1-based indices

define_length(d)[source]
get_bg_str()[source]

Used during bg-file creation

is_valid()[source]
iter_modifications()[source]

Iter over tuples seq_id, modified residue code

iter_resids(start, stop, include_missing)[source]
to_integer(resid)[source]
to_resid(i)[source]
with_missing

Allows slices with missing residues!

with_modifications
class forgi.graph.sequence.SequenceLoader[source]

Load the sequence-related part during loading of bg-files

consume_fields(parts)[source]

Read one line from the forgi file.

Returns True, if the line was used/ understood, False otherwise

sequence
forgi.graph.sequence.to_0_based(key)[source]

«  forgi.graph.residue module   ::   Contents   ::   forgi.graph.transform_graphs module  »