• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python utilities.get_cursor函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中utilities.get_cursor函数的典型用法代码示例。如果您正苦于以下问题:Python get_cursor函数的具体用法?Python get_cursor怎么用?Python get_cursor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了get_cursor函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: delete_publishdata_publishxrefid

def delete_publishdata_publishxrefid(publishxrefid, inbredsetid):
    cursor, con = utilities.get_cursor()
    sql = """
        DELETE PublishData
        FROM PublishXRef,PublishData
        WHERE PublishXRef.`Id`=%s
        AND PublishXRef.`InbredSetId`=%s
        AND PublishXRef.`DataId`=PublishData.`Id`
        """
    cursor.execute(sql, (publishxrefid, inbredsetid))
    sql = """
        DELETE PublishSE
        FROM PublishXRef,PublishSE
        WHERE PublishXRef.`Id`=%s
        AND PublishXRef.`InbredSetId`=%s
        AND PublishXRef.`DataId`=PublishSE.`DataId`
        """
    cursor.execute(sql, (publishxrefid, inbredsetid))
    sql = """
        DELETE NStrain
        FROM PublishXRef,NStrain
        WHERE PublishXRef.`Id`=%s
        AND PublishXRef.`InbredSetId`=%s
        AND PublishXRef.`DataId`=NStrain.`DataId`
        """
    cursor.execute(sql, (publishxrefid, inbredsetid))
    con.close()
开发者ID:avinashsivaraman,项目名称:genenetwork,代码行数:27,代码来源:phenotypes.py


示例2: check_or_insert_geno

def check_or_insert_geno(params, marker):
    cursor, con = utilities.get_cursor()
    sql = """
        SELECT Geno.`Id`
        FROM Geno
        WHERE Geno.`SpeciesId`=%s
        AND Geno.`Name` like %s
        """
    cursor.execute(sql, (speciesid, locus)) #This is correct
    result = cursor.fetchone()
    if result:
        geno_id = result[0]
        print("get geno record: ", geno_id)
    else:
        sql = """
            INSERT INTO Geno
            SET
            Geno.`SpeciesId`=%s,
            Geno.`Name`=%s,
            Geno.`Marker_Name`=%s,
            Geno.`Chr`=%s,
            Geno.`Mb`=%s
            """
        cursor.execute(sql, (species_id, locus, locus, chr, mb))
        row_count = cursor.rowcount
        geno_id = con.insert_id()
        print("INSERT INTO Geno: %d record: %d" % (row_count, geno_id))
    return geno_id
开发者ID:ethanwillis,项目名称:genenetwork2,代码行数:28,代码来源:load_genotypes_lei.py


示例3: insert_strain

def insert_strain(inbredsetid, strainname, updatestrainxref=None):
    speciesid = get_species(inbredsetid)[0]
    cursor, con = utilities.get_cursor()
    sql = """
        INSERT INTO Strain
        SET
        Strain.`Name`=%s,
        Strain.`Name2`=%s,
        Strain.`SpeciesId`=%s
        """
    cursor.execute(sql, (strainname, strainname, speciesid))
    strainid = con.insert_id()
    if updatestrainxref:
        sql = """
            SELECT StrainXRef.`OrderId`
            FROM StrainXRef
            where StrainXRef.`InbredSetId`=%s
            ORDER BY StrainXRef.`OrderId` DESC
            LIMIT 1
            """
        cursor.execute(sql, (inbredsetid))
        re = cursor.fetchone()
        orderid = re[0] + 1
        #
        sql = """
            INSERT INTO StrainXRef
            SET
            StrainXRef.`InbredSetId`=%s,
            StrainXRef.`StrainId`=%s,
            StrainXRef.`OrderId`=%s,
            StrainXRef.`Used_for_mapping`=%s,
            StrainXRef.`PedigreeStatus`=%s
            """
        cursor.execute(sql, (inbredsetid, strainid, orderid, "N", None))
开发者ID:ethanwillis,项目名称:genenetwork2,代码行数:34,代码来源:datastructure.py


示例4: delete

def delete(publishxrefid, inbredsetid):
    cursor = utilities.get_cursor()
    sql = """
        DELETE Phenotype
        FROM PublishXRef,Phenotype
        WHERE PublishXRef.`Id`=%s
        AND PublishXRef.`InbredSetId`=%s
        AND PublishXRef.`PhenotypeId`=Phenotype.`Id`
        """
    cursor.execute(sql, (publishxrefid, inbredsetid))
    sql = """
        DELETE PublishData
        FROM PublishXRef,PublishData
        WHERE PublishXRef.`Id`=%s
        AND PublishXRef.`InbredSetId`=%s
        AND PublishXRef.`DataId`=PublishData.`Id`
        """
    cursor.execute(sql, (publishxrefid, inbredsetid))
    sql = """
        DELETE PublishXRef
        FROM PublishXRef
        WHERE PublishXRef.`Id`=%s
        AND PublishXRef.`InbredSetId`=%s
        """
    cursor.execute(sql, (publishxrefid, inbredsetid))
