OUTPUT BUFFER:
#!/home/moumou/tcl8.6b1/lubin/bin/wish8.6 ##!/usr/local/bin/wish set LignesCoul ">seqlab I white magenta L white magenta M white magenta V white magenta ILMV white magenta R white blue K white blue RK white blue F white red Y white red W white red FYW white red D white forestgreen E white forestgreen DE white forestgreen Q white green P white black G black orange H black cyan N black cyan HN white cyan S white darkviolet T white darkviolet A white darkviolet C white darkviolet STAC white darkviolet SPC white darkslategrey " ######### # Tools 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"] } ################################### # Configure tags for 20 amino acids # + physicochemical groups # almost taken from ordali proc ConfTag {} { global LignesCoul global wt global Lgaa Lfreg foreach c [lrange [split $LignesCoul "\n"] 1 end] { foreach {n f b} $c {} # $wt tag configure Tag$n -foreground $f -background $b $wt tag configure Tag$n -foreground $b } set Lgaa [list STAC DE ILMV FYW P RK Q G HN] foreach g $Lgaa { set freg [join [split $g ""] "|"] lappend Lfreg $freg } return } ################# # Data generation # # Junk data or read a TFA file given as argument proc JunkData {} { global data Long Haut # set l "ACDEF...GH..KLNP....QCS.." set l "A.C.P.Q.G.I.K.D.N.F." set rep [expr {int($Long/25)+1}] set dt "[string repeat $l $rep]\n" set data "[string repeat $dt $Haut]" set Long [string length $dt] return $data } proc LitLeTFA {file aNom aSeq} { upvar $aNom Nom upvar $aSeq Seq global Long Haut set Lignes [LesLignesDuFichier $file] lappend Lignes ">" set n 0 set laseq "" foreach l $Lignes { set l [string trim $l] if {$l eq ""} {continue} if {[string index $l 0] eq ">"} { if {$laseq ne ""} { regsub -all " " $laseq "" laseq regsub -all {\-} $laseq "." laseq regsub -all {\n} $laseq "" laseq lappend Nom $lenom set Seq($lenom) $laseq set laseq "" incr n } set l [string trim [string range $l 1 end]] set ib [string first " " $l] if {$ib == -1} { set ib end } else { incr ib -1 } set lenom [file rootname [string range $l 0 $ib]] } else { append laseq $l } } set Haut $n set Long [string length [set Seq([lindex $Nom 0])]] return $n } # tfa file proc TfaData {{f ""}} { global data LitLeTFA $f Nom Seq set data "" foreach n $Nom { append data "[set Seq($n)]\n" } return $data } ############################## # Window and attached commands # # trash window test ... no grid , nothing ... proc InitWindow {} { global data global wt wx wy global Long Haut set wt .f3.t set wx .f3.sx set wy .f3.sy frame .f3 text .f3.t -font "Courier 12" \ -wrap none \ -yscrollcommand "$wy set" \ -xscrollcommand "$wx set" \ -height 30 -width 60 scrollbar .f3.sy -command "$wt yview" scrollbar .f3.sx -command "$wt xview" -orient horizontal pack .f3.sy -side right -fill y -expand 1 pack .f3.sx -side bottom -fill x pack .f3.t -expand 1 -fill both pack .f3 -side top update $wt configure -foreground white -background "#303030303030" $wt insert end $data $wt see "100.500" # bindtags $wt $wt bind $wt <4> "$wt yview scroll -2 units" bind $wt <5> "$wt yview scroll 2 units" update idletasks return } proc TagAll {} { global data set newd [string map [list A {@TagA }] return } proc TagAll {} { global wt Lgaa Lfreg data set i 0 foreach s [split $data "\n"] { incr i set ls [split $s ""] foreach freg $Lfreg g $Lgaa { set lv [lsearch -all -regexp $ls $freg] if {$lv != {}} { set lt {} foreach e $lv { lappend lt $i.$e $i.[expr {$e+1}] } $wt tag add Tag$g {*}$lt } } } update idletasks return } ################################# set Long 2000 set Haut 300 foreach v $argv { switch [string index $v 0] { "f" { set data [JunkData] } "h" { set Haut [string range $v 2 end] } "w" { set Long [string range $v 2 end] } default { puts "usage : h=