Skip to content

Instantly share code, notes, and snippets.

@tricead
tricead / TuiFilterer.py
Created April 2, 2020 17:32
A script to filter the MRCONSO table in the UMLS metathesaurus by the TUI semantic value in the MRSTY table
import csv
mrconso = open("/Path/MRCONSO.RRF", 'r')
mrsty = open("/Path/MRSTY.RRF", 'r')
cuituidict = {}
for line in mrsty.readlines():
splitline = line.split("|")
cui = splitline[0]
tui = splitline[1]
if(cuituidict.get(cui) == None):
cuituidict[cui] = [tui]
#!/usr/bin/env python
#the above just indicates to use python to intepret this file
# ---------------------------------------------------------------
#This mapper code will input a line of text and output <word, 1>
#
# ---------------------------------------------------------------
import sys #a python module with system functions for this OS
public static void main(String[] args){
System.out.print("hello world")
}