Bonjour � tous,
J'ai un �trange probl�me avec gawk. Un script awk fonctionne bien sur 
une SuSE 7.0 (gawk 3.0.5), mais pas sur SuSE 6.3 (gawk 3.0.4).

J'obtiens les erreurs suivantes:

user@ordi> signalp -t gram- 
/BioInformatics/soft/bin/signalp-2.0/test/test.seq
gawk: /BioInformatics/soft/bin/signalp-2.0/bin/combine-nn.awk:40:       
C[$1] /= nparts
gawk: 
/BioInformatics/soft/bin/signalp-2.0/bin/combine-nn.awk:40:              
^ parse error
gawk: /BioInformatics/soft/bin/signalp-2.0/bin/combine-nn.awk:42:       
S[$1] /= nparts
gawk: 
/BioInformatics/soft/bin/signalp-2.0/bin/combine-nn.awk:42:              
^ parse error

Est-ce que des diff�rence dramatiques existent entre gawk 3.0.4 et 
3.0.5??? De quel type d'erreur s'agit-il?

Merci d'avance,
Thierry.



--------La partie du combine-nn.awk qui pose probl�me est le suivant:

::::::::::::::
combine-nn.awk
::::::::::::::
#! /usr/bin/nawk -f

BEGIN {
        nparts = 5      # No. of partitions to average over
        nf = 6          # No. of fields in each partition file

        if (format=="short") {
                printf "# SignalP-NN %-50s\n", type " predictions"
                print "# name       Cmax  pos ?  "\
                        "Ymax  pos ?  Smax  pos ?  Smean ?"
        }

}

NR=1 {
        # The values in $TYPE.param have been read from the command line
        # In gawk (a.o.) command line variable assignments has not taken
        # effect in the BEGIN clause
        split(Cscales, Cwt, ",")
}

/^ #/ {
        N++
        len = substr($0,39,6)+0
        name = substr($0,7,20)
        seq = ""
}

/SINGLE/ {
        out=1
        next
}

(out) {
        C[$1] = S[$1] = 0
        for (i=0; i<nparts; i++) {
                C[$1] += $(nf*i+5) * Cwt[i+1]
                S[$1] += $(nf*i+nf*nparts+5)
        }
        C[$1] /= nparts
        if (C[$1]>1) C[$1]=1
        S[$1] /= nparts
        seq = seq $2
}

out && $1 == len {
        out=0
        datafile = datafileprefix "." N
        if (format != "short") {
                printf ">%s  length = %d\n", name, len
                printf ">%s  length = %d\n\n", name, len > datafile
                print "# pos  aa    C       S       Y" > datafile
        }
        Cmax = Smax = Ymax = 0
        Cmaxpos = Smaxpos = Ymaxpos = 1
        for (i=1-drange; i<=0; i++)
                S[i]=S[1]
        for (i=len+1; i<=len+drange; i++)
                S[i]=S[len]
        for (i=1; i<=len; i++) {
                diff = 0
                for (j= i-drange; j<i; j++)
                        diff += S[j]
                for (j= i; j< i+drange; j++)
                        diff -= S[j]
                diff /= drange
                Y = (diff>0) ? sqrt(C[i]*diff) : 0
                if (Y>Ymax) { Ymax=Y; Ymaxpos=i }
                if (S[i]>Smax) { Smax=S[i]; Smaxpos=i }
                if (C[i]>Cmax) { Cmax=C[i]; Cmaxpos=i }
                if (format != "short") {
                        printf "%5d   %1s   %5.3f   %5.3f   %5.3f\n",
                                i, substr(seq,i,1), C[i], S[i], Y > datafile
                }
        }
        close (datafile)
        Smean = 0
        for (i=start; i<=Ymaxpos-1; i++)
                Smean += S[i]
        if (Ymaxpos>1)
                Smean /= (Ymaxpos - 1)
        else
                Smean = 0

        if (format=="short") {
                printf "%-10s  ", name
                printf "%5.3f %3d %1s  ",
                        Cmax, Cmaxpos, (Cmax>Cmaxcut) ? "Y" : "N"
                printf "%5.3f %3d %1s  ",
                        Ymax, Ymaxpos, (Ymax>Ymaxcut) ? "Y" : "N"
                printf "%5.3f %3d %1s  ",
                        Smax, Smaxpos, (Smax>Smaxcut) ? "Y" : "N"
                printf "%5.3f %1s\n",
                        Smean, (Smean>Smeancut) ? "Y" : "N"
                next
        }
        printf "# Measure  Position  Value  Cutoff  signal peptide?\n"
        printf "  max. C   %3d       %5.3f  %5.2f   %s\n",
                Cmaxpos, Cmax, Cmaxcut, (Cmax>Cmaxcut) ? "YES" : "NO"
        printf "  max. Y   %3d       %5.3f  %5.2f   %s\n",
                Ymaxpos, Ymax, Ymaxcut, (Ymax>Ymaxcut) ? "YES" : "NO"
        printf "  max. S   %3d       %5.3f  %5.2f   %s\n",
                Smaxpos, Smax, Smaxcut, (Smax>Smaxcut) ? "YES" : "NO"
        printf "  mean S     1-%-4d  %5.3f  %5.2f   %s\n",
                Ymaxpos-1, Smean, Smeancut, (Smean>Smeancut) ? "YES" : "NO"
        if (Smax>Smaxcut || Ymax>Ymaxcut || Smean>Smeancut) {
        printf "# Most likely cleavage site between pos. %d and %d: %s\n",
                Ymaxpos-1, Ymaxpos,
                substr(seq,Ymaxpos-3,3) "-" substr(seq,Ymaxpos,2)
        }
        print ""
}

--
http://www-internal.alphanet.ch/linux-leman/ avant de poser
une question. Ouais, pour se d�sabonner aussi.

Répondre à