utils/db_utils.py
def fetch_clanin_data():
    """
    Fetches all rfam_ids per clan. To be used for clanin file generation

    :return: void
    """

    clan_members = {}
    cnx = RfamDB.connect()

    cursor = cnx.cursor(buffered=True)

    cursor.execute("select cm.clan_acc, f.rfam_id from clan_membership cm, family f "
       "where f.rfam_acc=cm.rfam_acc "
       "order by cm.clan_acc")

    clan_pairs = cursor.fetchall()

    cursor.close()

    # build clan membership dictionary
    for clan_pair in clan_pairs:
        clan_acc = clan_pair[0]
        rfam_id = clan_pair[1]

        if clan_acc not in clan_members.keys():
            clan_members[clan_acc] = [rfam_id]
        else:
            clan_members[clan_acc].append(rfam_id)

    cursor.close()
    RfamDB.disconnect(cnx)

    return clan_members

    Fetches all rfam_ids per clan. To be used for clanin file generation

    :return: void
    
Fetches all rfam_ids per clan. To be used for clanin file generation
Fetches all rfam_ids per clan . To be used for clanin file generation
def fetch_clanin_data():
    clan_members = {}
    cnx = RfamDB.connect()
    cursor = cnx.cursor(buffered=True)
    cursor.execute("select cm.clan_acc, f.rfam_id from clan_membership cm, family f "
       "where f.rfam_acc=cm.rfam_acc "
       "order by cm.clan_acc")
    clan_pairs = cursor.fetchall()
    cursor.close()
    for clan_pair in clan_pairs:
        clan_acc = clan_pair[0]
        rfam_id = clan_pair[1]
        if clan_acc not in clan_members.keys():
            clan_members[clan_acc] = [rfam_id]
        else:
            clan_members[clan_acc].append(rfam_id)
    cursor.close()
    RfamDB.disconnect(cnx)
    return clan_members
def fetch_clanin_data ( ) : clan_members = { } cnx = RfamDB . connect ( ) cursor = cnx . cursor ( buffered = True ) cursor . execute ( "select cm.clan_acc, f.rfam_id from clan_membership cm, family f " "where f.rfam_acc=cm.rfam_acc " "order by cm.clan_acc" ) clan_pairs = cursor . fetchall ( ) cursor . close ( ) for clan_pair in clan_pairs : clan_acc = clan_pair [ 0 ] rfam_id = clan_pair [ 1 ] if clan_acc not in clan_members . keys ( ) : clan_members [ clan_acc ] = [ rfam_id ] else : clan_members [ clan_acc ] . append ( rfam_id ) cursor . close ( ) RfamDB . disconnect ( cnx ) return clan_members
Fetches all rfam_ids per clan.
Fetches all rfam_ids per clan .
"""
    Fetches all rfam_ids per clan. To be used for clanin file generation

    :return: void
    """ # build clan membership dictionary
None