def write_class(ID, label, synonyms=None, father=None):
    """
    write a class oin OBO format (inspired by CELDA ontology)
    :param ID: str ID of class
    :param label: str class label
    :param synonyms: list synonyms
    :param father: str ID of class father
    :return: a formated class
    """
    if synonyms != None and father != None:
        all_fathers = ''
        for i in range(len(father)):
            all_fathers = all_fathers + father[i]
        new_class = ['\n', '\n', '\n', '     <!--#' + ID + '-->\n', '\n', 
            '     <owl:Class rdf:about="#' + ID + '">\n', 
            '         <rdfs:label>' + label + '</rdfs:label>\n',
            """         <rdfs:subClassOf>
""",
            '         <owl:Restriction>\n',
            """             <owl:onProperty rdf:resource="&purl;obo/develops_from"/>
"""
            , '             <owl:someValuesFrom rdf:resource="' +
            all_fathers + '"/>\n', """         </owl:Restriction>
"""]
        for i in range(len(synonyms)):
            new_class.append('         <ru-meta:synonym xml:lang="en">' +
                synonyms[i] + """</ru-meta:synonym>
""")
        new_class.append('        </rdfs:subClassOf>\n')
        new_class.append('     </owl:Class>\n')
    elif synonyms != None and father == None:
        new_class = ['\n', '\n', '\n', '    <!--#' + ID + '-->\n', '\n', 
            '    <owl:Class rdf:about="#' + ID + '">\n', 
            '        <rdfs:label>' + label + '</rdfs:label>\n']
        for i in range(len(synonyms)):
            new_class.append('        <ru-meta:synonym xml:lang="en">' +
                synonyms[i] + """</ru-meta:synonym>
""")
        new_class.append('    </owl:Class>\n')
    elif synonyms == None and father != None:
        all_fathers = ''
        for i in range(len(father)):
            all_fathers = all_fathers + father[i]
        new_class = ['\n', '\n', '\n', '    <!--#' + ID + '-->\n', '\n', 
            '    <owl:Class rdf:about="#' + ID + '">\n', 
            '        <rdfs:label>' + label + '</rdfs:label>\n',
            """        <rdfs:subClassOf >
""",
            '        <owl:Restriction>\n',
            """            <owl:onProperty rdf:resource="&purl;obo/develops_from"/>
"""
            , '            <owl:someValuesFrom rdf:resource="' +
            all_fathers + '"/>\n', """        </owl:Restriction>
""",
            '        </rdfs:subClassOf>\n', '    </owl:Class>\n']
    else:
        new_class = ['\n', '\n', '\n', '    <!--#' + ID + '-->\n', '\n', 
            '    <owl:Class rdf:about="#' + ID + '">\n', 
            '        <rdfs:label>' + label + '</rdfs:label>\n',
            """    </owl:Class>
"""]
    return new_class
