]> git.donarmstrong.com Git - biopieces.git/commitdiff
cleaned up BGB track code
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 2 Mar 2010 17:18:46 +0000 (17:18 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Tue, 2 Mar 2010 17:18:46 +0000 (17:18 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@885 74ccb610-7750-0410-82ae-013aeee3265d

code_perl/Maasha/BGB/Track.pm
www/index.cgi

index 806fe9692492fe5b75ca50c60d54e4defb87c90b..bd3c1718ae1dcef37339e7abd12eaab76a20b88e 100644 (file)
@@ -749,7 +749,6 @@ sub list_clade_dir
     my ( @dirs, @clades );
 
     Maasha::Common::error( 'BP_WWW not set in environment' ) if not $ENV{ 'BP_WWW' };
-    Maasha::Common::error( 'no user specified' ) if not $user;
 
     @dirs = Maasha::Filesys::ls_dirs( "$ENV{ 'BP_WWW' }/Data/Users/$user" );
 
@@ -797,8 +796,6 @@ sub list_genome_dir
     my ( @dirs, @genomes );
 
     Maasha::Common::error( 'BP_WWW not set in environment' ) if not $ENV{ 'BP_WWW' };
-    Maasha::Common::error( 'no user specified' ) if not $user;
-    Maasha::Common::error( 'no clade specified' ) if not $clade;
 
     @dirs = Maasha::Filesys::ls_dirs( "$ENV{ 'BP_WWW' }/Data/Users/$user/$clade" );
 
@@ -848,9 +845,6 @@ sub list_assembly_dir
     my ( @dirs, @assemblies );
 
     Maasha::Common::error( 'BP_WWW not set in environment' ) if not $ENV{ 'BP_WWW' };
-    Maasha::Common::error( 'no user specified' ) if not $user;
-    Maasha::Common::error( 'no clade specified' ) if not $clade;
-    Maasha::Common::error( 'no genome specified' ) if not $genome;
 
     @dirs = Maasha::Filesys::ls_dirs( "$ENV{ 'BP_WWW' }/Data/Users/$user/$clade/$genome" );
 
@@ -902,10 +896,6 @@ sub list_contig_dir
     my ( @dirs, @contigs );
 
     Maasha::Common::error( 'BP_WWW not set in environment' ) if not $ENV{ 'BP_WWW' };
-    Maasha::Common::error( 'no user specified' ) if not $user;
-    Maasha::Common::error( 'no clade specified' ) if not $clade;
-    Maasha::Common::error( 'no genome specified' ) if not $genome;
-    Maasha::Common::error( 'no assembly specified' ) if not $assembly;
 
     @dirs = Maasha::Filesys::ls_dirs( "$ENV{ 'BP_WWW' }/Data/Users/$user/$clade/$genome/$assembly" );
 
@@ -959,11 +949,6 @@ sub list_track_dir
     my ( @dirs, @tracks );
 
     Maasha::Common::error( 'BP_WWW not set in environment' ) if not $ENV{ 'BP_WWW' };
-    Maasha::Common::error( 'no user specified' ) if not $user;
-    Maasha::Common::error( 'no clade specified' ) if not $clade;
-    Maasha::Common::error( 'no genome specified' ) if not $genome;
-    Maasha::Common::error( 'no assembly specified' ) if not $assembly;
-    Maasha::Common::error( 'no contig specified' ) if not $contig;
 
     if ( -d "$ENV{ 'BP_WWW' }/Data/Users/$user/$clade/$genome/$assembly/$contig/Tracks" ) {
         @dirs = Maasha::Filesys::ls_dirs( "$ENV{ 'BP_WWW' }/Data/Users/$user/$clade/$genome/$assembly/$contig/Tracks" );
index 0e01a25f4b7e9e4c0c91d37e371e6aa31a1d6e89..3ccd79b04fc951c098a4fc3cf2c795e06df6c99a 100755 (executable)
@@ -85,7 +85,7 @@ sub cookie_default
 
     # Returns a hash.
 
-    my ( $cookie, $path );
+    my ( $cookie );
 
     $cookie = {};
 
@@ -153,25 +153,11 @@ sub cookie_default
     $cookie->{ 'FEAT_COLOR' }      = [ 0, 0, 0 ];
     $cookie->{ 'FEAT_MAX' }        = 5000;
 
-    $path = "$cookie->{ 'DATA_DIR' }/Users";
-
-    $cookie->{ 'LIST_USER' }       = Maasha::Filesys::ls_dirs_base( $path ) if -d $path;
-
-    $path .= "/$cookie->{ 'USER' }";
-
-    $cookie->{ 'LIST_CLADE' }      = Maasha::Filesys::ls_dirs_base( $path ) if -d $path;
-
-    $path .= "/$cookie->{ 'CLADE' }";
-
-    $cookie->{ 'LIST_GENOME' }     = Maasha::Filesys::ls_dirs_base( $path ) if -d $path;
-
-    $path .= "/$cookie->{ 'GENOME' }";
-
-    $cookie->{ 'LIST_ASSEMBLY' }   = Maasha::Filesys::ls_dirs_base( $path ) if -d $path;
-
-    $path .= "/$cookie->{ 'ASSEMBLY' }";
-
-    $cookie->{ 'LIST_CONTIG' }     = Maasha::Filesys::ls_dirs_base( $path ) if -d $path;
+    $cookie->{ 'LIST_USER' }       = Maasha::BGB::Track::list_users();
+    $cookie->{ 'LIST_CLADE' }      = Maasha::BGB::Track::list_clades(     $cookie->{ 'USER' } );
+    $cookie->{ 'LIST_GENOME' }     = Maasha::BGB::Track::list_genomes(    $cookie->{ 'USER' }, $cookie->{ 'CLADE' } );
+    $cookie->{ 'LIST_ASSEMBLY' }   = Maasha::BGB::Track::list_assemblies( $cookie->{ 'USER' }, $cookie->{ 'CLADE' }, $cookie->{ 'GENOME' } );
+    $cookie->{ 'LIST_CONTIG' }     = Maasha::BGB::Track::list_contigs(    $cookie->{ 'USER' }, $cookie->{ 'CLADE' }, $cookie->{ 'GENOME' }, $cookie->{ 'ASSEMBLY' } );
 
     if ( $cookie->{ 'CONTIG' } )
     {