diff --git a/etc/run_fasta.sanger b/etc/run_fasta.sanger index 73fe2cdc4f7b68050b8d78f1272d0185ff14e258..5f6b5a37c4373b547013916ad3325c6bb51214be 100755 --- a/etc/run_fasta.sanger +++ b/etc/run_fasta.sanger @@ -6,7 +6,17 @@ # to customise this script see the function called run_one_prog below -RCS_HEADER="$Header: //tmp/pathsoft/artemis/etc/run_fasta.sanger,v 1.8 2005-11-29 10:13:07 tjc Exp $" +RCS_HEADER="$Header: /cvsroot/pathsoft/artemis/etc/run_fasta.sanger,v 1.8 2005/11/29 10:13:07 tjc Exp $" + +cleanUp() +{ + echo $1 + cat $1 | while thisLine=`line` + do + rm -f $thisLine + done + rm -f $1 +} PROG=`echo $RCS_HEADER | sed 's/.*run_\(.*\),v.*/\1/'` @@ -71,11 +81,12 @@ run_one_prog () { ### change these lines: ### get sequence size - seq_size=`infoseq "$INPUT_FILE" -length -only -auto | awk '{ sum += $1 } END { print sum }` + seq_size=`infoseq "$INPUT_FILE" -length -only -auto | awk '{ sum += $1 } END { print sum }'` - FASTLIBS=/nfs/disk222/yeastpub/bio-soft/fasta/pubseqgbs export FASTLIBS + FASTLIBS=/software/pathogen/external/etc/pubseqgbs export FASTLIBS # EXEC=/nfs/disk222/yeastpub/bio-soft/fasta/fasta33_t - EXEC=/nfs/disk222/yeastpub/bio-soft/fasta/fasta33 +# EXEC=/nfs/disk222/yeastpub/bio-soft/fasta/fasta33 + EXEC=/software/pathogen/external/applications/fasta/fasta35 echo "about to start $EXEC with input from $INPUT_FILE and output to" 1>&2 echo "$OUTPUT_FILE using database $DATABASE" 1>&2 @@ -118,16 +129,18 @@ local *BSUB; my $file = $ARGV[0]; my $database = $ARGV[1]; my $pwd = $ARGV[2]; +my $dirname = $ARGV[3]; chomp $file; chomp $database; -$ENV{'FASTLIBS'} = "/nfs/disk222/yeastpub/bio-soft/fasta/pubseqgbs_test"; +$ENV{'FASTLIBS'} = "/software/pathogen/external/etc/pubseqgbs"; open(BSUB, "| bsub -q normal -o fasta_errors -n 1 -R \"select[blast && mem > 500] rusage[r1m=1:mem=500]\" -K") or die "could not open bsub pipe : $!"; open(LIST_FILE,$file); $EXEC="/nfs/disk222/yeastpub/bio-soft/fasta/fasta33_t"; +$EXEC="/software/pathogen/external/applications/fasta/fasta35"; while(my $inFile = <LIST_FILE>) { @@ -177,13 +190,16 @@ local *BSUB; my $file = $ARGV[0]; my $database = $ARGV[1]; my $pwd = $ARGV[2]; +my $dirname = $ARGV[3]; + chomp $file; chomp $database; -$ENV{'FASTLIBS'} = "/nfs/disk222/yeastpub/bio-soft/fasta/pubseqgbs_test"; +$ENV{'FASTLIBS'} = "/software/pathogen/external/etc/pubseqgbs"; open(LIST_FILE,$file); $EXEC="/nfs/disk222/yeastpub/bio-soft/fasta/fasta33"; +$EXEC="/software/pathogen/external/applications/fasta/fasta35"; $NEW_WDIR="."; $NUM_JOBS=0; @@ -191,6 +207,8 @@ while(my $inFile = <LIST_FILE>) { $NUM_JOBS++; chomp($inFile); + + $inFile =~ s/.automount\/evs-users2\/root/nfs/; if($inFile =~ m/^($pwd)(.*)/) { @@ -394,13 +412,13 @@ sub bsub push(@bsub_jobs, "$name$random\_fasta"); - my $QUEUE="longblastq"; + my $QUEUE="long"; if($NUM_JOBS <= 6) { $QUEUE="normal"; } - open(BSUB, "| bsub -q $QUEUE -o /dev/null -n 1 -R \"select[blast && mem > 500] rusage[mem=500]\" -J$name$random\_fasta\"[$index]%16\"") or die "could not open bsub pipe : $!"; + open(BSUB, "| bsub -q $QUEUE -o /dev/null -n 1 -R \"select[mem > 500] rusage[mem=500]\" -J$name$random\_fasta\"[$index]%16\"") or die "could not open bsub pipe : $!"; print BSUB "cd $NEW_WDIR\n"; print BSUB "$EXEC -B -S -q -b 100 -H $prefix$num"; print BSUB "\${LSB_JOBINDEX} $database ktup 2 > $prefix$num"; @@ -408,6 +426,11 @@ sub bsub print BSUB "gzip -9f $prefix$num"; print BSUB "\${LSB_JOBINDEX}\.out\n"; + print BSUB "zip ${dirname}fasta.zip $prefix$num"; + print BSUB "\${LSB_JOBINDEX}\.out\.gz\n"; + print BSUB "rm -f $prefix$num"; + print BSUB "\${LSB_JOBINDEX}\.out\.gz\n"; + close BSUB or die "--Could not submit job : $!"; } @@ -435,10 +458,13 @@ then CMD=`echo $PERL_PROG_1` ssh babel "cd $WDIR; perl -w -e '$CMD' \"$1\" \"$EXPANDED_DATABASE\" \"$PWD\"" else - perl -w -e "$PERL_PROG" "$1" "$EXPANDED_DATABASE" "$PWD" + DIR=`dirname $PWD/$1` + echo $DIR + perl -w -e "$PERL_PROG" "$1" "$EXPANDED_DATABASE" "$PWD" "$DIR/" fi else run_one_prog $1 $2 $EXPANDED_DATABASE fi +cleanUp $1 exit 0