scripts/export/rfam_xml_dumper.py
def genome_xml_builder(entries, gen_acc=None):
    """
    Expands the Xml4dbDump with a Genome entry

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

    entry_type = "Genome"

    cross_ref_dict = {}

    # fetch genome fields
    genome_fields = fetch_entry_fields(gen_acc, rs.GENOME)

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

    if genome_fields["name"] is not None:
        ET.SubElement(entry, "name").text = genome_fields["name"]
    else:
        ET.SubElement(entry, "name").text = ''

    if genome_fields["description"] is not None:
        ET.SubElement(entry, "description").text = genome_fields["description"]
    else:
        ET.SubElement(entry, "description").text = ''

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

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

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

    # build genome cross references, if there are any
    if genome_fields["num_families"] != 0:
        genome_fams = fetch_value_list(gen_acc, rs.GENOME_FAMS)

        cross_ref_dict["RFAM"] = genome_fams
        cross_ref_dict["ncbi_taxonomy_id"] = [genome_fields["ncbi_id"]]
        build_cross_references(entry, cross_ref_dict)

    # genome additional fields
    build_genome_additional_fields(entry, genome_fields)

    Expands the Xml4dbDump with a Genome entry

    entries:    Entries node on xml tree
    gen_acc:  An Rfam associated motif accession
    
Expands the Xml4dbDump with a Genome entry
entries:    Entries node on xml tree
gen_acc:  An Rfam associated motif accession
Expands the Xml4dbDump with a Genome entry entries : Entries node on xml tree gen_acc : An Rfam associated motif accession
def genome_xml_builder(entries, gen_acc=None):
    entry_type = "Genome"
    cross_ref_dict = {}
    genome_fields = fetch_entry_fields(gen_acc, rs.GENOME)
    entry = ET.SubElement(entries, "entry", id=gen_acc)
    if genome_fields["name"] is not None:
        ET.SubElement(entry, "name").text = genome_fields["name"]
    else:
        ET.SubElement(entry, "name").text = ''
    if genome_fields["description"] is not None:
        ET.SubElement(entry, "description").text = genome_fields["description"]
    else:
        ET.SubElement(entry, "description").text = ''
    dates = ET.SubElement(entry, "dates")
    created = genome_fields["created"].date().strftime("%d %b %Y")
    updated = genome_fields["updated"].date().strftime("%d %b %Y")
    ET.SubElement(dates, "date", value=created, type="created")
    ET.SubElement(dates, "date", value=updated, type="updated")
    if genome_fields["num_families"] != 0:
        genome_fams = fetch_value_list(gen_acc, rs.GENOME_FAMS)
        cross_ref_dict["RFAM"] = genome_fams
        cross_ref_dict["ncbi_taxonomy_id"] = [genome_fields["ncbi_id"]]
        build_cross_references(entry, cross_ref_dict)
    build_genome_additional_fields(entry, genome_fields)
def genome_xml_builder ( entries , gen_acc = None ) : entry_type = "Genome" cross_ref_dict = { } genome_fields = fetch_entry_fields ( gen_acc , rs . GENOME ) entry = ET . SubElement ( entries , "entry" , id = gen_acc ) if genome_fields [ "name" ] is not None : ET . SubElement ( entry , "name" ) . text = genome_fields [ "name" ] else : ET . SubElement ( entry , "name" ) . text = '' if genome_fields [ "description" ] is not None : ET . SubElement ( entry , "description" ) . text = genome_fields [ "description" ] else : ET . SubElement ( entry , "description" ) . text = '' dates = ET . SubElement ( entry , "dates" ) created = genome_fields [ "created" ] . date ( ) . strftime ( "%d %b %Y" ) updated = genome_fields [ "updated" ] . date ( ) . strftime ( "%d %b %Y" ) ET . SubElement ( dates , "date" , value = created , type = "created" ) ET . SubElement ( dates , "date" , value = updated , type = "updated" ) if genome_fields [ "num_families" ] != 0 : genome_fams = fetch_value_list ( gen_acc , rs . GENOME_FAMS ) cross_ref_dict [ "RFAM" ] = genome_fams cross_ref_dict [ "ncbi_taxonomy_id" ] = [ genome_fields [ "ncbi_id" ] ] build_cross_references ( entry , cross_ref_dict ) build_genome_additional_fields ( entry , genome_fields )
Expands the Xml4dbDump with a Genome entry
entries:    Entries node on xml tree
gen_acc:  An Rfam associated motif accession
Expands the Xml4dbDump with a Genome entry entries : Entries node on xml tree gen_acc : An Rfam associated motif accession
"""
    Expands the Xml4dbDump with a Genome entry

    entries:    Entries node on xml tree
    gen_acc:  An Rfam associated motif accession
    """ # fetch genome fields # add a new genome entry to the xml tree # entry dates - common to motifs and clans # build genome cross references, if there are any # genome additional fields
entries
gen_acc