Commit 230e1b7d authored by luc.moulinier's avatar luc.moulinier

biotext ... ok ? refait ordali_selection : CutLesNoms, CopyLesNoms, et PasteLesNoms

parent f9526c8c
......@@ -128,7 +128,7 @@ A white darkviolet
U white darkviolet
C white darkviolet
X black dimgrey
. black grey
. white black
0 black white
1 black white
2 black white
......@@ -158,18 +158,20 @@ grid rowconfig . 0 -weight 1
text .f.t \
-width 10 \
-height 10 \
-height 20 \
-font SeqFont \
-bd 0 \
-highlightthickness 0 \
-pady 0 \
-foreground white \
-background black \
-relief flat \
-setgrid 1 \
-wrap none \
-yscrollcommand ".f.sv set "
biotext .f.b \
-width 23 \
-height 10 \
-width 60 \
-height 20 \
-font SeqFont \
-bd 0 \
-relief flat \
......@@ -213,10 +215,12 @@ foreach n $Ltmp {
puts "[llength $Lnom] seqs [string length [lindex $Lseq 0]] aminoacids"
.f.b configure -state normal
.f.b sequences $Lseq
.f.b mapping $Lmap
.f.b map on
.f.b configure -state normal
#focus .f.b
.f.t configure -state normal
.f.t insert end "[join $Lnom \n]"
......@@ -250,7 +254,6 @@ foreach cf {pady spacing1} {
puts "$cf [.f.t cget -$cf]"
}
.f.b configure -state normal
puts "\nTags toto :"
.f.b tag configure toto -foreground yellow -background black
.f.b tag add toto 1.2 1.12
......
......@@ -7543,13 +7543,6 @@ proc ChangeNomsAff {{quoi "seqname"}} {
set LNoms $::LNOrdali
}
if {0 && [TypeAli] ni {XML ORD}} {
puts "PAS BON !"
set ::NomsAffiches $LNoms
return
}
switch $quoi {
"seqname" {set t TDesSeqnames}
"access" {set t TDesAccess}
......@@ -7585,7 +7578,6 @@ proc ChangeNomsAff {{quoi "seqname"}} {
}
}
#set NomsAffiches $LNoms
set NomsAffiches $Ltmp
set Defauts(NomsAffiches) $quoi
......@@ -8372,6 +8364,8 @@ proc AfficheFrameSequences {} {
-autoseparators 0 \
-undo 0 \
-highlightthickness 0 \
-background white \
-foreground black \
-setgrid 1 \
-pady 0
......@@ -8479,13 +8473,13 @@ proc AfficheFrameSequences {} {
grid $w.lessequences.textnomseq \
-row 0 -column 0 \
-sticky ns
grid $w.lessequences.scrolly \
-row 0 -column 3 \
-sticky ns
grid $w.lessequences.textsequence \
-row 0 -column 1 \
-columnspan 2 \
-sticky news
grid $w.lessequences.scrolly \
-row 0 -column 3 \
-sticky ns
grid $w.lessequences.srcnom \
-row 1 -column 0 \
-sticky ew -padx 5
......@@ -9771,80 +9765,6 @@ proc vq {} {
}
proc tau {} {
package require http
if {0} {
set id "A1A4P2,A5WUL9,A6NMD0,A6NNB3,B3TJI7,C9JQL5,D2I618,D3ZMZ8,D3ZR91,E1BRS4,F1M3Q1,F1NZH7,F1PY17,F1PY18,F1RGC3,F1RGC4,F1RGC5,F1RGC6,F6PXV4,F6PZ75,F6Q4V1,F6RQE8,F6U7A9,F6U7X8,F6U9S4,F6UGQ4,F6Y944,F6YAW3,F6ZB47,F6ZD87,F6ZD94,F7A3U1,F7BDJ8,F7CNA3,F7D7Q9,F7DDB5,F7DVE7,F7DX09,F7DX76,F7ELP9,F7FH26,F7H5B2,F7H7Z1,F7HFR9,F7I013,F7I045,F7I9J2,F7INS4,F7IQZ8,G1KIR8,G1KTZ2,G1KWI7,G1L516,G1L5D6,G1LUV9,G1LY66,G1PN58,G1PQZ9,G1Q4Y0,G1Q7A2,G1Q7D3,G1QF53,G1R9V0,G1R9V1,G1SAL0,G1TQB6,G3N2K1,G3QGC7,G3QLG9,G3RA73,G3S872,G3T6W5,G3TMS8,G3TSB6,G3TU19,G3UIQ6,G3V7W9,G3W1M5,G3W2E1,G3W3L9,G3W428,G3X9Z2,G5C2G2,G5C3T4,G5C472,G5C473,G5E5L8,G7NWN1,G7PNN0,G7PNV9,H0UW58,H0VIL2,H0W208,H0WB08,H0X158,H0XQL2,H0XSI5,H0XV41,H0XZJ2,H2L8I2,H2MNC5,H2NC91,H2NCE7,H2Q2U5,H2Q2U6,H2R5P4,H2R5P5,H2UX11,H2UX15,H2UX26,H2ZZS0,H3A9E9,H9H7A9,H9H7W4,H9KXX4,I3IWB6,I3JQP1,I3K511,I3K7M6,I3K7M7,I3LK92,I3LUQ7,I3MZN9,I3NH28,J9P3H0,K7FR89,K7FRB8,K7G8P6,L5KPR8,L5M080,L5M176,L5M1B8,L5M2Y2,L5MF77,L8Y4U9,L8Y8R5,L8YBK3,L8YC15,L8YE24,L9J8S0,L9KVV2,L9L6L7,L9L855,L9LAI8,M3W8G2,M3WWH8,M3WXK5,M3WY06,M3X0V2,M3XHR4,M3Y3X6,M3YAQ8,M3YAR5,M3YAS7,M3ZIY9,M7AV80,M7BSB3,M7C2L0,O88728,P13164,P26376,Q01628,Q01629,Q3ZBV6,Q3ZCG5,Q5FVZ3,Q8BR26,Q99J93,Q9CQW9,Q9D103,Q9R175,R4GJX3,S7MGC5,S7MHJ6,S7N1H1,S7N3T0,S7NT80,S7P0K5,S7P6Z1,S9W3M8,S9WE77,S9YA33,U3KAG9,U3KAH5,U3KB40,V8NB49,V8NXB0,W5LY78,W5LYA9,W5PEA7,F1NZH7_CHICK"
set Lid [split $id ,]
puts "Lid [llength $Lid]"
set Luni [IDMapping_web "ACC+ID" ACC $Lid]
set Land [land $Lid $Luni]
puts "Land [llength $Land]"
puts "\n"
for {set i 0} {$i < [llength $Luni]} {incr i 100} {
set f [expr {($i+1)*100-1}]
set out [DbFetchGET uniprot [join [lrange $Luni $i $f] ,]]
puts "$i [string range $out 0 10]"
}
}
foreach n $::LNOrdali {
if {[EstUnUniProt $n]} {
lappend Ln $n
lappend Ls [set ::Sequences($n)]
}
}
EcritLeTfa auduni.tfa $Ln $Ls
puts "[llength $Ln]"
exit
}
proc tau2 {} {
global TDesOrganismes LNOrdali
#CheckInfosSeqs
foreach n $LNOrdali {
if {$n ne ""} {
lappend Luni $n
}
}
set Lout [IDMapping_web ACC+ID ACC $Luni]
set Lid [list]
foreach u $Luni i $Lout {
puts ">$u< >$i<"
if {$i eq ""} {
lappend Lid $u
} else {
lappend Lid $i
}
}
array set Tres [InfosFromUniProt $Lid]
exit
foreach k [array names Tres "*,Organism"] {
lassign [split $k ,] id tmp
puts "$id [set Tres($k)]"
}
foreach u $Luni id $Lid {
if {! [info exists Tres($id,Organism)]} {
set orga "Unknown unknown"
} else {
set orga $Tres($id,Organism)
}
puts "$u | $id | $orga"
}
}
proc CommandLineClustering {method} {
global Clus
......
......@@ -12188,3 +12188,21 @@ proc tbl {} {
exit
}
proc alscro {} {
# wdt = 60
# hgt = 20
set Laa {A C D E F G H I K L M N P Q R S T V W Y}
set Laa [concat {*}[lrepeat 4 $Laa]]
puts "enb seq [llength $Laa]"
set o [open scroll.tfa w]
set n 0 ; set i 0
foreach a $Laa {
incr n [expr {! ($i%20)}]
puts $o ">$a$a$a$a--$n\n[string repeat $a 240]"
incr i
}
close $o
exit
}
......@@ -3,7 +3,7 @@
proc CutLesNoms {} {
global NomSeqSel LSOrdali LNOrdali LNSeqlab LSSeqlab NomsAffiches Defauts NomTextSeq TScrollY
global NomSeqSel LSOrdali LNOrdali LNSeqlab LSSeqlab NomsAffiches Defauts NomTextSeq TScrollY LNSeqlab LSSeqlab
update idletasks
if {[TypeAli] eq "pasdali"} {
......@@ -16,43 +16,50 @@ proc CutLesNoms {} {
# strore Y-scroll position
lassign [$TScrollY get] ysc tmp
if {[QuelMode] eq "seqlab"} {
set LNoms $LNSeqlab
set LSeqs $LSSeqlab
} else {
set LNoms $LNOrdali
set LSeqs $LSOrdali
}
set Li [list]
set NomSeqSel [lsort -real $NomSeqSel]
foreach e $NomSeqSel {
lassign [split $e .] y x
set i [expr {$y-1}]
if {[lindex $NomsAffiches $i] eq ""} {
continue
} else {
if {[lindex $LNoms $i] ne ""} {
lappend Li $i
}
}
set Li [lsort -integer -decreasing $Li]
if {! [CopyLesNoms]} {
return
set Li [lsort -integer -decreasing $Li]
foreach i $Li {
set LNoms [lreplace $LNoms $i $i]
set LSeqs [lreplace $LSeqs $i $i]
}
CopyLesNoms
if {[QuelMode] eq "seqlab"} {
foreach i $Li {
set LNSeqlab [lreplace $LNSeqlab $i $i]
set LSSeqlab [lreplace $LSSeqlab $i $i]
}
$NomTextSeq cut $Li
set LNSeqlab $LNoms
set LSSeqlab $LSeqs
} else {
foreach i $Li {
set LNOrdali [lreplace $LNOrdali $i $i]
set LSOrdali [lreplace $LSOrdali $i $i]
}
VueEditee 1
set LNOrdali $LNoms
set LSOrdali $LSeqs
FlagFeatureScore 1
MetAJourGroupes
}
VueEditee 1
set NomSeqSel {}
MetAJourGroupes
ChangeNomsAff $Defauts(NomsAffiches)
AfficheNomsEtSeqs
RepeintNomsEtSeqs
# re-position at original Y
CoupleY moveto $ysc
......@@ -67,32 +74,38 @@ proc CopyLesNoms {} {
if {[TypeAli] eq "pasdali"} {return}
if {$NomSeqSel == {}} {return}
if {$BufferSeq != {}} {
set chx [tk_dialog .chx "Warning !" "Warning ! You already have sequences in the clipboard ! Cutting the sequences will discard them !" "" 0 "Discard" "Cancel"]
set chx [tk_dialog .chx "Warning !" "Warning ! You already have sequences in the clipboard ! Copying the selected sequences may discard them !" "" 0 "Discard" "Cancel"]
if {$chx == 1} {return 0}
}
if {[QuelMode] eq "seqlab"} {
set LNoms $LNSeqlab
set LSeqs $LSSeqlab
} else {
set LNoms $LNOrdali
set LSeqs $LSOrdali
}
set Lix [list]
set BufferSeq {}
set NomSeqSel [lsort -real $NomSeqSel]
foreach e $NomSeqSel {
lassign [split $e .] y x
set i [expr {$y-1}]
if {[QuelMode] eq "seqlab"} {
set Nom [lindex $LNSeqlab $i]
if {$Nom eq ""} {continue}
set Seq [lindex $LSSeqlab $i]
set Nom [lindex $LNoms $i]
if {$Nom eq ""} {continue}
set Seq [lindex $LSeqs $i]
if {[QuelMode] ne "seqlab"} {
set Tname ""
} else {
set lt [$NomNomSeq tag names $e]
set Tname [lsearch -inline -regexp $lt {^TCG}]
} else {
set Nom [lindex $LNOrdali $i]
if {$Nom eq ""} {continue}
set Seq [lindex $LSOrdali $i]
set Tname ""
}
lappend Lix $i
lappend BufferSeq [list $Nom $Seq $Tname]
}
if {[QuelMode] eq "seqlab"} {
$NomTextSeq copy $Lix
}
......@@ -137,7 +150,6 @@ proc PasteLesNoms {} {
foreach b $BufferSeq {
lassign $b Nom Seq Tname
lappend LIS $Seq
lappend LIT $Tname
set te $Nom
set Lx [lsearch -all $LNoms $Nom]
......@@ -157,8 +169,10 @@ proc PasteLesNoms {} {
set acc [set TDesAccess($te)]
set TDesAccess($Nom) $acc
CopySequenceData $te $Nom
set Tname ""
}
lappend LIN $Nom
lappend LIT $Tname
}
# insertion point in widget
......@@ -188,6 +202,7 @@ proc PasteLesNoms {} {
FlagFeatureScore 1
}
update idletasks
$NomNomSeq configure -state disabled
set BufferSeq {}
......
......@@ -878,21 +878,18 @@ proc EmulationSeqLab {} {
SeqlabFont
$NomTextSeq configure -foreground $Defauts(SeqlabFg) -background $Defauts(SeqlabBg)
#$NomTextSeq configure -foreground black -background white
$NomTextSeq sequences $Ltmp
$NomTextSeq mapping [set Defauts(Mapping)]
$NomTextSeq map on
$NomTextSeq configure -state normal
# remet ascenceur
CoupleY moveto $yscr
CoupleX moveto $xscr
FaireLaSuite .sqat
update idletasks
FaireLaSuite .sqat
return
}
......@@ -1323,10 +1320,11 @@ proc DetruitSeqlabGroup {g} {
proc GroupeLesSequences {} {
# 1 on supprime tous les groupes touches, et on cree un nouveau groupes avec les sequences selectionness
# 1 on supprime tous les groupes touches,
# et on cree un nouveau groups avec les sequences selectionness
# ==> 'Delete then Create'
#
# 2 on cree un nouveau groupe avec les seq s selectionnees et on les enleve de leur groupe d'origine
# 2 on cree un nouveau groupe avec les seqs selectionnees et on les enleve de leur groupe d'origine
# ==> 'Keep and Create'
#
# 3 on fait un groupe avec les seqs selectionnes + toutes celles des groupes qu'elles touchent
......
......@@ -176,7 +176,7 @@ proc ValsDesDefauts {} {
set Defauts(MinThrGap) 4
set fontFml "Courier New"
set Defauts(SeqFontFaml) $fontFml
set Defauts(SeqFontSize) 10
set Defauts(SeqFontSize) 12
set Defauts(SeqFontWght) normal
set Defauts(DeltaXScroll) 10
set Defauts(Mapping) [EditorMappingData]
......@@ -782,6 +782,9 @@ proc ChangeTkOptions {} {
rename ::Luc_bgerror ::bgerror
if {1 && [info exists ::env(USER)] && $::env(USER) eq "moumou"} {
if {"SeqFont" in [font names]} {
font configure SeqFont -size 32
}
set Defauts(SeqlabBg) black
set Defauts(SeqlabFg) white
font configure TkDefaultFont -size 18
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment