utils/db_utils.py
def populate_genome_table(data):
    """
    Populates the RfamLive genome table with the data provided as input

    data: A list of tuples with the new genome table entries

    return: Void
    """

    # connect to db
    cnx = RfamDB.connect()

    # get a new buffered cursor
    cursor = cnx.cursor(raw=True)

    # query to update is_significant field to 0
    query = ("INSERT INTO genome (upid, assembly_acc, assembly_version, wgs_acc,"
             "wgs_version, assembly_name, assembly_level, study_ref, description,"
             "total_length, ungapped_length, circular, ncbi_id, scientific_name,"
             "common_name, kingdom, num_rfam_regions, num_families, is_reference,"
             "is_representative) VALUES (%s,%s,%s, %s, %s, %s, %s, %s, %s, %s,"
             "%s,%s,%s, %s, %s, %s, %s, %s, %s, %s)")

    try:
        # execute query batched
        cursor.executemany(query, data)
        cnx.commit()

    except:
        print ("MySQL Update Error. Rolling back...")
        cnx.rollback()
        cursor.close()
        RfamDB.disconnect(cnx)

        cursor.close()
        RfamDB.disconnect(cnx)

    Populates the RfamLive genome table with the data provided as input

    data: A list of tuples with the new genome table entries

    return: Void
    
Populates the RfamLive genome table with the data provided as input
data: A list of tuples with the new genome table entries

Void
Populates the RfamLive genome table with the data provided as input data : A list of tuples with the new genome table entries Void
def populate_genome_table(data):
    cnx = RfamDB.connect()
    cursor = cnx.cursor(raw=True)
    query = ("INSERT INTO genome (upid, assembly_acc, assembly_version, wgs_acc,"
             "wgs_version, assembly_name, assembly_level, study_ref, description,"
             "total_length, ungapped_length, circular, ncbi_id, scientific_name,"
             "common_name, kingdom, num_rfam_regions, num_families, is_reference,"
             "is_representative) VALUES (%s,%s,%s, %s, %s, %s, %s, %s, %s, %s,"
             "%s,%s,%s, %s, %s, %s, %s, %s, %s, %s)")
    try:
        cursor.executemany(query, data)
        cnx.commit()
    except:
        print ("MySQL Update Error. Rolling back...")
        cnx.rollback()
        cursor.close()
        RfamDB.disconnect(cnx)
        cursor.close()
        RfamDB.disconnect(cnx)
def populate_genome_table ( data ) : cnx = RfamDB . connect ( ) cursor = cnx . cursor ( raw = True ) query = ( "INSERT INTO genome (upid, assembly_acc, assembly_version, wgs_acc," "wgs_version, assembly_name, assembly_level, study_ref, description," "total_length, ungapped_length, circular, ncbi_id, scientific_name," "common_name, kingdom, num_rfam_regions, num_families, is_reference," "is_representative) VALUES (%s,%s,%s, %s, %s, %s, %s, %s, %s, %s," "%s,%s,%s, %s, %s, %s, %s, %s, %s, %s)" ) try : cursor . executemany ( query , data ) cnx . commit ( ) except : print ( "MySQL Update Error. Rolling back..." ) cnx . rollback ( ) cursor . close ( ) RfamDB . disconnect ( cnx ) cursor . close ( ) RfamDB . disconnect ( cnx )
Populates the RfamLive genome table with the data provided as input
data: A list of tuples with the new genome table entries
Populates the RfamLive genome table with the data provided as input data : A list of tuples with the new genome table entries
"""
    Populates the RfamLive genome table with the data provided as input

    data: A list of tuples with the new genome table entries

    return: Void
    """ # connect to db # get a new buffered cursor # query to update is_significant field to 0 # execute query batched
data