开发者ID:ethanwillis,项目名称:genenetwork2,代码行数:25,代码来源:phenotypes.py


示例5: check_or_insert_geno

def check_or_insert_geno(config_dic, marker_dic):
    cursor, con = utilities.get_cursor()
    sql = """
        SELECT Geno.`Id`
        FROM Geno
        WHERE Geno.`SpeciesId`=%s
        AND Geno.`Name` like %s
        """
    cursor.execute(sql, (config_dic["speciesid"], marker_dic['locus']))
    result = cursor.fetchone()
    if result:
        genoid = result[0]
        print("get geno record: %d" % genoid)
    else:
        sql = """
            INSERT INTO Geno
            SET
            Geno.`SpeciesId`=%s,
            Geno.`Name`=%s,
            Geno.`Marker_Name`=%s,
            Geno.`Chr`=%s,
            Geno.`Mb`=%s
            """
        cursor.execute(sql, (config_dic['speciesid'], marker_dic['locus'], marker_dic['locus'], marker_dic['chromosome'], marker_dic['mb']))
        rowcount = cursor.rowcount
        genoid = con.insert_id()
        print("INSERT INTO Geno: %d record: %d" % (rowcount, genoid))
    return genoid
开发者ID:ethanwillis,项目名称:genenetwork2,代码行数:28,代码来源:load_genotypes.py


示例6: get_probesetxref

def get_probesetxref(probesetfreezeid):
    cursor = utilities.get_cursor()
    sql = """
        SELECT ProbeSetXRef.`ProbeSetId`, ProbeSetXRef.`DataId`
        FROM ProbeSetXRef
        WHERE ProbeSetXRef.`ProbeSetFreezeId`=%s
        """
    cursor.execute(sql, (probesetfreezeid))
    return cursor.fetchall()
开发者ID:ethanwillis,项目名称:genenetwork2,代码行数:9,代码来源:probesets.py


示例7: get_probeset

def get_probeset(probesetid):
    cursor = utilities.get_cursor()
    sql = """
        SELECT ProbeSet.`Id`, ProbeSet.`Name`, ProbeSet.`Symbol`, ProbeSet.`description`, ProbeSet.`Probe_Target_Description`, ProbeSet.`Chr`, ProbeSet.`Mb`
        FROM ProbeSet
        WHERE ProbeSet.`Id`=%s
        """
    cursor.execute(sql, (probesetid))
    return cursor.fetchone()
开发者ID:ethanwillis,项目名称:genenetwork2,代码行数:9,代码来源:probesets.py


示例8: getexceptions

def getexceptions():
    cursor = get_cursor("maintain_sb")
    sql = """SELECT domain.name, nameserver.name
    FROM domain, nameserver
    WHERE nameserver.name NOT LIKE "%ns_.oregonstate.edu%"
    AND nameserver.domain = domain.id"""

    cursor.execute(sql)
    return cursor.fetchall()
开发者ID:alecdhuse,项目名称:cyder,代码行数:9,代码来源:checkexcept.py


示例9: get_publication

def get_publication(publicationid):
    cursor, con = utilities.get_cursor()
    sql = """
        SELECT Publication.`Authors`, Publication.`Abstract`
        FROM Publication
        WHERE Publication.`Id`=%s
        """
    cursor.execute(sql, (publicationid))
    return cursor.fetchone()
开发者ID:avinashsivaraman,项目名称:genenetwork,代码行数:9,代码来源:phenotypes.py


示例10: get_genofreeze_byinbredsetid

def get_genofreeze_byinbredsetid(inbredsetid):
    cursor, con = utilities.get_cursor()
    sql = """
        SELECT GenoFreeze.`Id`, GenoFreeze.`Name`, GenoFreeze.`FullName`, GenoFreeze.`InbredSetId`
        FROM GenoFreeze
        WHERE GenoFreeze.`InbredSetId`=%s
        """
    cursor.execute(sql, (inbredsetid))
    return cursor.fetchone()
开发者ID:ethanwillis,项目名称:genenetwork2,代码行数:9,代码来源:datastructure.py


示例11: get_probesetfreeze

def get_probesetfreeze(probesetfreezeid):
    cursor, con = utilities.get_cursor()
    sql = """
        SELECT ProbeSetFreeze.`Id`, ProbeSetFreeze.`Name`, ProbeSetFreeze.`FullName`
        FROM ProbeSetFreeze
        WHERE ProbeSetFreeze.`Id`=%s
        """
    cursor.execute(sql, (probesetfreezeid))
    return cursor.fetchone()
开发者ID:ethanwillis,项目名称:genenetwork2,代码行数:9,代码来源:datastructure.py


示例12: get_publishxrefs

def get_publishxrefs(inbredsetid):
    cursor, con = utilities.get_cursor()
    sql = """
        SELECT PublishXRef.`Id`, PublishXRef.`PhenotypeId`, PublishXRef.`PublicationId`, PublishXRef.`DataId`
        FROM PublishXRef
        WHERE PublishXRef.`InbredSetId`=%s
        """
    cursor.execute(sql, (inbredsetid))
    return cursor.fetchall()
