def add_features_to_nglview(view, structure_resnums, chain_id):
    """Add select features from the selected SeqProp object to an NGLWidget view object.

    Currently parsing for:
    * Single residue features (ie. metal binding sites)
    * Disulfide bonds

    Args:
        view (NGLWidget): NGLWidget view object
        seqprop (SeqProp): SeqProp object
        structprop (StructProp): StructProp object
        chain_id (str): ID of the structure's chain to get annotation from

    """
    # Parse and store chain seq if not already stored
    if not structprop.chains.has_id(chain_id):
        structprop.parse_structure()
        if not structprop.chains.has_id(chain_id):
            raise ValueError('Chain {} not present in structure {}'.format(chain_id, structprop.id))

    if not seqprop.features:
        log.warning('{}: no stored features'.format(seqprop.id))

    # Loop through any stored features
    for f in seqprop.features:

        # Display disulfide bonds
        if f.type.lower() == 'disulfide bond':
            # TODO: double check if .start or .start + 1
            disulfide = map_seqprop_resnums_to_structprop_resnums(resnums=[f.location.start + 1, f.location.end],
                                                                  seqprop=seqprop,
                                                                  structprop=structprop,
                                                                  chain_id=chain_id,
                                                                  use_representatives=False)
            to_view = [str(x)+'.CA' for x in list(disulfide.values())]
            view.add_distance(atom_pair=[to_view], color='black')
            log.info('Disulfide bridge at residues {} & {}'.format(f.location.start + 1, f.location.end))

        # Display DNA-binding regions
        if f.type.lower() == 'dna-binding region' or f.type.lower() == 'nucleotide phosphate-binding region':
            impres = self.map_seqprop_resnums_to_structprop_resnums(resnums=[f.location.start + 1,
                                                                             f.location.end],
                                                                    seqprop=seqprop,
                                                                    structprop=structprop,
                                                                    chain_id=chain_id,
                                                                    use_representatives=use_representatives)

            # TODO: need to check if f.location.start was mapped and if not, try incrementing. or  input the list
            # of resnums, not just the start and end
            if f.location.start + 1 in impres and f.location.end in impres:
                mapped_start = impres[f.location.start + 1]
                mapped_end = impres[f.location.end]
                view.add_ball_and_stick(selection=':{} and ( {}-{} )'.format(chain_id,
                                                                             mapped_start,
                                                                             mapped_end), color='black')
                log.info('{} at sequence region {}-{}, structure residues {}-{}'.format(f.type,
                                                                                        f.location.start,
                                                                                        f.location.end,
                                                                                        mapped_start,
                                                                                        mapped_end))

        # Display other single residues
        if f.location.end - 1 == f.location.start:
            if f.type.lower() == 'sequence variant' or f.type.lower() == 'mutagenesis site':
                continue
            impres = self.map_seqprop_resnums_to_structprop_resnums(resnums=f.location.end,
                                                                    seqprop=seqprop,
                                                                    structprop=structprop,
                                                                    chain_id=chain_id,
                                                                    use_representatives=use_representatives)
            if f.location.end in impres:
                impres_mapped = impres[f.location.end]
                view.add_ball_and_stick(selection=str(impres_mapped), color='black')
                view.add_label(selection=':{} and {}'.format(chain_id, impres_mapped), label_type='res', color='black')
                log.info('{} at sequence residue {}, structure residue {}'.format(f.type, f.location.end, impres_mapped))
Add select features from the selected SeqProp object to an NGLWidget view object.

    Currently parsing for:
    * Single residue features (ie. metal binding sites)
    * Disulfide bonds

    Args:
        view (NGLWidget): NGLWidget view object
        seqprop (SeqProp): SeqProp object
        structprop (StructProp): StructProp object
        chain_id (str): ID of the structure's chain to get annotation from