Mercurial > repos > pjbriggs > weeder2
comparison weeder2_wrapper.sh @ 1:79f075dc6cfb draft default tip
Uploaded version 2.0.3.
| author | pjbriggs | 
|---|---|
| date | Wed, 26 Sep 2018 06:39:27 -0400 | 
| parents | fb7e680232af | 
| children | 
   comparison
  equal
  deleted
  inserted
  replaced
| 0:fb7e680232af | 1:79f075dc6cfb | 
|---|---|
| 23 # Link to input file | 23 # Link to input file | 
| 24 ln -s $FASTA_IN | 24 ln -s $FASTA_IN | 
| 25 # | 25 # | 
| 26 # Locate the FreqFiles directory | 26 # Locate the FreqFiles directory | 
| 27 if [ $FREQFILES_DIR == "." ] ; then | 27 if [ $FREQFILES_DIR == "." ] ; then | 
| 28 # Use the files in the Weeder2 distribution | 28 # Don't explicitly set the location - Weeder2 from | 
| 29 freqfiles_dir=$WEEDER_FREQFILES_DIR | 29 # bioconda handles this automatically | 
| 30 freqfiles_dir= | |
| 30 else | 31 else | 
| 31 # Alternative location | 32 # Alternative location | 
| 32 freqfiles_dir=$FREQFILES_DIR | 33 freqfiles_dir=$FREQFILES_DIR | 
| 33 fi | 34 fi | 
| 34 # | 35 # | 
| 35 # Link to the FreqFiles directory as weeder2 executable | 36 # Link to the FreqFiles directory as weeder2 executable | 
| 36 # expects it to be the same directory | 37 # expects it to be the same directory | 
| 37 if [ -d $freqfiles_dir ] ; then | 38 if [ ! -z "$freqfiles_dir" ] ; then | 
| 38 echo "Linking to FreqFiles directory: $freqfiles_dir" | 39 if [ -d $freqfiles_dir ] ; then | 
| 39 ln -s $freqfiles_dir FreqFiles | 40 echo "Linking to FreqFiles directory: $freqfiles_dir" | 
| 41 ln -s $freqfiles_dir FreqFiles | |
| 42 else | |
| 43 echo "ERROR FreqFiles directory not found" >&2 | |
| 44 exit 1 | |
| 45 fi | |
| 40 else | 46 else | 
| 41 echo "ERROR FreqFiles directory not found" >&2 | 47 echo "WARNING FreqFiles directory not set" >&2 | 
| 42 exit 1 | |
| 43 fi | 48 fi | 
| 44 # | 49 # | 
| 45 # Construct names of input and output files | 50 # Construct names of input and output files | 
| 46 fasta=`basename $FASTA_IN` | 51 fasta=$(basename $FASTA_IN) | 
| 47 motifs_out=$fasta.w2 | 52 motifs_out=${fasta}.w2 | 
| 48 matrix_out=$fasta.matrix.w2 | 53 matrix_out=${fasta}.matrix.w2 | 
| 49 # | 54 # | 
| 50 # Construct and run weeder command | 55 # Construct and run weeder command | 
| 51 # NB weeder logs output to stderr so redirect to stdout | 56 # NB weeder logs output to stderr so redirect to stdout | 
| 52 # to prevent the Galaxy tool reporting failure | 57 # to prevent the Galaxy tool reporting failure | 
| 53 weeder_cmd="weeder2 -f $fasta -O $SPECIES_CODE $ARGS" | 58 weeder_cmd="weeder2 -f $fasta -O $SPECIES_CODE $ARGS" | 
| 61 fi | 66 fi | 
| 62 # | 67 # | 
| 63 # Move outputs to final destinations | 68 # Move outputs to final destinations | 
| 64 if [ -e $motifs_out ] ; then | 69 if [ -e $motifs_out ] ; then | 
| 65 /bin/mv $motifs_out $MOTIFS_OUT | 70 /bin/mv $motifs_out $MOTIFS_OUT | 
| 71 else | |
| 72 echo ERROR missing output file: $motifs_out >&2 | |
| 73 status=1 | |
| 66 fi | 74 fi | 
| 67 if [ -e $matrix_out ] ; then | 75 if [ -e $matrix_out ] ; then | 
| 68 /bin/mv $matrix_out $MATRIX_OUT | 76 /bin/mv $matrix_out $MATRIX_OUT | 
| 77 else | |
| 78 echo ERROR missing output file: $matrix_out >&2 | |
| 79 status=1 | |
| 69 fi | 80 fi | 
| 70 # | 81 # | 
| 71 # Done | 82 # Done | 
| 83 exit $status | 
