src/hg/encode/encodeDownloadsPage/encodeDownloadsPage.pl 1.9
1.9 2009/04/23 21:04:10 tdreszer
Special case coding for Elnitski with her tables scattered across genomes.
Index: src/hg/encode/encodeDownloadsPage/encodeDownloadsPage.pl
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/hg/encode/encodeDownloadsPage/encodeDownloadsPage.pl,v
retrieving revision 1.8
retrieving revision 1.9
diff -b -B -U 4 -r1.8 -r1.9
--- src/hg/encode/encodeDownloadsPage/encodeDownloadsPage.pl 23 Apr 2009 17:08:51 -0000 1.8
+++ src/hg/encode/encodeDownloadsPage/encodeDownloadsPage.pl 23 Apr 2009 21:04:10 -0000 1.9
@@ -236,25 +236,39 @@
my @file = split(/\s+/, $line); # White space
#print OUT_FILE join ' ', @file,"\n";
my @path = split('/', $file[5]); # split on /
my $fileName = $path[$#path]; # Last element
- my ($tableName,$dataType) = split('\.', $fileName); # tableName I hope
+ my $tableName = "";
+ my $dataType = "";
+ ### Special case for Elnitski BiPs !!!
+ my $database = "hg18"; # default
+ if ( ($fileName =~ tr/\.//) == 3 ) { # tableName.db.dataType.gz
+ ($tableName,$database,$dataType) = split('\.', $fileName); # tableName I hope
+ if($database ne "panTro2" && $database ne "mm9" && $database ne "canFam2"
+ && $database ne "rheMac2" && $database ne "rn4" && $database ne "bosTau4") {
+ $database = "hg18"; # default
+ }
+ } else
+ ### Special case for Elnitski BiPs !!!
+ {
+ ($tableName,$dataType) = split('\.', $fileName); # tableName I hope
+ }
#print OUT_FILE "Path:$file[5] File:$fileName Table:$tableName\n";
my $releaseDate = "";
my $submitDate = "";
my %metaData;
my $typePrefix = "";
- my $results = $db->quickQuery("select type from trackDb where tableName = '$tableName'");
+ my $results = $db->quickQuery("select type from $database.trackDb where tableName = '$tableName'");
if($results) {
my ($type) = split(/\s+/, $results); # White space
$metaData{type} = $type;
} else {
if($dataType eq "fastq" || $dataType eq "tagAlign" || $dataType eq "csfasta" || $dataType eq "csqual") {
$metaData{type} = $dataType;
}
}
- $results = $db->quickQuery("select settings from trackDb where tableName = '$tableName'");
+ $results = $db->quickQuery("select settings from $database.trackDb where tableName = '$tableName'");
if(!$results) {
### TODO: This needs to be replaced with a lookup of fileDb.ra
my $associatedTable = $tableName;
$associatedTable =~ s/RawData/RawSignal/ if $tableName =~ /RawData/;