src/hg/utils/automation/Encode.pm 1.54

1.54 2009/12/22 06:07:07 kate
Add access for CV rags (used by reporting)
Index: src/hg/utils/automation/Encode.pm
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/utils/automation/Encode.pm,v
retrieving revision 1.53
retrieving revision 1.54
diff -b -B -U 4 -r1.53 -r1.54
--- src/hg/utils/automation/Encode.pm	15 Dec 2009 18:49:34 -0000	1.53
+++ src/hg/utils/automation/Encode.pm	22 Dec 2009 06:07:07 -0000	1.54
@@ -208,8 +208,24 @@
     }
     return %terms;
 }
 
+sub getControlledVocabTags
+{
+# Returns hash of cv tags, indexed by the types in the cv.ra file
+    my ($configPath) = @_;
+    my %tags = ();
+    my %termRa = RAFile::readRaFile("$configPath/$vocabConfigFile", "term");
+    foreach my $term (keys %termRa) {
+        my $type = $termRa{$term}->{type};
+        my $tag = $termRa{$term}->{tag};
+        die "no type for $term" unless defined($type);
+        die "no tag for $term" unless defined($tag);
+        $tags{$type}->{$tag} = $termRa{$term};
+    }
+    return %tags;
+}
+
 sub getFields
 {
 # Gather fields defined for DDF file. File is in
 # ra format:  field <name>, required <true|false>