ALBD

 view release on metacpan or  search on metacpan

config/association  view on Meta::CPAN

#                Configuration File for UMLS::Association
##############################################################################
# All the options in this file are passed to put into an options hash and 
# passed directly to UMLS::Association for initialization. Options hash keys 
# are in <>'s, and values follow directly after with no space. As as example, 
# the line "<database>bigrams" will pass the 'database' parameter with a 
# value of 'bigrams' to the  UMLS::Association options hash for its 
# initialization.
#
# For parameters where no value is needed, just write the name of the
# parameter in '<>' (e.g. '<debug>')

<database>CUI_Bigram
<hostname>192.168.24.89
<username>henryst
<password>OhFaht3eique
<socket>/var/run/mysqld.sock
<t>

config/interface  view on Meta::CPAN

#############################################################################
#                Configuration File for UMLS::Interface
############################################################################
# All the options in this file are passed to put into an options hash and 
# passed directly to UMLS::Interface for initialization. Options hash keys 
# are in <>'s, and values follow directly after with no space. As as example, 
# the line "<database>umls" will pass the 'database' parameter with a value 
# of 'umls' of UMLS::Interface options hash for its initialization.
#
# For parameters where no value is needed, just write the name of the
# parameter in '<>' (e.g. '<debug>')

<t>
<config>interfaceConfig

<hostname>192.168.24.89
<username>henryst
<password>OhFaht3eique
<socket>/var/run/mysqld.sock

config/lbd  view on Meta::CPAN

##############################################################################
#            Configuration File for Literature Based Discovery
##############################################################################
# All the options in this file are parsed and used as parameters for
# Literature Based Discovery
# Options keys are in <>'s, and values follow directly after with no space. 
# As as example, the line "<rankingMethod>ll" will set the 'rankingMethod' 
# parameter with a value of 'll' for literature based discovery
#
# For parameters where no value is needed, just write the name of the
# parameter in '<>' (e.g. '<debug>')

<rankingProcedure>averageMinimumWeight
<rankingMethod>chi
<implicitOutputFile>../samples/sampleLBDOutput

<linkingAcceptGroups>CHEM,DISO,GENE,PHYS,ANAT
<targetAcceptGroups>CHEM,GENE

<startCuis>C0034734,C0034735

lib/ALBD.pm  view on Meta::CPAN


# returns the version currently being used
# input : none
# output: the version number being used
sub version {
    my $self = shift;
    return $VERSION;
}

##############################################################################
#        functions for debugging
##############################################################################
=comment
sub debugLBD {
    my $self = shift;
    my $startingCuisRef = shift;

    print "Starting CUIs = ".(join(',', @{$startingCuisRef}))."\n";

#Get the Explicit Matrix
    my ($explicitMatrixRef, $cuiToIndexRef, $indexToCuiRef, $matrixSize) = 
	Discovery::tableToSparseMatrix('N_11', $cuiFinder);
    print "Explicit Matrix:\n";
    _printMatrix($explicitMatrixRef, $matrixSize, $indexToCuiRef);

lib/LiteratureBasedDiscovery/Filters.pm  view on Meta::CPAN

# input:  $matrixRef <- ref to a sparse matrix to be filtered
#         $acceptTypesRef <- a ref to a hash of accept type strings
#         $umls <- an instance of UMLS::Interface
# output: None, but $vectorRef is updated 
sub semanticTypeFilter_rowsAndColumns {
    my $matrixRef = shift;
    my $acceptTypesRef = shift;
    my $umls = shift;
 
=comment   
    #Count the number of keys before and after filtering (for debugging)
    my %termsHash = ();
    foreach my $key1 (keys %{$matrixRef}) {
	foreach my $key2 (keys %{${$matrixRef}{$key1}}) {
	    $termsHash{$key2} = 1;
	}
    }
    print "   number of keys before filtering = ".(scalar keys %termsHash)."\n";
=cut

    #eliminate values that are incorrect semantic groups

lib/LiteratureBasedDiscovery/Filters.pm  view on Meta::CPAN


	    #eliminate if needed
	    if ($cuisChecked{$cui2} < 0) {
		delete ${${$matrixRef}{$cui1}}{$cui2};
	    }
	}
    }


