code: def add_relation(self, parent, child, level, parent_func=None,
                       child_func=None):
          
          if isinstance(parent, six.string_types):
              parent = self[parent]
          if isinstance(child, six.string_types):
              child = self[child]
  
          c = self.conn.cursor()
          c.execute('''
                    INSERT INTO relations (parent, child, level)
                    VALUES (?, ?, ?)''', (parent.id, child.id, level))
  
          if parent_func is not None:
              parent = parent_func(parent, child)
              self._update(parent, c)
          if child_func is not None:
              child = child_func(parent, child)
              self._update(child, c)
  
          self.conn.commit()
          return self
docs: Manually add relations to the database.
  
          Parameters
          ----------
          parent : str or Feature instance
               Parent feature to add.
  
          child : str or Feature instance
              Child feature to add
  
          level : int
              Level of the relation.  For example, if parent is a gene and child
              is an mRNA, then you might want level to be 1.  But if child is an
              exon, then level would be 2.
  
          parent_func, child_func : callable
              These optional functions control how attributes are updated in the
              database.  They both have the signature `func(parent, child)` and
              must return a [possibly modified] Feature instance.  For example,
              we could add the child's database id as the "child" attribute in
              the parent::
  
                  def parent_func(parent, child):
                      parent.attributes['child'] = child.id
  
              and add the parent's "gene_id" as the child's "Parent" attribute::
  
                  def child_func(parent, child):
                      child.attributes['Parent'] = parent['gene_id']
  
          Returns
          -------
          FeatureDB object with new relations added.