def deriveProto_ID(reaction, blocks, Twins):
    """
    Derive BiGG-ID from reactionID.
    Relies on the assumption that reactionID in RBA-model equals an 'R_', followed by the BiGG-ID.
    When the reaction has twins (duplicated reactions due to isozymes),
    the one without an appended '_2', '_3' ... needs to be found first.

    Returns
    -------
    String with derived BiGG-ID.
    """
    if len(Twins) > 0:  # Check if isozymic reactions exist
        # Find "original" reaction (shortest name)
        b = min(Twins+[blocks.metabolism.reactions[reaction]], key=len)
        out = b
        # Remove 'M_'-prefix
        if b.startswith('R_'):
            out = b[2:]
    else:
        out = blocks.metabolism.reactions[reaction]
        if out.startswith('R_'):
            out = out[2:]
    return(out)