=comment
    #Count the number of keys after filtering (for debugging)
    %termsHash = ();
    foreach my $key1 (keys %{$matrixRef}) {
	foreach my $key2 (keys %{${$matrixRef}{$key1}}) {
	    $termsHash{$key2} = 1;
	}
    }
    print "   number of keys after filtering = ".(scalar keys %termsHash)."\n";
=cut
}

lib/LiteratureBasedDiscovery/Filters.pm  view on Meta::CPAN

# input:  $matrixRef <- ref to a sparse matrix to be filtered
#         $acceptTypesRef <- a ref to a hash of accept type strings
#         $umls <- an instance of UMLS::Interface
# output: None, but $vectorRef is updated 
sub semanticTypeFilter_rows {
    my $matrixRef = shift;
    my $acceptTypesRef = shift;
    my $umls = shift;
    
=comment
    #Count the number of keys before and after filtering (for debugging)
    my %termsHash = ();
    foreach my $key1 (keys %{$matrixRef}) {
	foreach my $key2 (keys %{${$matrixRef}{$key1}}) {
	    $termsHash{$key2} = 1;
	}
    }
    print "   number of keys before filtering = ".(scalar keys %termsHash)."\n";
=cut

    #eliminate values that are incorrect semantic groups

lib/LiteratureBasedDiscovery/Filters.pm  view on Meta::CPAN

	}

	#eliminate if needed
	if ($keep < 0) {
	    delete ${$matrixRef}{$cui1};
	}
	$keep = -1;
    }

=comment
    #Count the number of keys after filtering (for debugging)
    %termsHash = ();
    foreach my $key1 (keys %{$matrixRef}) {
	foreach my $key2 (keys %{${$matrixRef}{$key1}}) {
	    $termsHash{$key2} = 1;
	}
    }
    print "   number of keys after filtering = ".(scalar keys %termsHash)."\n";
=cut
}

lib/LiteratureBasedDiscovery/Filters.pm  view on Meta::CPAN

# input:  $matrixRef <- ref to a sparse matrix to be filtered
#         $acceptTypesRef <- a ref to a hash of accept type strings
#         $umls <- an instance of UMLS::Interface
# output: None, but $vectorRef is updated 
sub semanticTypeFilter_columns {
    my $matrixRef = shift;
    my $acceptTypesRef = shift;
    my $umls = shift;
 
=comment   
    #Count the number of keys before and after filtering (for debugging)
    my %termsHash = ();
    foreach my $key1 (keys %{$matrixRef}) {
	foreach my $key2 (keys %{${$matrixRef}{$key1}}) {
	    $termsHash{$key2} = 1;
	}
    }
    print "   number of keys before filtering = ".(scalar keys %termsHash)."\n";
=cut

    #eliminate values that are incorrect semantic groups

lib/LiteratureBasedDiscovery/Filters.pm  view on Meta::CPAN

	    }

	    #eliminate if needed
	    if ($cuisChecked{$cui2} < 0) {
		delete ${${$matrixRef}{$cui1}}{$cui2};
	    }
	}
    }

=comment
    #Count the number of keys after filtering (for debugging)
    %termsHash = ();
    foreach my $key1 (keys %{$matrixRef}) {
	foreach my $key2 (keys %{${$matrixRef}{$key1}}) {
	    $termsHash{$key2} = 1;
	}
    }
    print "   number of keys after filtering = ".(scalar keys %termsHash)."\n";
=cut

}

samples/configFileSamples/UMLSAssociationConfig  view on Meta::CPAN

#                Configuration File for UMLS::Association
##############################################################################
# All the options in this file are passed to put into an options hash and 
# passed directly to UMLS::Association for initialization. Options hash keys 
# are in <>'s, and values follow directly after with no space. As as example, 
# the line "<database>bigrams" will pass the 'database' parameter with a 
# value of 'bigrams' to the  UMLS::Association options hash for its 
# initialization.
#
# For parameters where no value is needed, just write the name of the
# parameter in '<>' (e.g. '<debug>')
#
#
# See UMLS::Association for more detailed

# Database of Association Scores. Not used, but required to initialize
# UMLS::Association
<database>CUI_Bigram

# If the UMLS::Association Database is not installed on the local machine
# The following parameters may be needed to connect to the server

samples/configFileSamples/UMLSInterfaceConfig  view on Meta::CPAN

#############################################################################
#                Configuration File for UMLS::Interface
############################################################################
# All the options in this file are passed to put into an options hash and 
# passed directly to UMLS::Interface for initialization. Options hash keys 
# are in <>'s, and values follow directly after with no space. As as example, 
# the line "<database>umls" will pass the 'database' parameter with a value 
# of 'umls' of UMLS::Interface options hash for its initialization.
#
# For parameters where no value is needed, just write the name of the
# parameter in '<>' (e.g. '<debug>')
#
#
# See UMLS::Interface for more detail

# makes the UMLS::Interface not print to the command line
<t>

# Put the full pathname of the UMLS::Interface Config File
<config>/home/sam/assocLBD-0.01/config/interfaceConfig

samples/lbdConfig  view on Meta::CPAN

##############################################################################
#            Configuration File for Literature Based Discovery
##############################################################################
# All the options in this file are parsed and used as parameters for
# Literature Based Discovery
# Options keys are in <>'s, and values follow directly after with no space. 
# As as example, the line "<rankingMethod>ll" will set the 'rankingMethod' 
# parameter with a value of 'll' for literature based discovery
#
# For parameters where no value is needed, just write the name of the
# parameter in '<>' (e.g. '<debug>')
# lines started with a # are skipped and may be used for comments

# The ranking procedure to use for LBD
# valid ranking procedures are:
#   allPairs (maxBC) - maximum B to C term value
#   averageMinimumWeight (AMW) - average of minimum A to B and B to C values
#   linkingTermCount* (LTC) - count of shared linking terms
#   frequency* (freq) - sum of A to B co-occurrences of shared B terms
#   ltcAssociation (LTA) - association measures that use linking terms as inputs
#   ltc_AMW - linking term count with AMW as a tie-breaker

samples/timeSlicingConfig  view on Meta::CPAN

##############################################################################
#            Configuration File for Literature Based Discovery
##############################################################################
# All the options in this file are parsed and used as parameters for
# Literature Based Discovery
# Options keys are in <>'s, and values follow directly after with no space. 
# As as example, the line "<rankingMethod>ll" will set the 'rankingMethod' 
# parameter with a value of 'll' for literature based discovery
#
# For parameters where no value is needed, just write the name of the
# parameter in '<>' (e.g. '<debug>')
# lines started with a # are skipped and may be used for comments

#----- Time Slicing Specific Parameters ------------------------

#Tell LBD to enter precision and recall mode (time slicing)
<precisionAndRecall_implicit>

# name of the file that contains a new line seperated list of cuis
# each cui serves as a start term. The average of all cuis in this
# file are what is reported for precision and recall

utils/datasetCreator/makeOrderNotMatter.pl  view on Meta::CPAN

# the result to file
use strict;
use warnings;

use Getopt::Long;

my $DEBUG = 0;
my $HELP = '';
my %options = ();

GetOptions( 'debug'             => \$DEBUG, 
            'help'              => \$HELP,
            'inputFile=s'       => \$options{'inputFile'},
	    'outputFile=s'      => \$options{'outputFile'},
);
#TODO add stuff for help and debug

#input checking
(exists $options{'inputFile'}) or die ("inputFile must be specified\n");
open IN, $options{'inputFile'} or 
    die ("unable to open input file: $options{inputFile}\n");

(exists $options{'outputFile'}) or die ("outputFile must be specified\n");
open OUT, '>'.$options{'outputFile'} or 
    die ("unable to open output file: $options{outputFile}\n");

utils/datasetCreator/squaring/squareMatrix_perl.pl  view on Meta::CPAN

#squares a matrix from file and writes the result to file
#use strict;
#use warnings;

#use Getopt::Long;

my $DEBUG = 0;
my $HELP = '';
my %options = ();

#GetOptions( 'debug'             => \$DEBUG, 
#            'help'              => \$HELP,
#            'inputFile=s'       => \$options{'inputFile'},
#	    'outputFile=s'      => \$options{'outputFile'},
#);
#TODO add stuff for help and debug

$options{'inputFile'} = shift;
$options{'outputFile'} = shift;

#input checking
(exists $options{'inputFile'}) or die ("inputFile must be specified\n");

#ensure the input file can be read
open IN, $options{'inputFile'} or 
    die ("unable to open input file: $options{inputFile}\n");

utils/datasetCreator/testMatrixEquality.pl  view on Meta::CPAN

use strict;
use warnings;

use Getopt::Long;
use LiteratureBasedDiscovery::Discovery;

my $DEBUG = 0;
my $HELP = '';
my %options = ();

GetOptions( 'debug'             => \$DEBUG, 
            'help'              => \$HELP,
            'inputFileA=s'       => \$options{'inputFileA'},
	    'inputFileB=s'      => \$options{'inputFileB'},
);
#TODO add stuff for help and debug

#input checking
(exists $options{'inputFileA'}) or die ("inputFileA must be specified\n");
open IN, $options{'inputFileA'} or 
    die ("unable to open input file: $options{inputFileA}\n");
close IN;
(exists $options{'inputFileB'}) or die ("inputFileB must be specified\n");
open IN, $options{'inputFileB'} or 
    die ("unable to open input file: $options{inputFileB}\n");
close IN;

utils/runDiscovery.pl  view on Meta::CPAN

path to a UMLS::Association configuration file. Default location is 
'../config/association'. Replace this file for your computer to avoid having
to specify each time.

=head3 --interfaceConfig

path to a UMLS::Interface configuration file. Default location is 
'../config/interface'. Replace this file for your computer to avoid having
to specify each time.

=head3 --debug

enter debug mode

=head3 --version

display the version number

=head1 OUTPUT

A file containing the results of LBD

=head1 SYSTEM REQUIREMENTS

utils/runDiscovery.pl  view on Meta::CPAN

use Getopt::Long;
use ALBD;

###############################################################################
# CONSTANT STRINGS
###############################################################################

my $usage = "Error Running LBD, Usage Instructions:\n\n"
."   runDiscovery LBD_CONFIG_FILE [OPTIONS]\n\n"
."FLAGS\n"
."   --debug       Print EVERYTHING to STDERR.\n"
."   --help        Print this help screen.\n"
."   --version     Print the version number\n"
."\nOPTIONS\n"
."   --assocConfig        path to the UMLS::Association Config File\n"
."   --interfaceConfig    path to the UMLS::Interface Config File\n"
."\nUSAGE EXAMPLES\n"
."   runDiscovery lbdConfigFile\n";
;

#############################################################################

utils/runDiscovery.pl  view on Meta::CPAN

my $DEBUG = 0;      # Prints EVERYTHING. Use with small testing files.        
my $HELP = '';      # Prints usage and exits if true.
my $VERSION;

#set default param values
my %options = ();
$options{'assocConfig'}  = '';
$options{'interfaceConfig'} = '';

#grab all the options and set values
GetOptions( 'debug'             => \$DEBUG, 
            'help'              => \$HELP,
	    'version'           => \$VERSION,
            'assocConfig=s'     => \$options{'assocConfig'},
            'interfaceConfig=s' => \$options{'interfaceConfig'},
);
 
#Check for version or help
if ($VERSION) {
    print "current version is ".(ALBD->version())."\n";
    exit;

utils/runDiscovery.pl  view on Meta::CPAN

    print "--assocConfig        path to a UMLS::Association configuration\n";
    print "                     file. Default location is \n";
    print "                     '../config/association'. Replace this file\n";
    print "                     for your computer to avoid having to specify\n";
    print "                     each time.\n";
    print "--interfaceConfig    path to a UMLS::Interface configuration\n";
    print "                     file. Default location is \n";
    print "                     '../config/interface'. Replace this file \n";
    print "                     for your computer to avoid having to specify\n";
    print "                     each time.\n";
    print "--debug              enter debug mode\n";
    print "--version            prints the current version to screen\n";
};



( run in 1.518 second using v1.01-cache-2.11-cpan-49f99fa48dc )