|
#! /bin/tcsh -f |
|
|
|
# |
|
# NetOGlyc 3.1d - main script |
|
# |
|
# AUTHOR: Karin Julenius, kj@cbs.dtu.dk |
|
# |
|
# VERSIONS: 3.0a 24 Jun 2003 launch, scripted by K. Rapacki |
|
# 3.0b 13 Jan 2004 added surface pred, K. Rapacki |
|
# 3.1a 23 Apr 2004 added single site pred, K. Rapacki |
|
# 3.1b 9 Jun 2004 packaging, K. Rapacki |
|
# 15 Jun 2004 bug fixes, see README |
|
# 6 Jan 2005 bug fix, see README |
|
# 3.1c 5 Aug 2005 bug fix, see README |
|
# 15 Sep 2005 better cleanup, HHS |
|
# 3.1d 26 Sep 2005 bug fixes in seq2seq.awk, surfg |
|
# and fasta2howlin, see README |
|
# TMP variable implemented |
|
# |
|
|
|
############################################################################### |
|
# GENERAL SETTINGS: CUSTOMIZE TO YOUR SITE |
|
############################################################################### |
|
|
|
# full path to the NetOGlyc-3.1 directory (mandatory) |
|
setenv GLYCHOME /home/chris/Programas/secretome/netOglyc-3.1d |
|
|
|
# determine platform (do not change this unless you don't have 'uname'!) |
|
setenv SYSTEM `uname -s` |
|
|
|
# determine where to store temporary files (must be writable to all users) |
|
setenv TMP /var/tmp |
|
|
|
# configure auxiliary software (see installation instructions) |
|
if (( $SYSTEM == "IRIX" ) || ( $SYSTEM == "IRIX64" )) then # typical IRIX |
|
|
|
setenv ECHO /sbin/echo |
|
setenv AWK /usr/freeware/bin/gawk |
|
setenv PASTE /usr/bin/paste |
|
setenv GNUPLOT /usr/freeware/bin/gnuplot |
|
setenv PPM2GIF /usr/freeware/bin/ppmtogif |
|
setenv SIGNALP /home/chris/Programas/secretome/signalp-4.1 |
|
|
|
else if ( $SYSTEM == "Linux" ) then # typical Linux |
|
|
|
setenv ECHO /bin/echo |
|
setenv AWK /usr/bin/gawk |
|
setenv PASTE /usr/bin/paste |
|
setenv GNUPLOT /usr/bin/gnuplot |
|
setenv PPM2GIF /usr/bin/ppmtogif |
|
setenv SIGNALP /home/chris/Programas/secretome/signalp-4.1 |
|
|
|
else # edit to suit your UNIX |
|
|
|
setenv ECHO /usr/bin/echo |
|
setenv AWK /bin/nawk |
|
setenv PASTE /usr/bin/paste |
|
setenv GNUPLOT /usr/bin/gnuplot |
|
setenv PPM2GIF /usr/bin/ppmtogif |
|
setenv SIGNALP /usr/cbs/bio/bin/signalp |
|
|
|
endif |
|
|
|
############################################################################### |
|
# NOTHING SHOULD NEED CHANGING BELOW THIS LINE! |
|
############################################################################### |
|
|
|
|
|
# configured correctly? ======================================================= |
|
if ( ! $?GLYCHOME ) then # mandatory: GLYCHOME |
|
echo netOglyc: GLYCHOME must be set |
|
exit 1 |
|
else if ( ! -d $GLYCHOME) then |
|
echo netOglyc: cannot find GLYCHOME in $GLYCHOME |
|
exit 1 |
|
endif |
|
|
|
if ( ! $?ECHO ) then # mandatory: ECHO |
|
echo netOglyc: ECHO must be set |
|
exit 1 |
|
else if ( "$ECHO" != "echo" ) then |
|
if ( ! -x `echo $ECHO | sed 's/ .*//'` ) then |
|
echo netOglyc: cannot execute \"$ECHO\" as ECHO |
|
exit 1 |
|
endif |
|
endif |
|
|
|
if ( ! $?AWK ) then # mandatory: AWK |
|
$ECHO netOglyc: AWK must be set |
|
exit 1 |
|
else if ( ! -x $AWK ) then |
|
$ECHO netOglyc: cannot execute \"$AWK\" as AWK |
|
exit 1 |
|
endif |
|
|
|
if ( ! $?PASTE ) then # mandatory: PASTE |
|
$ECHO netOglyc: PASTE must be set |
|
exit 1 |
|
else if ( ! -x $PASTE ) then |
|
$ECHO netOglyc: cannot execute \"$PASTE\" as PASTE |
|
exit 1 |
|
endif |
|
|
|
if ( ! -w $TMP ) then |
|
$ECHO netOglyc: cannot write to \"$TMP\" |
|
exit 2 |
|
endif |
|
|
|
# make sure the variables below are not empty |
|
if ( ! $?GNUPLOT ) setenv GNUPLOT _ # optional: GNUPLOT |
|
if ( ! $?PPM2GIF ) setenv PPM2GIF _ # optional: PPM2GIF |
|
if ( ! $?SIGNALP ) setenv SIGNALP _ # optional: SIGNALP |
|
|
|
echo configuration OK ### CHECKPOINT ### |
|
|
|
# other settings ============================================================== |
|
setenv VER 3.1d |
|
setenv VERDATE "April 2004, last revised in September 2005" |
|
|
|
setenv GLYCBIN ${GLYCHOME}/bin # auxiliary scripts |
|
setenv GLYCETC ${GLYCHOME}/etc |
|
setenv GLYCTMP $TMP/netOglyc-$$ # temporary directory |
|
|
|
set d_opt = $cwd # default destination for graphics files |
|
set infile = () # input file to process, if empty: "stdin" |
|
|
|
# command line ================================================================ |
|
while ( $#argv ) |
|
switch ($1) |
|
case '-d': |
|
shift |
|
set d_opt = $1 |
|
breaksw |
|
case '-g': |
|
set g_opt |
|
breaksw |
|
case '-h': |
|
set h_opt |
|
breaksw |
|
case '-sp': |
|
set sp |
|
breaksw |
|
case '-ssa': |
|
set s_opt |
|
breaksw |
|
case '-w': |
|
set w_opt |
|
breaksw |
|
case '-V': |
|
set V_opt |
|
breaksw |
|
default: |
|
set infile = ($infile $1) |
|
breaksw |
|
endsw |
|
shift |
|
end |
|
|
|
# called correctly? =========================================================== |
|
if ( $?h_opt ) then # usage info |
|
$ECHO usage: netOglyc \ |
|
|
|
exit 0 |
|
endif |
|
|
|
if ( $?V_opt ) then # version info |
|
$ECHO netOglyc $VER, $VERDATE |
|
exit 0 |
|
endif |
|
|
|
# attempt to locate input files |
|
foreach f ($infile) |
|
if ( ! -e $f ) then |
|
$ECHO netOglyc: cannot open \"$f\" |
|
exit -1 |
|
endif |
|
end |
|
|
|
# make destination dir absolute |
|
if ( ! `$ECHO $d_opt | grep ^/ | wc -l ` ) then |
|
set d_opt = $cwd/$d_opt |
|
endif |
|
|
|
# make sure destination dir exists |
|
if ( $?g_opt ) then |
|
if ( ! -d $d_opt ) then |
|
$ECHO netOglyc: cannot open \"$d_opt\" |
|
exit -2 |
|
else if ( ! -w $d_opt ) then |
|
$ECHO netOglyc: cannot write to \"$d_opt\" |
|
exit -2 |
|
endif |
|
endif |
|
|
|
#echo command line OK ### CHECKPOINT ### |
|
mkdir $GLYCTMP |
|
|
|
# prepare for WWW ============================================================= |
|
if ( $?w_opt ) then |
|
set GRDIR = /usr/opt/www/pub/CBS/services/NetOGlyc-3.1/tmp/$$ |
|
set GRURL = `echo $GRDIR | sed 's/^.*CBS//'` |
|
mkdir $GRDIR |
|
else |
|
set GRDIR = $d_opt |
|
set GRURL |
|
endif |
|
|
|
if ( ! $?sp ) then |
|
unsetenv SIGNALP |
|
endif |
|
|
|
# prepare for graphics ======================================================== |
|
if ( $?g_opt ) then |
|
if ( ! $?GNUPLOT ) then |
|
$ECHO netOglyc: GNUPLOT executable not specified |
|
unset g_opt |
|
else if ( ! -x $GNUPLOT ) then |
|
$ECHO netOglyc: cannot execute $GNUPLOT |
|
unset g_opt |
|
else |
|
ln -s $GNUPLOT $GLYCTMP/gnuplot |
|
ln -s $GLYCETC/plot_ps.gnu $GLYCTMP/tplot_ps.gnu |
|
endif |
|
if ( ! $?PPM2GIF ) then |
|
$ECHO netOglyc: PPM2GIF executable not specified |
|
else if ( ! -x $PPM2GIF ) then |
|
$ECHO netOglyc: cannot execute $PPM2GIF |
|
else |
|
ln -s $PPM2GIF $GLYCTMP/ppm2gif |
|
ln -s $GLYCETC/plot_gif.gnu $GLYCTMP/tplot_gif.gnu |
|
endif |
|
endif |
|
|
|
# prepare input file ========================================================== |
|
|
|
# FASTA file |
|
$AWK -f $GLYCBIN/seq2seq.awk -v OUTDIR=/dev/stdout -v OUTPUTFORMAT=fasta \ |
|
-v MAXNAMELEN=11 -v P=X $infile \ |
|
>$GLYCTMP/infile.fas |
|
|
|
cd $GLYCTMP |
|
|
|
$AWK '/^>/{print substr($1,2);}' infile.fas >in_names |
|
|
|
# HOW file (for surface prediction) |
|
$AWK -f $GLYCBIN/seq2seq.awk -v OUTDIR=/dev/stdout -v OUTPUTFORMAT=how \ |
|
infile.fas \ |
|
| $AWK '/^ /{print substr($0,2);next;}{print;}' \ |
|
>surf.how |
|
|
|
# run surface prediction ====================================================== |
|
$GLYCBIN/surfg `cat in_names | wc -l` >surfg.out |
|
|
|
# generate HOWLIN file ======================================================== |
|
$AWK -f $GLYCBIN/fasta2howlin -v OUT=$GLYCTMP infile.fas |
|
|
|
# infile.howlin, infile2.howlin and infile.fsa created # |
|
|
|
if ( -z infile.howlin ) then |
|
$ECHO netOglyc: no S or T in the input |
|
cd / |
|
rm -r $GLYCTMP |
|
exit -3 |
|
endif |
|
|
|
grep '^netOglyc: ' infile.howlin >error |
|
if ( ! -z error ) then |
|
cat error |
|
cd / |
|
rm -r $GLYCTMP |
|
exit -4 |
|
endif |
|
|
|
# MAIN ======================================================================== |
|
|
|
# run SignalP |
|
if ( $?SIGNALP ) then |
|
($SIGNALP -t euk -m nn -trunc 60 -short infile.fsa | \ |
|
grep -v '^#' \ |
|
>signalp.out; \ |
|
touch signalp.done &) |
|
else |
|
touch signalp.done signalp.out |
|
endif |
|
|
|
# run HOWLIN networks |
|
$GLYCBIN/runhowlin >&/dev/null |
|
|
|
# infile.out created |
|
|
|
# wait for SignalP to terminate |
|
while ( ! -e signalp.done ) |
|
# echo -n Waiting for SignalP predictions .... \r |
|
sleep 1 |
|
end |
|
|
|
# combine all output |
|
$AWK -f $GLYCBIN/combine -v G=$?g_opt -v SSA=$?s_opt -v SP=$?SIGNALP \ |
|
-v GRDIR=$GRDIR -v GRURL=$GRURL infile.fsa |
|
|
|
# clean up ==================================================================== |
|
cd / |
|
rm -r $GLYCTMP |
|
|
|
# end of script =============================================================== |
This is the important part: "impossible to open file infile.fsa for reading (File or directory not found)". If in doubt, always give the full path to the program, i.e. "/home/schriscar/data/infile.fasta".
The holy trinity of Linux problem solving: Paths, Permissions, Parameters (in that order)
Hi, have you solved this problem? I have the same question.