scripts/export/rfam_xml_dumper.py
def motif_xml_builder(entries, motif_acc=None):
    """
    Expands the Xml4dbDump with a Motif entry

    entries:    Entries node on xml tree
    motif_acc:  An Rfam associated motif accession
    """

    entry_type = "Motif"

    cross_ref_dict = {}

    # fetch clan fields
    motif_fields = fetch_entry_fields(motif_acc, rs.MOTIF)

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

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

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

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

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

    # adding cross references
    motif_fams = fetch_value_list(motif_acc, rs.MOTIF_FAMS)
    cross_ref_dict["RFAM"] = motif_fams
    build_cross_references(entry, cross_ref_dict)

    build_additional_fields(
        entry, motif_fields, 0, None, entry_type=entry_type)

    Expands the Xml4dbDump with a Motif entry

    entries:    Entries node on xml tree
    motif_acc:  An Rfam associated motif accession
    
Expands the Xml4dbDump with a Motif entry
entries:    Entries node on xml tree
motif_acc:  An Rfam associated motif accession
Expands the Xml4dbDump with a Motif entry entries : Entries node on xml tree motif_acc : An Rfam associated motif accession
def motif_xml_builder(entries, motif_acc=None):
    entry_type = "Motif"
    cross_ref_dict = {}
    motif_fields = fetch_entry_fields(motif_acc, rs.MOTIF)
    entry = ET.SubElement(entries, "entry", id=motif_acc)
    ET.SubElement(entry, "name").text = motif_fields["name"]
    ET.SubElement(entry, "description").text = motif_fields["description"]
    dates = ET.SubElement(entry, "dates")
    created = motif_fields["created"].date().strftime("%d %b %Y")
    updated = motif_fields["updated"].date().strftime("%d %b %Y")
    ET.SubElement(dates, "date", value=created, type="created")
    ET.SubElement(dates, "date", value=updated, type="updated")
    motif_fams = fetch_value_list(motif_acc, rs.MOTIF_FAMS)
    cross_ref_dict["RFAM"] = motif_fams
    build_cross_references(entry, cross_ref_dict)
    build_additional_fields(
        entry, motif_fields, 0, None, entry_type=entry_type)
def motif_xml_builder ( entries , motif_acc = None ) : entry_type = "Motif" cross_ref_dict = { } motif_fields = fetch_entry_fields ( motif_acc , rs . MOTIF ) entry = ET . SubElement ( entries , "entry" , id = motif_acc ) ET . SubElement ( entry , "name" ) . text = motif_fields [ "name" ] ET . SubElement ( entry , "description" ) . text = motif_fields [ "description" ] dates = ET . SubElement ( entry , "dates" ) created = motif_fields [ "created" ] . date ( ) . strftime ( "%d %b %Y" ) updated = motif_fields [ "updated" ] . date ( ) . strftime ( "%d %b %Y" ) ET . SubElement ( dates , "date" , value = created , type = "created" ) ET . SubElement ( dates , "date" , value = updated , type = "updated" ) motif_fams = fetch_value_list ( motif_acc , rs . MOTIF_FAMS ) cross_ref_dict [ "RFAM" ] = motif_fams build_cross_references ( entry , cross_ref_dict ) build_additional_fields ( entry , motif_fields , 0 , None , entry_type = entry_type )
Expands the Xml4dbDump with a Motif entry
entries:    Entries node on xml tree
motif_acc:  An Rfam associated motif accession
Expands the Xml4dbDump with a Motif entry entries : Entries node on xml tree motif_acc : An Rfam associated motif accession
"""
    Expands the Xml4dbDump with a Motif entry

    entries:    Entries node on xml tree
    motif_acc:  An Rfam associated motif accession
    """ # fetch clan fields # add a new clan entry to the xml tree # entry dates - common to motifs and clans # adding cross references
entries
motif_acc