OUTPUT BUFFER:
#!/home/moumou/TclTk-8.5/bin/wish8.5 ###!/usr/local/bin/wish set LignesCoul "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 " ######### # Cinfigure tags for 20 amino acids plus physicochemical groups proc ConfTag {} { global wt global LignesCoul set conftag [split $LignesCoul "\n"] foreach c $conftag { foreach {n f b} $c {} $wt tag configure Tag$n -foreground $f -background $b } return } ########## # Data generation proc JunkData {nb lg} { global data set rep [expr ($lg/34)+1] puts "length seq : [expr $rep*34]" puts "Nb of seqs : $nb" set l "ACDEF...GHI..KLMNP....QRS.....TVWY" set dt "[string repeat $l $rep]\n" set data "[string repeat $dt $nb]" return } proc TagAll { global wt set text [$w get 1.0 end] set Ltxt [split $text "\n"] set Lgaa [list STAC DE ILMV FYW P RK Q G HN] puts "[time { set i 0 foreach s $Ltxt { incr i foreach g $Lgaa { set lt($g) {} set freg [join [split $g ""] "|"] set lv [regexp -all -inline -indices -- $freg $s] foreach e $lv { foreach {d f} $e {} incr f lappend lt($g) $i.$d $i.$f } if {[set lt($g)] != {} } {eval $w tag add Tag$g [set lt($g)]} } } update idletasks } 1]" return } # trash window test ... no grid , nothing ... proc InitWindow2 {} { global data global wt wx wy set WdHt 50 set WdWd 120 set wt .f3.t set wx .f3.sx set wy .f3.sy frame .f3 text .f3.t -font "Courier 10 bold" -wrap none \ -yscrollcommand [list $wy set] \ -xscrollcommand [list $wx set] \ -height $WdHt -width $WdWd 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 $wt insert end $data $wt configure -foreground white -background "#303030303030" return } ################################ if {$argc != 0} { set Ns [lindex $argv 0] set Ls [lindex $argv 1] } else { set Ns 200 set Ls 2000 } JunkData $Ns $Ls InitWindow2 ConfTag update idletasks TagAll ########### la fin des haricots ##############