From: martinahansen Date: Tue, 2 Mar 2010 17:18:46 +0000 (+0000) Subject: cleaned up BGB track code X-Git-Url: https://git.donarmstrong.com/?p=biopieces.git;a=commitdiff_plain;h=f0634bef268b3d8cb4712c6ed13015dbc2c694ec cleaned up BGB track code git-svn-id: http://biopieces.googlecode.com/svn/trunk@885 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/code_perl/Maasha/BGB/Track.pm b/code_perl/Maasha/BGB/Track.pm index 806fe96..bd3c171 100644 --- a/code_perl/Maasha/BGB/Track.pm +++ b/code_perl/Maasha/BGB/Track.pm @@ -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" ); diff --git a/www/index.cgi b/www/index.cgi index 0e01a25..3ccd79b 100755 --- a/www/index.cgi +++ b/www/index.cgi @@ -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' } ) {