# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
+use warnings;
use strict;
use Data::Dumper;
use vars qw( @ISA @EXPORT );
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> GLOBALS <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
-my ( $HOME, $PATH, $DATA_DIR, $TMP_DIR, $INST_DIR );
+my ( $HOME, $PATH, $BP_DATA, $BP_TMP, $BP_DIR );
$HOME = $ENV{ "HOME" };
$PATH = $ENV{ "PATH" };
-$DATA_DIR = $ENV{ "DATA_DIR" };
-$TMP_DIR = $ENV{ "TMP_DIR" };
-$INST_DIR = $ENV{ "INST_DIR" };
+$BP_DIR = $ENV{ "BP_DIR" };
+$BP_DATA = $ENV{ "BP_DATA" };
+$BP_TMP = $ENV{ "BP_TMP" };
warn qq(WARNING: HOME not set in env\n) if not defined $HOME;
warn qq(WARNING: PATH not set in env\n) if not defined $PATH;
-warn qq(WARNING: DATA_DIR not set in env\n) if not defined $DATA_DIR;
-warn qq(WARNING: TMP_DIR not set in env\n) if not defined $TMP_DIR;
-warn qq(WARNING: INST_DIR not set in env\n) if not defined $INST_DIR;
+warn qq(WARNING: BP_DIR not set in env\n) if not defined $BP_DIR;
+warn qq(WARNING: BP_DATA not set in env\n) if not defined $BP_DATA;
+warn qq(WARNING: BP_TMP not set in env\n) if not defined $BP_TMP;
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
return "$dir/$exe" if -x "$dir/$exe" and not -d "$dir/$exe";
}
- &Maasha::Common::error( qq(Could not find executable \'$exe\') );
+ Maasha::Common::error( qq(Could not find executable \'$exe\') );
}
# Returns string.
- my $genome_file = "$DATA_DIR/genomes/$genome/$genome.fna";
+ my $genome_file = "$BP_DATA/genomes/$genome/$genome.fna";
if ( not -f $genome_file ) {
- &Maasha::Common::error( qq(Genome file "$genome_file" for genome "$genome" not found) );
+ Maasha::Common::error( qq(Genome file "$genome_file" for genome "$genome" not found) );
}
return $genome_file;
# Returns string.
- my $index = "$DATA_DIR/genomes/$genome/$genome.fna.index";
+ my $index = "$BP_DATA/genomes/$genome/$genome.fna.index";
if ( not -f $index ) {
- &Maasha::Common::error( qq(Index file "$index" for genome -> $genome not found) );
+ Maasha::Common::error( qq(Index file "$index" for genome -> $genome not found) );
}
return $index;
# Returns string.
- my $file = "$DATA_DIR/genomes/$genome/blast/$genome.fna";
+ my $file = "$BP_DATA/genomes/$genome/blast/$genome.fna";
return $file;
}
# Returns string.
- my $ooc_file = "$DATA_DIR/genomes/$genome/blat/$tile_size.ooc";
+ my $ooc_file = "$BP_DATA/genomes/$genome/blat/$tile_size.ooc";
- &Maasha::Common::error( qq(ooc file "$ooc_file" not found for genome -> $genome) ) if not -f $ooc_file;
+ Maasha::Common::error( qq(ooc file "$ooc_file" not found for genome -> $genome) ) if not -f $ooc_file;
return $ooc_file;
}
my ( @chrs );
- @chrs = &chromosomes( $genome );
+ @chrs = chromosomes( $genome );
- map { $_ = "$DATA_DIR/genomes/$genome/vmatch/$_" } @chrs;
+ map { $_ = "$BP_DATA/genomes/$genome/vmatch/$_" } @chrs;
# needs robustness check
}
-sub genome_phastcons
-{
- # Martin A. Hansen, January 2008.
-
- # Returns the full path to the location of a concatenated
- # PhastCons file for a given genome.
-
- my ( $genome, # requested genome
- ) = @_;
-
- # Returns a string.
-
- my $file = "$DATA_DIR/genomes/$genome/phastcons/$genome.pp";
-
- return $file;
-}
-
-
-sub genome_phastcons_index
-{
- # Martin A. Hansen, January 2008.
-
- # Returns the full path to the location of a PhastCons index
- # for a given genome.
-
- my ( $genome, # requested genome
- ) = @_;
-
- # Returns a string.
-
- my $file = "$DATA_DIR/genomes/$genome/phastcons/$genome.pp.index";
-
- return $file;
-}
-
-
sub genomes
{
# Martin A. Hansen, February 2008.
my ( %genome_hash, $fh, $line, @genomes, $org );
- $fh = &Maasha::Common::read_open( "$INST_DIR/conf/genomes.conf" );
+ $fh = Maasha::Common::read_open( "$BP_DIR/conf/genomes.conf" );
while ( $line = <$fh> )
{
my ( $fh_in, $line, $org, $chr, %genome_hash, @chrs );
- $fh_in = &Maasha::Common::read_open( "$INST_DIR/conf/genomes.conf" );
+ $fh_in = Maasha::Common::read_open( "$BP_DIR/bp_conf/genomes.conf" );
while ( $line = <$fh_in> )
{
if ( exists $genome_hash{ $genome } ) {
@chrs = @{ $genome_hash{ $genome } };
} else {
- &Maasha::Common::error( qq(Genome -> $genome not found in genome hash) );
+ Maasha::Common::error( qq(Genome -> $genome not found in genome hash) );
}
return wantarray ? @chrs : \@chrs;
}
-sub maf_track
-{
- # Martin A. Hansen, April 2008.
-
- # Given a genome returns the corresponding mafTrack database table name.
-
- my ( $genome, # genome to lookup.
- ) = @_;
-
- # Returns a string.
-
- my ( %hash );
-
- # The below has should be in a config file - fix later.
-
- %hash = (
- danRer4 => 'multiz7way',
- dm2 => 'multiz15way',
- dm3 => 'multiz15way',
- fr2 => 'multiz7way',
- galGal3 => 'multiz7way',
- gasAcu1 => 'multiz7way',
- hg18 => 'multiz17way',
- mm8 => 'multiz17way',
- mm9 => 'multiz17way',
- oryLat1 => 'multiz7way',
- panTro2 => 'multiz17way',
- tetNig1 => 'multiz7way',
- );
-
- &Maasha::Common::error( qw(multiz track not found) ) if not exists $hash{ $genome };
-
- return $hash{ $genome };
-}
-
-
# >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
1;