scripts/export/rfam_xml_dumper.py
def clan_xml_builder(entries, clan_acc=None):
    """
    Expands the Xml4dbDumper object by adding a new clan entry

    entries:    The xml entries node to be expanded
    clan_acc:   An Rfam associated clan accession
    """

    entry_type = "Clan"

    cross_ref_dict = {}

    # fetch clan fields
    clan_fields = fetch_entry_fields(clan_acc, rs.CLAN)

    # add a new clan entry to the xml tree
    entry = ET.SubElement(entries, "entry", id=clan_acc)

    ET.SubElement(entry, "name").text = clan_fields["name"]
    ET.SubElement(entry, "description").text = clan_fields["description"]

    # entry dates - common to motifs and clans
    dates = ET.SubElement(entry, "dates")

    created = clan_fields["created"].date().strftime("%d %b %Y")
    updated = clan_fields["updated"].date().strftime("%d %b %Y")

    ET.SubElement(dates, "date", value=created, type="created")
    ET.SubElement(dates, "date", value=updated, type="updated")

    # clan cross references
    clan_fams = fetch_value_list(clan_acc, rs.CLAN_FAMS)
    cross_ref_dict["RFAM"] = clan_fams
    build_cross_references(entry, cross_ref_dict)

    # clan additional fields
    build_additional_fields(
        entry, clan_fields, clan_fields["num_families"], None, entry_type=entry_type)

    Expands the Xml4dbDumper object by adding a new clan entry

    entries:    The xml entries node to be expanded
    clan_acc:   An Rfam associated clan accession
    
Expands the Xml4dbDumper object by adding a new clan entry
entries:    The xml entries node to be expanded
clan_acc:   An Rfam associated clan accession
Expands the Xml4dbDumper object by adding a new clan entry entries : The xml entries node to be expanded clan_acc : An Rfam associated clan accession
def clan_xml_builder(entries, clan_acc=None):
    entry_type = "Clan"
    cross_ref_dict = {}
    clan_fields = fetch_entry_fields(clan_acc, rs.CLAN)
    entry = ET.SubElement(entries, "entry", id=clan_acc)
    ET.SubElement(entry, "name").text = clan_fields["name"]
    ET.SubElement(entry, "description").text = clan_fields["description"]
    dates = ET.SubElement(entry, "dates")
    created = clan_fields["created"].date().strftime("%d %b %Y")
    updated = clan_fields["updated"].date().strftime("%d %b %Y")
    ET.SubElement(dates, "date", value=created, type="created")
    ET.SubElement(dates, "date", value=updated, type="updated")
    clan_fams = fetch_value_list(clan_acc, rs.CLAN_FAMS)
    cross_ref_dict["RFAM"] = clan_fams
    build_cross_references(entry, cross_ref_dict)
    build_additional_fields(
        entry, clan_fields, clan_fields["num_families"], None, entry_type=entry_type)
def clan_xml_builder ( entries , clan_acc = None ) : entry_type = "Clan" cross_ref_dict = { } clan_fields = fetch_entry_fields ( clan_acc , rs . CLAN ) entry = ET . SubElement ( entries , "entry" , id = clan_acc ) ET . SubElement ( entry , "name" ) . text = clan_fields [ "name" ] ET . SubElement ( entry , "description" ) . text = clan_fields [ "description" ] dates = ET . SubElement ( entry , "dates" ) created = clan_fields [ "created" ] . date ( ) . strftime ( "%d %b %Y" ) updated = clan_fields [ "updated" ] . date ( ) . strftime ( "%d %b %Y" ) ET . SubElement ( dates , "date" , value = created , type = "created" ) ET . SubElement ( dates , "date" , value = updated , type = "updated" ) clan_fams = fetch_value_list ( clan_acc , rs . CLAN_FAMS ) cross_ref_dict [ "RFAM" ] = clan_fams build_cross_references ( entry , cross_ref_dict ) build_additional_fields ( entry , clan_fields , clan_fields [ "num_families" ] , None , entry_type = entry_type )
Expands the Xml4dbDumper object by adding a new clan entry
entries:    The xml entries node to be expanded
clan_acc:   An Rfam associated clan accession
Expands the Xml4dbDumper object by adding a new clan entry entries : The xml entries node to be expanded clan_acc : An Rfam associated clan accession
"""
    Expands the Xml4dbDumper object by adding a new clan entry

    entries:    The xml entries node to be expanded
    clan_acc:   An Rfam associated clan accession
    """ # fetch clan fields # add a new clan entry to the xml tree # entry dates - common to motifs and clans # clan cross references # clan additional fields
entries
clan_acc