Commit 70d5a352 authored by luc.moulinier's avatar luc.moulinier

annotation fin

parent 137d5dc6
......@@ -2170,8 +2170,8 @@ proc BindModeNormal {} {
bindtags $::NomNomSeq $LNTags
bindtags $::NomTextSeq $LSTags
# Sauvegarde
#bind . <Control-Key-s> [list SauveLAlignement]
# saving shortcut
bind . <Control-Key-s> [list SauveLAlignement]
$::NomTextSeq tag delete Marque
update idletasks
......@@ -2798,6 +2798,9 @@ proc EtatSeqsOut {quoi} {
proc EtatBouton {b} {
# returns :
# - 0 if button is RAISED
# - 1 if button is SUNKEN
if {[$b cget -relief] eq "raised"} {
return 0
......@@ -3956,39 +3959,41 @@ proc ChoixPDBReference {} {
proc AfficheSnapshotAnnotations {} {
global NomTextSeq Anano WOrdali
global NomTextSeq Anno WOrdali
if {[TypeAli] eq "pasdali"} {
return
}
if {! [info exists Anno(Lanno)]} {
if {[QuelMode] eq "seqlab"} {
FaireLire "Not available in Editor mode yet !"
return
}
if {[QuelMode] eq "annotation"} {
return
}
unset -nocomplain Anno
LoadSnapAnnotations
parray Anno
update
$NomTextSeq configure -state normal
set bt $WOrdali(BoutAnno)
if {! [EtatBouton $bt]} {
set Anno(Ltags) [list]
foreach ann $Anno(Lanno) {
lassign $ann ian pka txt col zone
set txt "$ian - $txt"
set txtnsp [string map {_ @ " " "_"} $txt]
set tag "FDisp_$txtnsp"
$NomTextSeq tag configure $tag -background [CouleurO2Ordali $col] -foreground black
$NomTextSeq tag add $tag {*}$zone
lappend Anno(Ltags) "FDisp_$txtnsp"
}
# button is ON, show
ShowAnnotation All
$bt configure -relief sunken -background red -foreground white
} else {
foreach tag $Anno(Ltags) {
$NomTextSeq tag remove $tag 1.0 end
}
# Button is sunken, hide
ShowAnnotation None
unset Anno
$bt configure -relief raised -background cyan -foreground black
}
update idletasks
$NomTextSeq configure -state disabled
update idletasks
return
}
......
......@@ -76,7 +76,7 @@ proc DbProfile {sql time} {
proc RemplitOrdaliDB {} {
global OrdTmpDir LNOrdali LSOrdali
global {*}[info globals "TD*"] TabSF CompteurDeMac db Defauts LNDG SDG TColScore ListePDB
global {*}[info globals "TD*"] TabSF CompteurDeMac db Defauts LNDG SDG TColScore ListePDB ListeTypesDeFeatures
#$db profile DbProfile
$db eval {begin transaction}
......@@ -122,25 +122,32 @@ proc RemplitOrdaliDB {} {
# Met A Jour table des features
# on a TabSF, copie conforme des features
# du XML. On copie tel quel dans seqfeat
array set TAnno {}
if {[info exists TabSF]} {
if {"SnapAnnotation" in $ListeTypesDeFeatures} {
array set TAnno [array get TabSF "*,SnapAnnotation"]
RemoveAnnotationFeatures
}
MetAJourTableFeatures
} else {
set TabSF [list]
}
# Met A Jour table mac.
##########a###########
#
# 1er MAC : initial mac, never be touched
#
#####################
$db eval {begin transaction}
set Lx [$db eval {select pk_seqali from seqali order by pk_seqali}]
set titre "M[NumeroNewMac] - original alignment"
set pkm 1
$db eval {insert into snapshot values ($pkm, $titre,'original alignment')}
set titre "M[NumeroNewMac] - original alignment"
LesDefauts IxMacCourant $pkm
LesDefauts NmMacCourant $titre
$db eval {begin transaction}
set Lx [$db eval {select pk_seqali from seqali order by pk_seqali}]
$db eval {insert into snapshot values ($pkm, $titre,'original alignment')}
set pos 0
set i 1
......@@ -163,6 +170,9 @@ proc RemplitOrdaliDB {} {
$db eval {insert into ln_seqali_cluster values ($i, $pk_Cst,$pos)}
incr pos
}
# Add annotations
Features2Annotations [array get TAnno]
################
#
......@@ -179,7 +189,9 @@ proc RemplitOrdaliDB {} {
set titre "M$pkm - working alignment"
set name "working alignment"
}
LesDefauts IxMacCourant $pkm
LesDefauts NmMacCourant $titre
$db eval {insert into snapshot values ($pkm, $titre,$name)}
set pos 0
foreach s $Lx {
......@@ -187,9 +199,6 @@ proc RemplitOrdaliDB {} {
incr pos
}
LesDefauts IxMacCourant $pkm
LesDefauts NmMacCourant $titre
incr pk_Clg ; # clustering
incr pk_Cst ; # cluster
if {[TypeAli] eq "XML"} {
......@@ -217,6 +226,9 @@ proc RemplitOrdaliDB {} {
set pk_snap [$db eval {select max(pk_snap) from snapshot}]
set CompteurDeMac $pk_snap
# Add annotations if any
Features2Annotations [array get TAnno]
# Met A Jour conservation/colscores
if {[info exists TColScore]} {
foreach name $TColScore(Names) {
......@@ -254,7 +266,7 @@ proc RemplitOrdaliDB {} {
}
}
}
# Creation des Index
$db eval {create index idx_seqinfo on seqinfo (pk_seqinfo, seqname, access)}
$db eval {create index idx_seqali on seqali (pk_seqali, pk_seqinfo, seqname, seq)}
......
......@@ -253,13 +253,16 @@ proc AfficheModeFeatures {} {
proc AfficheModeAnnotation {} {
# hide annotations through snapshot button
set on 0
if {! [EtatBouton $::WOrdali(BoutAnno)]} {
AfficheSnapshotAnnotations
set on 1
}
AfficheBoutonsAnnotation
if {[EtatBouton $::WOrdali(BoutAnno)]} {
if {$on} {
AfficheSnapshotAnnotations
}
......@@ -300,10 +303,9 @@ proc AfficheBoutonsOrdali {} {
proc AfficheBoutonsAnnotation {} {
global FrmBouton Anno NomTextSeq WOrdali
if {[TypeAli] eq "pasdali"} {return}
unset -nocomplain Anno
LoadSnapAnnotations
# gui
grid columnconfig $FrmBouton 1 -weight 1
set wp "${FrmBouton}.fanno"
......
#
# ordali_setup.tcl
#
proc InitLesDefauts {} {
......@@ -718,7 +720,9 @@ proc DefinitionPreferences {} {
ValsDeCouleurs
set Couleurs(Stock) {red blue yellow green1 magenta orange cyan brown forest_green pink goldenrod sea_green coral violet khaki navy_blue salmon sienna turquoise lime_green maroon spring_green medium_blue indian_red dim_gray light_gray gray}
# Following colors are Tk colors
set Couleurs(Stock) {red blue yellow green1 magenta orange cyan brown ForestGreen pink goldenrod SeaGreen coral violet khaki NavyBlue salmon sienna turquoise LimeGreen maroon SpringGreen MediumBlue IndianRed DimGray LightGray gray}
#set Couleurs(Stock) {red blue yellow green1 magenta orange cyan brown forest_green pink goldenrod sea_green coral violet khaki navy_blue salmon sienna turquoise lime_green maroon spring_green medium_blue indian_red dim_gray light_gray gray}
return
}
......
......@@ -807,9 +807,3 @@ proc TestCoupeMainChain {type Lca {Lcol {}} {Lc {}} {Lo {}}} {
}
#
# ordali_xml.tcl
#
proc CreeLeMacsim {{out "dehors"} {LNoms ""} {LSeqs ""}} {
......@@ -1043,12 +1045,18 @@ proc CreeLeXml {{filout ""}} {
if {$filout eq ""} {
set filout [DemandeEtSauveFichier xml 1]
}
if {$filout eq ""} {return}
if {$filout eq ""} {
return
}
lassign [SequencesASauver] LNoms LSeqs
if {$LNoms == {} || $LSeqs == {}} {return}
if {$LNoms == {} || $LSeqs == {}} {
return
}
Annotations2Features
CreeLeMacsim $filout $LNoms $LSeqs
RemoveAnnotationFeatures
return
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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