From: martinahansen Date: Tue, 26 Aug 2008 03:49:54 +0000 (+0000) Subject: fixed bug in table name check X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=dad280426c788a6cc46bd8a36af6ec5bc9b6e1de;p=biopieces.git fixed bug in table name check git-svn-id: http://biopieces.googlecode.com/svn/trunk@226 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/code_perl/Maasha/Biopieces.pm b/code_perl/Maasha/Biopieces.pm index 69de5bb..328bc96 100644 --- a/code_perl/Maasha/Biopieces.pm +++ b/code_perl/Maasha/Biopieces.pm @@ -978,7 +978,7 @@ sub get_options map { Maasha::Common::error( qq(Argument to --cols must be a whole numbers - not "$_") ) if $_ !~ /^\d+$/ } @{ $options{ "cols" } } if $options{ "cols" }; -# print STDERR Dumper( \%options ); + # print STDERR Dumper( \%options ); foreach $opt ( keys %options ) { @@ -1019,9 +1019,9 @@ sub get_options { Maasha::Common::error( qq(Bad --$opt argument "$options{ $opt }") ); } - elsif ( $opt eq "table" and $options{ $opt } =~ /-\./ ) + elsif ( $opt eq "table" and $options{ $opt } =~ /(-|\.)/ ) { - Maasha::Common::error( qq(Character '$options{ $opt }' is not allowed in table names) ); + Maasha::Common::error( qq(Character '$1' is not allowed in table name: $options{ $opt }) ); } elsif ( $opt eq "merge" and $options{ $opt } !~ /^(AandB|AorB|BorA|AnotB|BnotA)$/ ) { @@ -6092,7 +6092,12 @@ sub script_upload_to_ucsc Maasha::Common::dir_create_if_not_exists( $wib_dir ); - `cd $BP_TMP && wigEncode $file $wig_file $wib_file > /dev/null 2>&1`; + if ( $options->{ 'verbose' } ) { + `cd $BP_TMP && wigEncode $file $wig_file $wib_file`; + } else { + `cd $BP_TMP && wigEncode $file $wig_file $wib_file > /dev/null 2>&1`; + } + Maasha::Common::run( "mv", "$BP_TMP/$wib_file $wib_dir" ); unlink $file; diff --git a/code_perl/Maasha/UCSC.pm b/code_perl/Maasha/UCSC.pm index 9ea87e4..1521742 100644 --- a/code_perl/Maasha/UCSC.pm +++ b/code_perl/Maasha/UCSC.pm @@ -1527,7 +1527,11 @@ sub wiggle_upload_to_ucsc # Maasha::Common::run( "hgLoadWiggle", "$args > /dev/null 2>&1" ); - `cd $tmp_dir && hgLoadWiggle -tmpDir=$tmp_dir -pathPrefix=$wib_dir $options->{ 'database' } $options->{ 'table' } $wig_file > /dev/null 2>&1`; + if ( $options->{ 'verbose' } ) { + `cd $tmp_dir && hgLoadWiggle -tmpDir=$tmp_dir -pathPrefix=$wib_dir $options->{ 'database' } $options->{ 'table' } $wig_file`; + } else { + `cd $tmp_dir && hgLoadWiggle -tmpDir=$tmp_dir -pathPrefix=$wib_dir $options->{ 'database' } $options->{ 'table' } $wig_file > /dev/null 2>&1`; + } }