gov.nih.nlm.umls.io
Class RichMRMetathesaurusInputStream

java.lang.Object
  extended bygov.nih.nlm.umls.io.RichMRFilesConceptInputStream
      extended bygov.nih.nlm.umls.io.RichMRMetathesaurusInputStream
All Implemented Interfaces:
ConceptInputStream, MetathesaurusInputStream
Direct Known Subclasses:
RichMRMetamorphoSysInputStream

public class RichMRMetathesaurusInputStream
extends RichMRFilesConceptInputStream
implements MetathesaurusInputStream

This ConceptInputStream builds objects from a full set of "Rich Release Format" MR files.

Author:
Deborah Shapiro

Field Summary
protected  int current_index
           
protected  int index_counter
           
protected  int index_lines
           
protected  BufferedReader mraui_source
           
protected  BufferedReader mrcui_source
           
protected  BufferedReader mrsab_source
           
protected  BufferedReader[] mrx_sources
           
 
Fields inherited from class gov.nih.nlm.umls.io.RichMRFilesConceptInputStream
add_suffix, atom_hm, file_names, from_rsab, from_vsab, install_paths, mrcoc_source, mrconso_counter, mrconso_lines, mrconso_source, mrcxt_source, mrdef_source, mrdoc_source, mrhier_source, mrhist_source, mrmap_source, mrrel_source, mrsat_source, mrsty_source, rel_hm, this_concept, to_rsab, to_vsab, tokens
 
Constructor Summary
RichMRMetathesaurusInputStream()
          Instantiates an empty RichMRMetathesaurusInputStream;
 
Method Summary
 void close()
          Close files opened during open(String[]).
 String[] getAmbiguousStringIdentifiers()
          Returns the complete list of suis from the AMBIGSUI list.
 List getAmbiguousStringIdentifiersAsList()
          Returns the complete list of suis from the AMBIGSUI list.
 String[] getAmbiguousTermIdentifiers()
          Returns the complete list of terms from the AMBIGLUI list.
 List getAmbiguousTermIdentifiersAsList()
          Returns the complete list of terms from the AMBIGLUI list.
 int getIndexProgress()
          Returns the percentage of the index file lines that have been processed.
protected  Map getLineCounts()
          Reads through MRFILES.RRF to determine the size of the index files.
 void open(String[] install_paths)
          Opens all of the MR Files in preparation for subsetting.
 IndexEntry readIndexEntry()
          Returns an IndexEntry from one of the index files.
 ReleaseMetadata readReleaseMetadata()
          Returns the ReleaseMetadata containing data from MRSAB.RRF, MRCUI.RRF, MRAUI.RRF, and MRDOC.RRF.
 
Methods inherited from class gov.nih.nlm.umls.io.RichMRFilesConceptInputStream
getAtoms, getAttributes, getComponentHistories, getConceptProgress, getContexts, getCoocurrences, getDefinitions, getMappings, getRelationships, getSemanticTypes, newInstanceFromMRCONSO, newInstanceFromMRHIER, openMRFiles, openSourceFile, readConcept, setAdditionalSuffix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.nih.nlm.umls.io.ConceptInputStream
getConceptProgress, readConcept
 

Field Detail

current_index

protected int current_index

index_lines

protected int index_lines

index_counter

protected int index_counter

mrx_sources

protected BufferedReader[] mrx_sources

mrcui_source

protected BufferedReader mrcui_source

mrsab_source

protected BufferedReader mrsab_source

mraui_source

protected BufferedReader mraui_source
Constructor Detail

RichMRMetathesaurusInputStream

public RichMRMetathesaurusInputStream()
Instantiates an empty RichMRMetathesaurusInputStream;

Method Detail

open

public void open(String[] install_paths)
          throws IOException
Opens all of the MR Files in preparation for subsetting.

Specified by:
open in interface ConceptInputStream
Overrides:
open in class RichMRFilesConceptInputStream
Parameters:
install_paths - the directory containing the files
Throws:
IOException - if any files can not be opened

close

public void close()
           throws IOException
Close files opened during open(String[]).

Specified by:
close in interface ConceptInputStream
Overrides:
close in class RichMRFilesConceptInputStream
Throws:
IOException - if files can not be closed

getLineCounts

protected Map getLineCounts()
                     throws IOException
Reads through MRFILES.RRF to determine the size of the index files. This is used in the getIndexProgress() method.

Overrides:
getLineCounts in class RichMRFilesConceptInputStream
Returns:
Map of file names to lines in file
Throws:
IOException - if the file cannot be opened or read

readIndexEntry

public IndexEntry readIndexEntry()
                          throws IOException
Returns an IndexEntry from one of the index files. We read through the index files one at a time, returning all of the entries.

Specified by:
readIndexEntry in interface MetathesaurusInputStream
Returns:
an IndexEntry from one of the index files
Throws:
IOException - if the files cannot be read

getIndexProgress

public int getIndexProgress()
Returns the percentage of the index file lines that have been processed.

Specified by:
getIndexProgress in interface MetathesaurusInputStream
Returns:
the percentage of the index file lines that have been processed

readReleaseMetadata

public ReleaseMetadata readReleaseMetadata()
                                    throws IOException
Returns the ReleaseMetadata containing data from MRSAB.RRF, MRCUI.RRF, MRAUI.RRF, and MRDOC.RRF.

Specified by:
readReleaseMetadata in interface MetathesaurusInputStream
Returns:
the ReleaseMetadata
Throws:
IOException - if the files could not be read

getAmbiguousStringIdentifiers

public String[] getAmbiguousStringIdentifiers()
                                       throws IOException
Returns the complete list of suis from the AMBIGSUI list. They will be used in calculating entries for the output AMBIGSUI list.

Specified by:
getAmbiguousStringIdentifiers in interface MetathesaurusInputStream
Returns:
list of suis
Throws:
IOException

getAmbiguousStringIdentifiersAsList

public List getAmbiguousStringIdentifiersAsList()
                                         throws IOException
Returns the complete list of suis from the AMBIGSUI list. They will be used in calculating entries for the output AMBIGSUI list.

Specified by:
getAmbiguousStringIdentifiersAsList in interface MetathesaurusInputStream
Returns:
list of suis
Throws:
IOException

getAmbiguousTermIdentifiers

public String[] getAmbiguousTermIdentifiers()
                                     throws IOException
Returns the complete list of terms from the AMBIGLUI list. They will be used in calculating entries for the output AMBIGLUI list.

Specified by:
getAmbiguousTermIdentifiers in interface MetathesaurusInputStream
Returns:
list of terms
Throws:
IOException

getAmbiguousTermIdentifiersAsList

public List getAmbiguousTermIdentifiersAsList()
                                       throws IOException
Returns the complete list of terms from the AMBIGLUI list. They will be used in calculating entries for the output AMBIGLUI list.

Specified by:
getAmbiguousTermIdentifiersAsList in interface MetathesaurusInputStream
Returns:
list of terms
Throws:
IOException


Copyright ©2005