DepositDB.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:amplicon_sequencing_pipeline 作者: thomasgurry 项目源码 文件源码
def DepositSampleInfo(self):

        ######################## 
        # Sample_info database #
        ########################

        # Insert into DB
        db = MySQLdb.connect(host="mbitdb1.cwnerb5rh4qg.us-east-1.rds.amazonaws.com", # your host, usually localhost
                     user="cmitaws", # your username
                     passwd="microbiome", # your password
                     db="Sample_info") # name of the data base
        insert_OTU = ("INSERT INTO turnbaugh_mouse_diet_2015 "
                      "(sample_ID, disease_labels, keywords)" 
                      "VALUES (%(sample_ID)s, %(disease_labels)s, %(keywords)s)")
        cursor = db.cursor()


        # CREATE sample info table
        mysql_cmd1 = "create table " + data_summary.datasetID + " (sampleID VARCHAR(20), disease_labels VARCHAR(30), keywords VARCHAR(200));"

        # Deposit sample info
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号