]> git.donarmstrong.com Git - biopieces.git/blobdiff - code_perl/Maasha/Config.pm
added missing files
[biopieces.git] / code_perl / Maasha / Config.pm
index e25f3f2d7b0286156eea61329261878a98134764..30e8bb1477daf0aea16e3a3d91b29c391cb959d0 100644 (file)
@@ -28,6 +28,7 @@ package Maasha::Config;
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
 
 
+use warnings;
 use strict;
 use Data::Dumper;
 use vars qw( @ISA @EXPORT );
@@ -38,19 +39,19 @@ 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;
 
 
 # >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
@@ -74,7 +75,7 @@ sub get_exe
         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\') );
 }
 
 
@@ -90,10 +91,10 @@ sub genome_fasta
 
     # 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;
@@ -112,10 +113,10 @@ sub genome_fasta_index
 
     # 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;
@@ -133,7 +134,7 @@ sub genome_blast
 
     # Returns string.
 
-    my $file = "$DATA_DIR/genomes/$genome/blast/$genome.fna";
+    my $file = "$BP_DATA/genomes/$genome/blast/$genome.fna";
 
     return $file;
 }
@@ -152,9 +153,9 @@ sub genome_blat_ooc
 
     # 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;
 }
@@ -173,9 +174,9 @@ sub genome_vmatch
 
     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
 
@@ -183,42 +184,6 @@ sub genome_vmatch
 }
 
 
-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.
@@ -230,7 +195,7 @@ sub genomes
 
     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> )
     {
@@ -265,7 +230,7 @@ sub chromosomes
 
     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> )
     {
@@ -283,49 +248,13 @@ sub chromosomes
     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;