-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMyConfig.pm
121 lines (91 loc) · 3.19 KB
/
MyConfig.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#
#===============================================================================
#
# FILE: MyConfig.pm
#
# DESCRIPTION: Package to work space configuration
# BUGS: ---
# NOTES: ---
# AUTHOR: Chaolin Zhang (cz), czhang@rockefeller.edu
# COMPANY: Rockefeller University
# VERSION: 1.0
# CREATED: 11/22/2004
# REVISION: ---
#===============================================================================
package MyConfig;
require Exporter;
our $VERSION = 1.02;
@ISA = qw (Exporter);
@EXPORT = qw (
getDefaultCache
getGenomeDir
);
use strict;
use warnings;
=head1 Bed
Subroutines to handle workspace
=cut
use Carp;
my $user = `whoami`;
chomp $user;
my $projHome = $ENV {"HOME"} . "/scratch";
$projHome = $ENV {"PROJDIR"} if exists $ENV{"PROJDIR"};
sub getDefaultCache
{
my $base = "cache";
$base = $_[0] if (@_ > 0);
my $cacheHome = ".";
$cacheHome = $ENV{'CACHEHOME'} if exists $ENV{'CACHEHOME'};
my $cache = "$cacheHome/$base" . "_" . time() . "_" . rand();
return $cache;
}
sub getDefaultTmpDir
{
return getDefaultCache (@_);
}
sub getGenomeDir
{
my $species =$_[0];
my $genomeDir = "/ifs/data/c2b2/cz_lab/genomes";
$genomeDir = $ENV{'DATADIR'} . "/genomes" unless -d $genomeDir;
#cz: please do not change this default dir
my $path = "$genomeDir/$species";
Carp::croak "can not find the directory for $species: $path\n" unless -d $path;
return $path;
=obsolete
return "$genomeDir/mm5" if ($species eq 'mm5');
return "$genomeDir/mm6" if ($species eq 'mm6');
return "$genomeDir/mm8" if ($species eq 'mm8');
return "$genomeDir/mm9" if ($species eq 'mm9');
return "$genomeDir/mm10" if ($species eq 'mm10');
return "$genomeDir/hg17" if ($species eq 'hg17');
return "$genomeDir/hg18" if ($species eq 'hg18');
return "$genomeDir/hg19" if ($species eq 'hg19');
return "$genomeDir/hg38" if ($species eq 'hg38');
return "$genomeDir/panTro3" if ($species eq 'panTro3');
return "$genomeDir/panTro4" if ($species eq 'panTro4');
return "$genomeDir/papAnu2" if ($species eq 'papAnu2');
return "$genomeDir/calJac3" if ($species eq 'calJac3');
return "$genomeDir/saiBol1" if ($species eq 'saiBol1');
return "$genomeDir/micMur1" if ($species eq 'micMur1');
return "$genomeDir/ponAbe2" if ($species eq 'ponAbe2');
return "$genomeDir/gorGor3" if ($species eq 'gorGor3');
return "$genomeDir/rheMac2" if ($species eq 'rheMac2');
return "$genomeDir/rheMac3" if ($species eq 'rheMac3');
return "$genomeDir/monDom5" if ($species eq 'monDom5');
return "$genomeDir/ornAna1" if ($species eq 'ornAna1');
return "$genomeDir/rn4" if ($species eq 'rn4');
return "$genomeDir/rn5" if ($species eq 'rn5');
return "$genomeDir/bosTau7" if ($species eq 'bosTau7');
return "$genomeDir/galGal4" if ($species eq 'galGal4');
return "$genomeDir/danRer4" if ($species eq 'danRer4');
return "$genomeDir/xenTro3" if ($species eq 'xenTro3');
return "$genomeDir/dm6" if ($species eq 'dm6');
return "$genomeDir/dm2" if ($species eq 'dm2');
return "$genomeDir/ce2" if ($species eq 'ce2');
return "$genomeDir/sacCer1" if ($species eq 'sacCer1');
return "$genomeDir/danRer10" if ($species eq 'danRer10');
Carp::croak "can not find the directory for $species\n";
=cut
}
1;