コード例 #1
0
def annotateFile(art, file):
    # example
    pmid = art.pmid
    if art.pmid == "" or not int(pmid) in pmidToGenes:
        logging.debug("No pmid for article %s" % art.articleId)
        raise StopIteration
    genes = pmidToGenes[int(art.pmid)].split(",")
    genes = [int(x) for x in genes]
    mutations = seth.findMutations(file.content)

    for gene in genes:
        potentialSNPs = dbSNP.getSNP(int(gene))
        features = UniprotFeature.getFeatures(gene)

        for mut in mutations:
            print("mutation found: ", str(mut))
            start = mut.getStart()
            end = mut.getEnd()
            mut.normalizeSNP(potentialSNPs, features, False)
            normalized = mut.getNormalized()
            for snp in normalized:
                wtRes = mut.getWtResidue()
                mutRes = mut.getMutResidue()
                pos = mut.getPosition()
                text = mut.getText()
                rsId = snp.getRsID()
                yield [
                    start, end,
                    str(gene), wtRes, pos, mutRes, "rs" + str(rsId), text
                ]
コード例 #2
0
ファイル: javaSeth.py プロジェクト: Moxikai/pubMunch
def annotateFile(art, file):
    # example
    pmid = art.pmid
    if art.pmid=="" or not int(pmid) in pmidToGenes:
        logging.debug("No pmid for article %s" % art.articleId)
        raise StopIteration
    genes = pmidToGenes[int(art.pmid)].split(",")
    genes = [int(x) for x in genes]
    mutations = seth.findMutations(file.content)

    for gene in genes:
        potentialSNPs = dbSNP.getSNP(int(gene))
        features = UniprotFeature.getFeatures(gene);

        for mut in mutations:
            print "mutation found: ", str(mut)
            start = mut.getStart()
            end = mut.getEnd()
            mut.normalizeSNP(potentialSNPs, features, False)
            normalized = mut.getNormalized()
            for snp in normalized:
                wtRes = mut.getWtResidue()
                mutRes = mut.getMutResidue()
                pos = mut.getPosition()
                text = mut.getText()
                rsId = snp.getRsID()
                yield [start, end, str(gene), wtRes, pos, mutRes, "rs"+str(rsId), text]
コード例 #3
0
ファイル: javaSeth.py プロジェクト: Moxikai/pubMunch
def test():
    gene = 1312
    potentialSNPs = dbSNP.getSNP(gene);
    features = UniprotFeature.getFeatures(gene);
    mutations = seth.findMutations("p.A123T and Val158Met")
    for mut in mutations:
        start, end = mut.getStart(), mut.getEnd()
        wtRes, mutRes = mut.getWtResidue(), mut.getMutResidue()
        pos, text = mut.getPosition(), mut.getText()
        mut.normalizeSNP(potentialSNPs, features, False)
        normalized = mut.getNormalized()
        for snp in normalized:
            rsId = snp.getRsID()
            print ",".join([start, end, wtRes, mutRes, pos, "rs"+str(rsId), text])
コード例 #4
0
def test():
    gene = 1312
    potentialSNPs = dbSNP.getSNP(gene)
    features = UniprotFeature.getFeatures(gene)
    mutations = seth.findMutations("p.A123T and Val158Met")
    for mut in mutations:
        start, end = mut.getStart(), mut.getEnd()
        wtRes, mutRes = mut.getWtResidue(), mut.getMutResidue()
        pos, text = mut.getPosition(), mut.getText()
        mut.normalizeSNP(potentialSNPs, features, False)
        normalized = mut.getNormalized()
        for snp in normalized:
            rsId = snp.getRsID()
            print(",".join(
                [start, end, wtRes, mutRes, pos, "rs" + str(rsId), text]))