예제 #1
0
def makeOrgSynonymes():

    dOrgSyns = {}
    addedMirnaIDs = list()

    for mimat in MIMAT2MIRNA:

        mirna = MIMAT2MIRNA[mimat]

        orgmir = orgmirs.mimat2orgmir.get(mimat, None)

        if orgmir == None:
            continue

        synid = orgmir

        if synid in dOrgSyns:
            orgSyn = dOrgSyns[synid]
        else:
            orgSyn = Synonym(synid)

        allsyns = set(
            mirna.make_strings(miRNA.compositions()[miRNASynonymeTYPE.MIORG]))

        for syn in allsyns:
            orgSyn.addSyn(syn)

        dOrgSyns[synid] = orgSyn

    vOrgSyns = [dOrgSyns[x] for x in dOrgSyns]

    return vOrgSyns
예제 #2
0
def makeFamilySynonymes():

    vFamSyns = []

    for family in familyDB:

        for (miID, miName) in family.childMIMATs:

            mirnas = set()

            for mimat in MI2MIMAT[miID]:
                mirnas.add(MIMAT2MIRNA[mimat])

        familySyn = Synonym(family.familyID)

        for mirna in mirnas:

            allIDs = set(
                mirna.make_strings(
                    miRNA.compositions()[miRNASynonymeTYPE.FAMILY]))
            for syn in allIDs:
                familySyn.addSyn(syn)

        vFamSyns.append(familySyn)

    return vFamSyns
예제 #3
0
def makeMIMATSynonymes():

    mimatSyns = []

    for mimat in MIMAT2MIRNA:

        mirna = MIMAT2MIRNA[mimat]

        mirnaSyn = Synonym(mimat)

        for syn in mirna.make_strings(
                miRNA.compositions()[miRNASynonymeTYPE.MIMAT]):
            mirnaSyn.addSyn(syn)

        mimatSyns.append(mirnaSyn)

    return mimatSyns
예제 #4
0
def makeMISynonymes():
    vMISyns = []

    for mi in MI2MIMAT:

        mimats = MI2MIMAT[mi]
        mirnas = [MIMAT2MIRNA[x] for x in mimats]

        orgSyn = Synonym('ORG' + mi)

        for mirna in mirnas:
            allIDs = set(
                mirna.make_strings(miRNA.compositions()[miRNASynonymeTYPE.MI]))

            for syn in allIDs:
                orgSyn.addSyn(syn)

        vMISyns.append(orgSyn)

    return vMISyns
예제 #5
0
ncitObo = GeneOntology(dataDir + "miRExplore/obodir/ncit.obo")
ncitTerm2Sym = NcitTermSymbolDB.loadFromFolder()

vAllSyns = []

for termID in ncitObo.dTerms:

    oboNode = ncitObo.dTerms[termID]

    oboID = oboNode.id
    oboName = oboNode.name

    oboSyns = oboNode.synonym
    oboRels = oboNode.is_a

    newSyn = Synonym(oboID)
    newSyn.addSyn(oboName)

    if oboSyns != None:
        for x in oboSyns:
            newSyn.addSyn(x.syn)

    allOrgs = [x for x in ncitTerm2Sym.org_term2symbol]

    for org in allOrgs:

        ncitID = oboID[oboID.index(":") + 1:]

        if ncitID in ncitTerm2Sym.org_term2symbol[org]:

            orgSyms = ncitTerm2Sym.org_term2symbol[org][ncitID]
예제 #6
0
        aline = [x.strip() for x in line.split('\t')]

        name = aline[1]

        altNames = StringIO()
        altNames.write(aline[2] + "\n")

        names = []

        for line in csv.reader([aline[2]], dialect='phenotypes'):
            for elem in line:
                names.append(elem)

        names = names + [name]

        newSyn = Synonym( 'DISEASE' + str(len(vAllSyns)+1))
        newSyn.addSyn(name)

        for x in names:

            if x.startswith('[D]') or x.startswith('[X]') or x.startswith('[M]'):
                x = x[3:]

            xsyns = []

            if ' - ' in x:
                xsyns += x.split(' - ')
            else:
                xsyns.append(x)

            for xsyn in xsyns:
예제 #7
0
    allNodes.append(oboNode)

globalKeywordExcludes = loadExludeWords(common=False,
                                        cell_co=False,
                                        disease=False,
                                        generic=False)

for x in globalKeywordExcludes:
    if 'membrane' in globalKeywordExcludes[x]:
        print("Membrane: " + x)

synSet = set()

for node in allNodes:
    newSyn = Synonym(node.id)
    newSyn.addSyn(node.name)

    if node.synonym != None:
        for x in node.synonym:
            if x == None:
                continue
            newSyn.addSyn(x.syn)

    synSet.add(newSyn)

vPrintSyns = handleCommonExcludeWords(synSet,
                                      globalKeywordExcludes,
                                      mostCommonCount=66,
                                      maxCommonCount=5,
                                      minSynCount=0)