开发者ID:avinashsivaraman,项目名称:genenetwork,代码行数:9,代码来源:phenotypes.py


示例13: get_phenotype

def get_phenotype(phenotypeid):
    cursor, con = utilities.get_cursor()
    sql = """
        SELECT Phenotype.`Original_description`, Phenotype.`Pre_publication_description`, Phenotype.`Post_publication_description`
        FROM Phenotype
        WHERE Phenotype.`Id`=%s
        """
    cursor.execute(sql, (phenotypeid))
    return cursor.fetchone()
开发者ID:avinashsivaraman,项目名称:genenetwork,代码行数:9,代码来源:phenotypes.py


示例14: get_species

def get_species(inbredsetid):
    cursor, con = utilities.get_cursor()
    sql = """
        SELECT Species.`Id`, Species.`Name`, Species.`MenuName`, Species.`FullName`
        FROM InbredSet, Species
        WHERE InbredSet.`Id`=%s
        AND InbredSet.`SpeciesId`=Species.`Id`
        """
    cursor.execute(sql, (inbredsetid))
    return cursor.fetchone()
开发者ID:ethanwillis,项目名称:genenetwork2,代码行数:10,代码来源:datastructure.py


示例15: get_probesetxref_probesetfreezeid

def get_probesetxref_probesetfreezeid(locus, probesetfreezeid):
    cursor = utilities.get_cursor()
    sql = """
        SELECT ProbeSetXRef.`ProbeSetId`
        FROM ProbeSetXRef
        WHERE ProbeSetXRef.`ProbeSetFreezeId`=%s
        AND ProbeSetXRef.`Locus` LIKE %s
        """
    cursor.execute(sql, (probesetfreezeid, locus))
    return cursor.fetchall()
开发者ID:ethanwillis,项目名称:genenetwork2,代码行数:10,代码来源:probesets.py


示例16: get_publishdata

def get_publishdata(publishdataid):
    cursor, con = utilities.get_cursor()
    sql = """
        SELECT Strain.`Id`, Strain.`Name`, PublishData.`value`
        FROM PublishData, Strain
        WHERE PublishData.`Id`=%s
        AND PublishData.`StrainId`=Strain.`Id`
        """
    cursor.execute(sql, (publishdataid))
    return cursor.fetchall()
开发者ID:avinashsivaraman,项目名称:genenetwork,代码行数:10,代码来源:phenotypes.py


示例17: get_probesetfreezes

def get_probesetfreezes(inbredsetid):
    cursor, con = utilities.get_cursor()
    sql = """
        SELECT ProbeSetFreeze.`Id`, ProbeSetFreeze.`Name`, ProbeSetFreeze.`FullName`
        FROM ProbeSetFreeze, ProbeFreeze
        WHERE ProbeSetFreeze.`ProbeFreezeId`=ProbeFreeze.`Id`
        AND ProbeFreeze.`InbredSetId`=%s
        """
    cursor.execute(sql, (inbredsetid))
    return cursor.fetchall()
开发者ID:ethanwillis,项目名称:genenetwork2,代码行数:10,代码来源:datastructure.py


示例18: get_probesetxref

def get_probesetxref(probesetfreezeid):
    cursor, con = utilities.get_cursor()
    sql = """
        SELECT ProbeSetXRef.`ProbeSetId`, ProbeSetXRef.`DataId`, ProbeSetXRef.`Locus`, ProbeSetXRef.`LRS`, ProbeSetXRef.`pValue`,
			ProbeSetXRef.`mean`, ProbeSetXRef.`se`
        FROM ProbeSetXRef
        WHERE ProbeSetXRef.`ProbeSetFreezeId`=%s
        """
    cursor.execute(sql, (probesetfreezeid))
    return cursor.fetchall()
开发者ID:avinashsivaraman,项目名称:genenetwork,代码行数:10,代码来源:probesets.py


示例19: get_probesetdata

def get_probesetdata(probesetdataid):
    cursor = utilities.get_cursor()
    sql = """
        SELECT Strain.`Id`, Strain.`Name`, ProbeSetData.`value`
        FROM ProbeSetData, Strain
        WHERE ProbeSetData.`Id`=%s
        AND ProbeSetData.`StrainId`=Strain.`Id`;
        """
    cursor.execute(sql, (probesetdataid))
    return cursor.fetchall()
开发者ID:ethanwillis,项目名称:genenetwork2,代码行数:10,代码来源:probesets.py


示例20: get_strainxref

def get_strainxref(inbredsetid, strainid):
    cursor, con = utilities.get_cursor()
    sql = """
        SELECT StrainXRef.`StrainId`
        FROM StrainXRef
        WHERE StrainXRef.`InbredSetId`=%s
        AND StrainXRef.`StrainId`=%s
        """
    cursor.execute(sql, (inbredsetid, strainid))
    return cursor.fetchone()
开发者ID:genenetwork,项目名称:genenetwork,代码行数:10,代码来源:datastructure.py



注:本文中的utilities.get_cursor函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python utilities.get_qgis_app函数代码示例发布时间:2022-05-26
下一篇:
Python utilities.get_attribute函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap