| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
#UMLS::Association::Measures::LSA |
|
2
|
|
|
|
|
|
|
# Computes the Linking Set Association (LSA) between two sets of terms. |
|
3
|
|
|
|
|
|
|
# |
|
4
|
|
|
|
|
|
|
# LSA works by first finding the set of linking terms for the A terms |
|
5
|
|
|
|
|
|
|
# and C terms to form sets B_A and B_C. It then finds the direct |
|
6
|
|
|
|
|
|
|
# association between sets B_A and B_C |
|
7
|
1
|
|
|
1
|
|
4
|
use strict; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
20
|
|
|
8
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
69
|
|
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
package UMLS::Association::Measures::LSA; |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# Gets stats (n11,n1p,np1,npp) for each pairHash in the pairHashList |
|
13
|
|
|
|
|
|
|
# using linking set association (LSA) |
|
14
|
|
|
|
|
|
|
# Input: |
|
15
|
|
|
|
|
|
|
# $pairHashListRef - ref to an array of pairHashes |
|
16
|
|
|
|
|
|
|
# $matrixFileName - the fileName of the co-occurrence matrix |
|
17
|
|
|
|
|
|
|
# $noOrder - 1 if order is enforced, 0 if not |
|
18
|
|
|
|
|
|
|
# Output: |
|
19
|
|
|
|
|
|
|
# \@statsList - ref to an array of \@stats, refs to arrays |
|
20
|
|
|
|
|
|
|
# containing the ordered values: n11, n1p, np1, npp |
|
21
|
|
|
|
|
|
|
# for each of the pair hashes. The index of the |
|
22
|
|
|
|
|
|
|
# \@statsList corresponds to the index of the pairHash |
|
23
|
|
|
|
|
|
|
# in the input $pairHashListRef |
|
24
|
|
|
|
|
|
|
sub getStats { |
|
25
|
5
|
|
|
5
|
0
|
5
|
my $pairHashListRef = shift; |
|
26
|
5
|
|
|
|
|
5
|
my $matrixFileName = shift; |
|
27
|
5
|
|
|
|
|
4
|
my $noOrder = shift; |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
#get the shared terms pair hash list |
|
30
|
5
|
|
|
|
|
7
|
my $newPairHashListRef = &UMLS::Association::StatFinder::getLinkingTermsPairHashList($pairHashListRef, $matrixFileName, $noOrder); |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
#Compute and return the direct association for shared |
|
33
|
|
|
|
|
|
|
# B to C set associations |
|
34
|
5
|
|
|
|
|
9
|
return &UMLS::Association::Measures::Direct::getStats($newPairHashListRef, $matrixFileName, $noOrder); |
|
35
|
|
|
|
|
|
|
} |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |