scripts/export/rfam_xml_dumper.py
def fetch_entry_fields(entry_acc, entry_type):
    """
    Returns a dictionary with the entry's fields

    entry_acc:  An Rfam associated accession (Motif, Clan, Family)
    entry_type: The type of the entry accession
    """

    # maybe the entry type not required... use rfam_acc[0:2]

    cnx = RfamDB.connect()
    cursor = cnx.cursor(dictionary=True)

    entry_type = entry_type[0].capitalize()

    fields = None

    try:
        if entry_type == rs.FAMILY:
            cursor.execute(rs.FAM_FIELDS % entry_acc)

        elif entry_type == rs.CLAN:
            cursor.execute(rs.CLAN_FIELDS % entry_acc)

        elif entry_type == rs.MOTIF:
            cursor.execute(rs.MOTIF_FIELDS % entry_acc)

        elif entry_type == rs.GENOME:
            cursor.execute(rs.GENOME_FIELDS % entry_acc)

        fields = cursor.fetchall()[0]

    except:
        print "Failure retrieving values for entry %s." % entry_acc

    cursor.close()
    cnx.disconnect()

    return fields

    Returns a dictionary with the entry's fields

    entry_acc:  An Rfam associated accession (Motif, Clan, Family)
    entry_type: The type of the entry accession
    
Returns a dictionary with the entry's fields
entry_acc:  An Rfam associated accession (Motif, Clan, Family)
entry_type: The type of the entry accession
Returns a dictionary with the entry ' s fields entry_acc : An Rfam associated accession ( Motif Clan Family ) entry_type : The type of the entry accession
def fetch_entry_fields(entry_acc, entry_type):
    cnx = RfamDB.connect()
    cursor = cnx.cursor(dictionary=True)
    entry_type = entry_type[0].capitalize()
    fields = None
    try:
        if entry_type == rs.FAMILY:
            cursor.execute(rs.FAM_FIELDS % entry_acc)
        elif entry_type == rs.CLAN:
            cursor.execute(rs.CLAN_FIELDS % entry_acc)
        elif entry_type == rs.MOTIF:
            cursor.execute(rs.MOTIF_FIELDS % entry_acc)
        elif entry_type == rs.GENOME:
            cursor.execute(rs.GENOME_FIELDS % entry_acc)
        fields = cursor.fetchall()[0]
    except:
        print "Failure retrieving values for entry %s." % entry_acc
    cursor.close()
    cnx.disconnect()
    return fields
def fetch_entry_fields ( entry_acc , entry_type ) : cnx = RfamDB . connect ( ) cursor = cnx . cursor ( dictionary = True ) entry_type = entry_type [ 0 ] . capitalize ( ) fields = None try : if entry_type == rs . FAMILY : cursor . execute ( rs . FAM_FIELDS % entry_acc ) elif entry_type == rs . CLAN : cursor . execute ( rs . CLAN_FIELDS % entry_acc ) elif entry_type == rs . MOTIF : cursor . execute ( rs . MOTIF_FIELDS % entry_acc ) elif entry_type == rs . GENOME : cursor . execute ( rs . GENOME_FIELDS % entry_acc ) fields = cursor . fetchall ( ) [ 0 ] except : print "Failure retrieving values for entry %s." % entry_acc cursor . close ( ) cnx . disconnect ( ) return fields
Returns a dictionary with the entry's fields
entry_acc:  An Rfam associated accession (Motif, Clan, Family)
entry_type: The type of the entry accession
Returns a dictionary with the entry ' s fields entry_acc : An Rfam associated accession ( Motif Clan Family ) entry_type : The type of the entry accession
"""
    Returns a dictionary with the entry's fields

    entry_acc:  An Rfam associated accession (Motif, Clan, Family)
    entry_type: The type of the entry accession
    """ # maybe the entry type not required... use rfam_acc[0:2]
entry_acc
entry_type