예제 #1
0
def sbo(item: libsbml.SBase) -> str:
    """Create HTML code fragment enclosing SBOTerm data for the item.

    :param item: SBML object for which SBOTerm data has to be displayed
    :return: HTML code fragment enclosing SBOTerm data for the item
    """

    if item.getSBOTerm() != -1:
        return f"""<div class="cvterm">
                        <a href="{item.getSBOTermAsURL()}" target="_blank">
                            {item.getSBOTermID()}
                        </a>
                    </div>
                """
    return ""
예제 #2
0
def annotation_html(item: libsbml.SBase) -> str:
    """Create annotation HTML content for the item.

    :param item: SBML object for which annotation HTML content is to be generated
    :return: HTML code fragment enclosing annotation for item
    """

    info = '<div class="cvterm">'
    if item.getSBOTerm() != -1:
        info += f"""
            <a href="{item.getSBOTermAsURL()}" target="_blank">
                {item.getSBOTermID()}
            </a><br />
            """
    if item.isSetAnnotation():
        info += annotation_to_html(item)
    info += "</div>"
    return info