pdb_mapping/pdb_full_region_table.py
def create_pdb_temp_table(pdb_file):
    """
    Create the pdb_full_region_temp table and populate with data from the pdb text file.
    :param pdb_file: Text file with data to import to pdb_full_region_temp
    """
    conn = RfamDB.connect(db_config=DB_CONFIG)
    cursor = conn.cursor()
    try:
        cursor.execute("DROP TABLE IF EXISTS pdb_full_region_temp;")
        cursor.execute("CREATE TABLE pdb_full_region_temp LIKE pdb_full_region;")
        with open(pdb_file) as f:
            reader = csv.reader(f, delimiter='\t')
            for row in reader:
                cursor.execute("""INSERT INTO pdb_full_region_temp(rfam_acc, pdb_id, chain, pdb_start,
                                pdb_end, bit_score, evalue_score, cm_start, cm_end, hex_colour, is_significant)
                                VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) """, row)
                conn.commit()
    except mysql.connector.Error as e:
        logging.debug("MySQL error has occurred: {0}".format(e))
        raise

    finally:
        cursor.close()
        conn.close()

    Create the pdb_full_region_temp table and populate with data from the pdb text file.
    :param pdb_file: Text file with data to import to pdb_full_region_temp
    
Create the pdb_full_region_temp table and populate with data from the pdb text file.
Create the pdb_full_region_temp table and populate with data from the pdb text file .
def create_pdb_temp_table(pdb_file):
    conn = RfamDB.connect(db_config=DB_CONFIG)
    cursor = conn.cursor()
    try:
        cursor.execute("DROP TABLE IF EXISTS pdb_full_region_temp;")
        cursor.execute("CREATE TABLE pdb_full_region_temp LIKE pdb_full_region;")
        with open(pdb_file) as f:
            reader = csv.reader(f, delimiter='\t')
            for row in reader:
                cursor.execute("""INSERT INTO pdb_full_region_temp(rfam_acc, pdb_id, chain, pdb_start,
                                pdb_end, bit_score, evalue_score, cm_start, cm_end, hex_colour, is_significant)
                                VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) """, row)
                conn.commit()
    except mysql.connector.Error as e:
        logging.debug("MySQL error has occurred: {0}".format(e))
        raise
    finally:
        cursor.close()
        conn.close()
def create_pdb_temp_table ( pdb_file ) : conn = RfamDB . connect ( db_config = DB_CONFIG ) cursor = conn . cursor ( ) try : cursor . execute ( "DROP TABLE IF EXISTS pdb_full_region_temp;" ) cursor . execute ( "CREATE TABLE pdb_full_region_temp LIKE pdb_full_region;" ) with open ( pdb_file ) as f : reader = csv . reader ( f , delimiter = '\t' ) for row in reader : cursor . execute ( """INSERT INTO pdb_full_region_temp(rfam_acc, pdb_id, chain, pdb_start,
                                pdb_end, bit_score, evalue_score, cm_start, cm_end, hex_colour, is_significant)
                                VALUES(%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) """ , row ) conn . commit ( ) except mysql . connector . Error as e : logging . debug ( "MySQL error has occurred: {0}" . format ( e ) ) raise finally : cursor . close ( ) conn . close ( )
Create the pdb_full_region_temp table and populate with data from the pdb text file.
Create the pdb_full_region_temp table and populate with data from the pdb text file .
"""
    Create the pdb_full_region_temp table and populate with data from the pdb text file.
    :param pdb_file: Text file with data to import to pdb_full_region_temp
    """
pdb_file
Text file with data to import to pdb_full_region_temp
Text file with data to import to pdb_full_region_temp