OUTPUT BUFFER:
#!/usr/local/bin/tclsh #package require profile ### Name ......: filter ### Version ...: 1.3.9 ### Date ......: 07-Mars-2005 ### Purpose ...: create a multiple tfa sequence file from a bloast # with/without a ballast file, extracting only sequences with expect # < SeuilExpect, and no more than MaxListe sequences. # Launch 'fastacmd' to retrieve seq from blast Db # # correction 14-03-05 # prend toujours la query quand applique filtre # # correction 30-03-05 # remet la query dans le fichier final a donner a clustal # # correction 22-04-05 # si ballast file pas la, continue ! # # correction 27-04-05 # corrige filtre mounir , division par 0 si 1 sequence (n-1) # # correction 4-05-05 # ajout mot cle maxlength pour couper seq long > n # ajout mot cle addseq pour ajouter ou pas seq remontee par ballast # # correction 8-05-05 # ajout mot cle fragment pour verif des fragments ou non # enleve prefix bank # # correction 23-05-05 # ajoute filtres FDD et bandelettes # # correction 07-12-05 # ajoute filtres Euca et Meta # # correction 19-06-06 # dans decortique blast, enleve les quotes, et parenthese dans les DE proc ContenuDuFichier {{Fichier ""}} { if { $Fichier == "" } {return ""} set f [open $Fichier r] set Texte [read -nonewline $f] close $f return $Texte } proc LesLignesDuFichier {{Fichier ""}} { return [split [ContenuDuFichier $Fichier] "\n"] } proc ExtraitListeDeListe {l n} { set nl {} foreach e $l { lappend nl [lindex $e $n] } return $nl } proc lunique l { set res {} foreach e $l { if {[info exists t($e)]} {continue} set t($e) 1 lappend res $e } return $res } proc EstUnAccessSwissprot Access { if {[regexp -nocase "^SW\:" $Access]} { return 1 } else { return 0} } proc EstUnAccessPDB Access { if {[regexp -nocase "^PDB\:" $Access]} {set Access [string range $Access 4 end]} if {! [regexp -nocase {^[0-9]+[a-z]+[0-9a-z_]*$} $Access] } { return 0 } if {[regexp -nocase {_[0-9a-z]{3,}} $Access] } { return 0 } return 1 } proc StringSuivant {Champ dans Texte} { set i [string first $Champ $Texte] if {$i==-1} { return "" } incr i [string length $Champ] return [string range $Texte $i end] } proc DecortiqueBlast {TexteOuListeOuFichier CutPN MaxListe aQuery {alBanqueId ""} {alAccess ""} {alDE ""} {alProfil ""} {alPN ""} {alPartieSegAli ""}} { global PourBallast if {$aQuery !=""} { upvar $aQuery Query } if {$alBanqueId !=""} { upvar $alBanqueId lBanqueId } if {$alAccess !=""} { upvar $alAccess lAccess } if {$alDE !=""} { upvar $alDE lDE } if {$alProfil !=""} { upvar $alProfil lProfil } if {$alPN !=""} { upvar $alPN lPN } if {$alPartieSegAli != ""} { if { ! [string equal $alPartieSegAli "LongDefinition"]} { upvar $alPartieSegAli lPartieSegAli } set OnVeutPartieSegAli 1 set lPartieSegAli {} } else { set lPartieSegAli {} set OnVeutPartieSegAli 0 } set RetourneBlastTrie 0 set Fichier "" if {[regexp "\n" $TexteOuListeOuFichier]} { set ListeDesLignes [split $TexteOuListeOuFichier "\n"] } elseif {[regexp " " $TexteOuListeOuFichier]} { set ListeDesLignes $TexteOuListeOuFichier } elseif {[file exists $TexteOuListeOuFichier]} { set Fichier $TexteOuListeOuFichier set ListeDesLignes [LesLignesDuFichier $TexteOuListeOuFichier] } else { return "" } if {$CutPN == "" } { set CutPN 0.001 } if {$MaxListe == "" } { set MaxListe "SansLimiteDeNombre" } if {$CutPN == "SansSeuilExpect"} { set CutPN 9999.9 } set RenvoieLesHitsAvecSegAliUniquement 1 if {$MaxListe == "SansLimiteDeNombreDuTout"} { set MaxListe "SansLimiteDeNombre" set RenvoieLesHitsAvecSegAliUniquement 0 } if {$MaxListe == "SansLimiteDeNombre"} { set MaxListe 9999 } set lBanqueId {} set lAccess {} set lDE {} set lProfil {} set lPN {} set NombreDeBons 0 set PremierMot "" scan [join [lrange $ListeDesLignes 0 3] " "] "%s" PremierMot set RechercheDansFichier 1 while {1} { set PourBlastP [expr ![string compare $PremierMot "BLASTP"]] set PourBlastX [expr ![string compare $PremierMot "BLASTX"]] set PourBallast [expr ![string compare $PremierMot "BALLAST"]] set PourTBlastX [expr ![string compare $PremierMot "TBLASTX"]] set PourBlastN [expr ![string compare $PremierMot "BLASTN"]] set PourTBlastN [expr ![string compare $PremierMot "TBLASTN"]] if {[expr $PourBlastP+$PourBlastX+$PourBallast+$PourTBlastX+$PourBlastN+$PourTBlastN] == 1} { break } if {$RechercheDansFichier && \ [regexp "BLASTP|BLASTX|Ballast|TBLASTX|BLASTN|TBLASTN" \ [join [lrange $ListeDesLignes 0 9] " "] PremierMot]} { set RechercheDansFichier 0 continue } return "" } if {$PourBallast} { set TexteSPSA "Sequences producing High-scoring Segment Pairs" set iProfil 62 set FinDE 65 } elseif {$PourTBlastX} { set TexteSPSA "Sequences producing High-scoring Segment Pairs" set FinDE 59 set iProfil 61 } else { set TexteSPSA "Sequences producing significant alignments" set FinDE 65 set iProfil 66 } set IndexQuery [lsearch -regexp $ListeDesLignes "Query="] if { $IndexQuery == -1 } { return "" } if {$aQuery=="BlastHitCount"} { set Query "NotImportantForBlastHitCount" set Nomquery "NotImportantForBlastHitCount" } else { set PossiblePAB [file tail $Fichier] # set Query [QueryDeLaLigne [lindex $ListeDesLignes $IndexQuery] "DoNotCreateIt" $PossiblePAB] # set NomQuery [file tail $Query] } if {[lsearch -regexp [lrange $ListeDesLignes 0 30] "No hits found"] != -1} { return 0 } set IndexSPSA [lsearch -regexp $ListeDesLignes $TexteSPSA] if { $IndexSPSA == -1 } { return 0} set Gapped [string equal [string index [lindex $ListeDesLignes $IndexSPSA] end] "N"] set Saut 2 if {[regexp -nocase {[a-z]} [lindex $ListeDesLignes [expr $IndexSPSA + 1]]]} { incr Saut } set PartieRestante [lrange $ListeDesLignes [incr IndexSPSA $Saut] end] set PartieEntete [lrange $ListeDesLignes 0 $IndexSPSA] set IndexPremierChevron [lsearch -regexp $PartieRestante {^>}] if { $IndexPremierChevron == -1 } { set PartieScores [lrange $PartieRestante 0 end] set PartieSegAli {} } else { set PartieScores [lrange $PartieRestante 0 [expr $IndexPremierChevron-1]] set PartieSegAli [lrange $PartieRestante $IndexPremierChevron end] } if {$Gapped} {set ICol 1} else {set ICol 0} set OldPN -99999 set zPN 0 set IlFautTrier 0 set EstUnPsiBlast 0 set Profil 0 set FautVider [expr ! $PourBallast] set LuPremier 0 foreach Ligne $PartieScores { if { $Ligne == "" } { continue } if { [regexp "Sequences not found previously" $Ligne] } { set EstUnPsiBlast 1 continue } regsub "!" $Ligne " " Ligne if { $PourBallast && [regexp {\-{50}} $Ligne]} { continue } if {! [regexp {[a-zA-Z]} $Ligne]} {continue} if { [regexp {\\\\End} $Ligne]} { break } if {! $PourBallast} {set FautVider 1} if { [regexp {^[0-9a-zA-Z]} $Ligne]} { if {$LuPremier} { lappend lBanqueId $oldBanqueId lappend lAccess $oldAccess lappend lProfil $oldProfil lappend lPN $oldPN lappend lScore $oldScore regsub -all "\"" $oldDE " " oldDE regsub -all {\(} $oldDE " " oldDE regsub -all {\)} $oldDE " " oldDE set oldDE [join $oldDE " "] lappend lDE $oldDE incr NombreDeBons } set LuPremier 1 set Access "" if {! [scan $Ligne "%s %s" BanqueId Access]} {break} set AccessLu $Access if {[regexp -nocase {^UniRef} $BanqueId]} { set Access $BanqueId } if {[regexp -nocase {[\(\)\{\}\[\]]} $Access]} { set Access $BanqueId } if {! [EstUnAccessPDB $Access] && \ ([EstUnAccessPDB $BanqueId] || ! [regexp -nocase {[a-z_]} $Access])} { set Access $BanqueId } set Profil [string equal [string range $Ligne $iProfil $iProfil] "*"] set ScorePN [string trim $Ligne] while {[regsub -all " " $ScorePN " " tmp]} {set ScorePN $tmp} set LesMots [split $ScorePN " "] set LesMots [lrange $LesMots 0 end-$ICol] set sScore [lindex $LesMots end-1] scan $sScore "%d" Score set sPN [lindex $LesMots end] if {$sScore=="" || $sPN==""} { break } set DE $Ligne set DE [StringSuivant "$BanqueId" dans $DE] if {! [EstUnAccessPDB $BanqueId] && ! [regexp -nocase {[^a-z0-9_]} $AccessLu] } { set DE [StringSuivant "$AccessLu" dans $DE] } regsub "$sPN *$" $DE "" DE regsub "$sScore *$" $DE "" DE regsub -all {"} $DE "" DE set DE [string trim $DE] #" set oldDE $DE set oldAccess $Access set oldBanqueId $BanqueId set oldProfil $Profil set oldScore $Score regsub {^[eE]} $sPN "1e" sPN set PN $sPN set oldPN $PN } else { if { ! $PourBallast} {continue} set Ligne [string trim $Ligne] if {! [scan $Ligne "%s %s" BanqueId Access]} {continue} lappend oldDE [string range $Ligne [string length "$BanqueId $Access "] end] continue } if {[catch { expr $PN > $CutPN } ]} {set PN 1E-200} if {! $PourBallast && [expr $PN > $CutPN] } {break} if {$NombreDeBons >= $MaxListe } { break } } lappend lBanqueId $oldBanqueId lappend lAccess $oldAccess lappend lProfil $oldProfil lappend lPN $oldPN lappend lScore $oldScore set oldDE [join $oldDE " "] lappend lDE $oldDE incr NombreDeBons set LIndexChevron [lsearch -regexp -all $PartieSegAli {^>}] set toto [lsearch -regexp -all $PartieSegAli {^>}] set n 0 set nDE {} set npris [llength $lDE] set iend [expr $npris - 1] set LIndexChevron [lrange $LIndexChevron 0 $iend] foreach i $LIndexChevron des $lDE { if {$n == [expr $npris - 1]} { set j "end" } else { set j [expr [lindex $LIndexChevron [expr $n + 1]] - 1] } set PartieSegAliRestante [lrange $PartieSegAli $i $j] set LeMeilleurDE {} foreach LigneDuSegAli $PartieSegAliRestante { if {! [regexp -nocase {[0-9a-z]} $LigneDuSegAli]} {break} set MeilleurDE [string trim $LigneDuSegAli] regsub {^>[^ ]+ } $MeilleurDE "" MeilleurDE lappend LeMeilleurDE $MeilleurDE } set newDE [join $LeMeilleurDE " "] while {[regsub -all " " $newDE " " tmp]} {set newDE $tmp} lappend nDE $newDE incr n } set lDE $nDE return } proc QueryDeLaLigne {LigneQuery {CreateIt ""} {PossiblePAB ""}} { global CreateQueryDeLaLigne if {$CreateIt=="CreateIt"} { set CreateIt 1 } elseif {$CreateIt=="DoNotCreateIt"} { set CreateIt 0 } else { if {[info exists CreateQueryDeLaLigne]} { set CreateIt $CreateQueryDeLaLigne } else { set CreateIt 1 } } set IndexBlanc [string first " " $LigneQuery] set LigneQuery [string trim [string range $LigneQuery $IndexBlanc end]] if { [regexp -indices {[, :\|]} $LigneQuery IndexesFin] } { set IndexFin [expr [lindex $IndexesFin 0]-1] } else { set IndexFin "end" } set Query [string trim [string range $LigneQuery 0 $IndexFin]] foreach TryQuery [list \ "$Query" \ "$RepertoireDuGenome/../casimir/prottfa/[file tail $Query]" \ "[RepertoireDeTravail]/[file tail $Query]" \ "$RepertoireDuGenome/nuctfa/[file tail $Query]" \ "$RepertoireDuGenome/prottfa/[file tail $Query]"] { if { [file exists $TryQuery] } { return $TryQuery } } if {$PossiblePAB!="" && [Alias $PossiblePAB]==$Query} { set Query $PossiblePAB } if { ! $CreateIt} { return $Query } set SequenceQuery [SequenceDesBanquesVite $Query] if {$SequenceQuery!=""} { set TmpQuery [Sauve $SequenceQuery dans "[RepertoireDeTravail]/[file tail $Query]"] return $TmpQuery } return $Query } proc EstTropLong {d maxl} { global NbLg set i [expr [string first "Length = " $d] + 9] set pl1 [string range $d $i end] set ib [string first " " $pl1] if {$ib == -1} {set ib "end"} set l [string trim [string range $pl1 0 $ib]] if {$l > $maxl || [regexp {[^0-9]} $l] || $l == ""} { incr NbLg return 1 } else { return 0 } } proc EstUnFragment d { global NbFrg if {[regexp -nocase "fragment" $d]} { incr NbFrg return 1 } else { return 0 } } proc TriNature {e m la lp} { # m est MaxHitListe set lbon [lrange $la 0 $m] return $lbon } proc Derivee {l {s 2}} { # Attention !! Fct renvoie n-1 valeurs !! if {$s != 2 && $s != 3} {set s 3} if {$s == 2} { foreach v [lrange $l 0 end-1] w [lrange $l 1 end] { set e [expr $w-$v] lappend d $e } } else { foreach v [lrange $l 0 end-2] w [lrange $l 2 end] { set e [expr $w-$v] lappend d $e } } return $d } proc TriStrips {SeuilExpect MaxListe lAccess lBanqueId lPN lDE} { set MaxNbElus $MaxListe set NombreMiniDeProches 1 set LesLBsEtLeursCandidats [LesBandelettesDuBlast $lAccess $lBanqueId $lPN $lDE] set LesElus {} set TousLesProches {} set NbElus 0 foreach {LB SesCandidats} $LesLBsEtLeursCandidats { catch {unset PremierSW} catch {unset PremierTout} catch {unset PremierPDB} foreach Candidat $SesCandidats { scan $Candidat "%s %s %s %s %s %s" LogPN BId Access PN DE OX if {[EstUnAccessPDB $BId]} { if {! [info exists PremierPDB]} {set PremierPDB $BId } continue } if {[EstUnAccessSwissprot $BId]} { if {! [info exists PremierSW]} { set PremierSW $BId } } if {! [info exists PremierTout]} { set PremierTout $BId } } set Capital "" if { [info exists PremierSW]} { set Capital $PremierSW } elseif { [info exists PremierTout]} { set Capital $PremierTout } elseif { [info exists PremierPDB]} { set Capital $PremierPDB } set NProchesPrisPourCetteBandelette 0 foreach Candidat $SesCandidats { set OX "" scan $Candidat "%s %s %s %s %s %s" LogPN BId Access PN DE OX lappend LesProches "$BId $Access $PN $OX" set BonAPrendre [expr [EstUnAccessPDB $BId] || \ $PN<=0.001 && [string equal $BId $Capital]] if {$BonAPrendre} { lappend LesElus "$BId $Access $PN $OX" set NbElus [llength $LesElus] if {$NbElus > $MaxNbElus} { break } } if {$PN<=0.001} { lappend TousLesProches "$BId $Access $PN $OX" } else { if { ! [info exists DejaBascule] && [llength $LesElus]<$NombreMiniDeProches} { set DejaBascule 1 lappend TousLesProches "$BId $Access $PN $OX" set LesElus $TousLesProches } } } if {$NbElus > $MaxNbElus} { break } } set res [ExtraitListeDeListe $LesElus 0] return $res } proc LesBandelettesDuBlast {lAccess lBanqueId lPN lDE} { set NombreDeBandelettes 100 set LesCandidats {} foreach CandId $lBanqueId CandAc $lAccess PN $lPN DE $lDE { regsub -all " " $DE "_" BeauDE set Candidat "$CandId $CandAc $PN $BeauDE" lappend LesCandidats $Candidat } if {$LesCandidats=={}} { return "" } set LesPNs {} set LesLogPNs {} foreach Candidat $LesCandidats { set DE "" set OX "" scan $Candidat "%s %s %s %s %s" CandId CandAc PN DE OX set BonPN $PN if {$PN< 1.e-200} { set BonPN 1.e-200 } set LogPN [expr log10($BonPN)] lappend LesPNs $PN lappend LesLogPNs $LogPN } if {$LesPNs=={}} {return {}} if {[llength $LesPNs]==1} {return [list [lindex $LesPNs 0] $LesCandidats]} set Prems [lindex $LesLogPNs 0] set Derns [lindex $LesLogPNs end] set Ecart [expr (1.*($Derns-$Prems))/$NombreDeBandelettes] set L $Prems while {$L<$Derns} { lappend LesLimites $L set L [expr $L + $Ecart] } lappend LesLimites 999999 set LesLimitesHautes [lrange $LesLimites 1 end] set LB [lindex $LesLimites 0] set LH [lindex $LesLimitesHautes 0] set Compte -4 set i 0 foreach LogPN $LesLogPNs Candidat $LesCandidats { incr Compte while 1 { if {$LB<=$LogPN && $LogPN<$LH} { break } if {[incr i] >= [llength $LesLimites]} { break } set LB [lindex $LesLimites $i] set LH [lindex $LesLimitesHautes $i] } if { ! [info exists LesCandidatsPour($LB)]} { lappend LesLBs $LB lappend LesChoixX $LogPN $LogPN $LogPN lappend LesChoixY $Compte [expr $Compte +1] [expr $Compte +2] } lappend LesCandidatsPour($LB) "$LogPN $Candidat" } foreach LB $LesLBs { if { ! [info exists LesCandidatsPour($LB)]} { continue } set SesCandidats {} foreach Candidat [set LesCandidatsPour($LB)] { lappend SesCandidats $Candidat } lappend LesLBsEtLeursCandidats $LB $SesCandidats } return $LesLBsEtLeursCandidats } proc TriFDD {exp mxs la lp} { set lBanqueId $la set lPN $lp set LDPN {} set LD2PN {} set LD3PN {} if {[llength $lPN] < 5} { set LesElus $lBanqueId return $LesElus } # Transformation E-values foreach e $lPN { if {$e == 0.0} {set e "1.0e-300"} set e [expr log($e)] lappend llogPN $e } set Eder [lindex $lPN end] # Calcul des derivee premiere, seconde et tierce set LDPN [Derivee $llogPN] # set LDPN [LisseCourbe $LDPN] set LDPN [linsert $LDPN 0 -300.] set LD2PN [Derivee $LDPN] set LD2PN [linsert $LD2PN 0 300.] # set LD2PN [linsert $LD2PN end 300.] set LD3PN [Derivee $LD2PN] set LD3PN [linsert $LD3PN 0 300.] # set LD3PN [linsert $LD3PN end 300. 300.] # fait tri # Met toujours le Premier lappend LesElus [lindex $lBanqueId 0] set nelus 0 set i 0 set LDt [lrange $LD3PN 0 end] set LBt [lrange $lBanqueId 0 end] foreach e $LDt { if {$i == 0 || $i == 1} { incr i continue } set icou [expr $i-1] set Flag 0 if {$e < 0.0} { set prev [lindex $LDt ${icou}] if {$prev > 0.0} { lappend LesElus [lindex $LBt $icou] lappend Lid $icou set Flag 1 incr nelus } } if {$nelus >= $mxs} {break} incr i } foreach i $LesElus { if {$i == ""} {continue} lappend res $i } set LesElus $res return $LesElus } proc TriMounir {e m la lp} { if {[llength $la] < 2} {return $la} set i 0 set n 0 set palier 0. foreach p $lp { set pal($i) $p if {$p == "1e-200"} {set pal($i) 0.} set j [expr $i - 1] if {$i > 0 && [expr [set pal($i)] * [set pal($j)] ]} { set palier [expr $palier + log([set pal($i)]) - log([set pal($j)]) ] } incr i incr n } set palier [expr $palier / ($n - 1)] # prends toujours le premier set i 0 set nok 0 set liste {} while {($i < $n) && ($nok < $m)} { if {$i == 0} { lappend liste [lindex $la 0] set exprev [set pal(0)] incr nok } else { if {[set pal($i)] != 0.} { if {$exprev == 0.} { lappend liste [lindex $la $i] set exprev [set pal($i)] set difference 0. incr nok } else { set difference [expr log([set pal($i)])-log($exprev)] } # Si la difference est sup. au palier on prend la sequence if {$difference > $palier} { lappend liste [lindex $la $i] set exprev [set pal($i)] incr nok } } } incr i } return $liste } proc TriEuca {SeuilExpect MaxListe nBId lPN} { # on recupere la liste des euca set lesLignes [LesLignesDuFichier "listeOrgEuca"] # initialisation des Elus set LesElus "" set i 0 # tant qu'on est dans la gamme des expect ok while { $i < [llength $lPN] && [llength $LesElus] < $MaxListe } { # si c'est un PDB, on le prend if {[EstUnAccessPDB [lindex $nBId $i]]} { lappend LesElus [lindex $nBId $i] incr i continue } # sinon, on verifie la presence de l'organisme concerne dans la liste if {[lsearch $lesLignes [string range [lindex $nBId $i] [expr [string first "_" [lindex $nBId $i]] + 1] end]] != -1} { lappend LesElus [lindex $nBId $i] } incr i } puts "il y a donc [llength $LesElus] elus" return $LesElus } proc TriMeta {SeuilExpect MaxListe nBId lPN} { # on recupere la liste des euca set lesLignes [LesLignesDuFichier "listeOrgMeta"] # initialisation des Elus set LesElus "" set i 0 # tant qu'on est dans la gamme des expect ok while { $i < [llength $lPN] && [llength $LesElus] < $MaxListe } { # si c'est un PDB, on le prend if {[EstUnAccessPDB [lindex $nBId $i]]} { lappend LesElus [lindex $nBId $i] incr i continue } # sinon, on verifie la presence de l'organisme concerne dans la liste if {[lsearch $lesLignes [string range [lindex $nBId $i] [expr [string first "_" [lindex $nBId $i]] + 1] end]] != -1} { lappend LesElus [lindex $nBId $i] } incr i } puts "il y a donc [llength $LesElus] elus" return $LesElus } proc RajoutBallast {bfile liste e m maxl} { if {! [file exists $bfile]} {return $liste} set LBlast [LesLignesDuFichier $bfile] DecortiqueBlast $LBlast 9999. 5000 Query lBanqueId lAccess lDE lProfil lPN "LongDescription" set nelt [llength $liste] set nmax [expr $nelt / 2] if {[expr $nelt + $nmax] > $m} { set nrajout [expr $m - $nelt] } else { set nrajout $nmax } set npris 0 foreach p $lPN a $lBanqueId des $lDE { if {$npris >= $nrajout} {break} if {$p < $e} {continue} if {[EstTropLong $des $maxl]} {continue} if {[EstUnFragment $des]} {continue} lappend liste $a incr npris } return $liste } proc ValArg {e} { set e [string trim $e] set i [expr [string first "=" $e] + 1] set rep [string trim [string range $e $i end]] if {$rep == "true" || $rep == "T" || $rep == "1"} {set rep 1} if {$rep == "false" || $rep == "F" || $rep == "0"} {set rep 0} return $rep } proc EnlevePrefixeBank l { regsub {^>lcl\|} $l ">" l if {[regexp {>SPT\|} $l]} {set l [string range $l 5 end]} if {[regexp {>SW\|} $l]} {set l [string range $l 4 end]} if {[regexp {>PDB\|} $l]} {set l [string range $l 5 end]} if {[regexp ">SPT:" $l]} {set l [string range $l 5 end]} if {[regexp ">SW:" $l]} {set l [string range $l 4 end]} if {[regexp ">PDB:" $l]} {set l [string range $l 5 end]} if {[regexp ">SPT_" $l]==1} {set l [string range $l 5 end]} if {[regexp ">SW_" $l]==1} {set l [string range $l 4 end]} if {[regexp ">PDB_" $l]==1} {set l [string range $l 5 end]} regsub {^>} $l "" l return $l } proc FaitLesTris liste { global NbLg global NbFrg set args [string trim $liste] regsub -all " " $args " " args set args [split $args " "] if {[llength $args] < 2} { puts "\nUsage : filter" puts "\t-input=