Commit 4873623f authored by luc.moulinier's avatar luc.moulinier

bugs, idmapping

parent f43d8474
......@@ -31,9 +31,13 @@ proc SetupPDBObject {} {
# Arguments
# - nom : file or text or lines or id
# - init : 1 -> load from db, 0 load fram <nom>
if {$init eq ""} {set init 0}
if {$init eq ""} {
set init 0
}
# - InDb : 1 store in db, 0 don't
if {$InDb eq ""} {set InDb 1}
if {$InDb eq ""} {
set InDb 1
}
if {$init} {
my UpdateFromDB
......@@ -48,7 +52,11 @@ proc SetupPDBObject {} {
set src "list"
} elseif {[file extension $nom] eq ""} {
#set Llignes [RecupereUnFichierSurWeb [string toupper $nom]]
set textePDB [TextePDB [string toupper $nom] ALL "" "OnTheWeb"]
package require TclCurl
set url "https://files.rcsb.org/download/XXXX.pdb"
regsub -all "XXXX" $url $nom url
curl::transfer -url $url -bodyvar textePDB
#set textePDB [TextePDB [string toupper $nom] ALL "" "OnTheWeb"]
set Llignes [split $textePDB \n]
if {$Llignes eq "ERREUR" || $Llignes eq ""} {
return 0
......
......@@ -664,6 +664,23 @@ proc MyProc {name argList body} {
}
proc DoMacPack {} {
cd /home/moumou
catch {file delete -force {*}[glob macpack*]}
file copy ./ordali/src/macpack.tcl .
exec ./tclkit sdx.kit qwrap macpack.tcl
exec ./tclkit sdx.kit unwrap macpack.kit
cd macpack.vfs
file copy -force ~/ordali/Build/macosx-x86_64 .
cd ..
exec ./tclkit sdx.kit wrap macpack -runtime mackit
exit
}
# http://kitcreator.rkeene.org/kitcreator
......
......@@ -13477,3 +13477,104 @@ proc cherie {} {
return
}
proc tseb {} {
package require Rtcl
set Ll [LesLignesDuFichier mat.dst]
set vals [concat {*}$Ll]
Rpipe "x <- c([join $vals ,])"
Rpipe "mat <- matrix(x,byrow=T,nrow=5, ncol=5)"
Rpipe "res <- eigen(x)"
return
}
proc MakeTransparentImage {img} {
LoadTkAndPackages
set id [image create photo -file $img]
set col {255 255 255}
set wdt [image width $id]
set hgt [image height $id]
for {set x 0} {$x < $wdt} {incr x} {
for {set y 0} {$y < $hgt} {incr y} {
if {[$id get $x $y] == $col} {
$id transparency set $x $y 1
}
}
}
$id write [file rootname $img].png
return
}
proc thom {} {
global db
set La [IDMapping_sql GENE_NAME ACC zufsp]
puts "La [llength $La]"
set La [lindex $La 0]
puts "La [llength $La]"
set Lh [IDMapping_sql ACC NCBI_TAXID $La]
puts "Lh [llength $Lh]"
set Lix [lsearch -all -exact $Lh "9606"]
foreach ix $Lix {
puts "human : ix=$ix [lindex $La $ix]"
}
set Ld [IDMapping_sql GENE_NAME NCBI_TAXID zufsp]
puts "\nLd [llength $Ld]"
set Ld [lindex $Ld 0]
set Lix [lsearch -all -exact $Ld "9606"]
foreach ix $Lix {
puts "direct ix=$ix [lindex $Ld $ix]"
}
set La [IDMapping_sql GENE_NAME ACC zufsp 9606]
puts "La $La"
set Lf [IDMapping_sql GENE_NAME GENE_SYNONYM zufsp 9606]
puts "\nLf $Lf\n"
cd /commun/bics/IDMapping/production/SQLDBS
puts "\nDeux etapes"
set Lh [IDMapping_sql GENE_NAME ACC zufsp 9606]
set Lh [lindex $Lh 0]
puts "[llength $Lh] $Lh"
set Lh [IDMapping_sql ACC GENE_SYNONYM $Lh]
puts "$Lh"
set taxid 9606
set Lid zufsp
set Lacc zufsp
set BankSource GENE_NAME
set BankTarget GENE_SYNONYM
set db [DbIDMappingSQL GENE_NAME open]
AttachIDMappingBank GENE_SYNONYM
AttachIDMappingBank NCBI_TAXID
#set cmd "WITH db1(id) AS (VALUES ('[join $Lid '),(']')) select db1.id, db2.id from $BankSource as db1, $BankTarget as db2, NCBI_TAXID as db3 where db1.id in ('[join $Lacc ',']') and db3.id = '$taxid' and db1.acc = db2.acc and db2.acc = db3.acc"
#set cmd "WITH tmp(acc) AS (VALUES ('[join $Lacc '),(']')) SELECT tax.acc,tax.id FROM tmp AS dbin, NCBI_TAXID AS tax WHERE tax.acc = dbin.acc and tax.id = '$taxid'"
set cmd "select db1.id, db2.id from GENE_NAME as db1, GENE_SYNONYM as db2, NCBI_TAXID as db3 where db1.id in ('ZUFSP') and db1.acc = db2.acc and db2.acc = db3.acc and db3.id = '9606'"
#set cmd "select db1.id, db2.id from GENE_NAME as db1, GENE_SYNONYM as db2, NCBI_TAXID as db3 where db1.id='ZUFSP' and db1.acc = db2.acc and db2.acc = db3.acc and db3.id = '9606'"
puts "cmd= $cmd"
set Lres [$db eval $cmd]
puts "Lres $Lres"
exit
}
......@@ -3125,29 +3125,42 @@ proc Reigen {} {
foreach a $Ln {
set tmp {}
foreach b $Ln {
lappend tmp [lindex $TDesPCI($a,$b) 0]
lappend tmp [expr {1.0 - [lindex $TDesPCI($a,$b) 0]}]
}
lappend m $tmp
}
lmap x $m {plist $x %6.4f}
puts ""
package require Rtcl
Rpipe "x <- c([join [concat {*}$m] ,])"
Rpipe "x <- matrix(x, byrow = T, ncol=5, nrow=5)"
Rpipe "res <- eigen(x, symmetric=TRUE)"
#Rpipe "res <- eigen(x, symmetric=TRUE)"
Rpipe "res <- eigen(x)"
set val [::rtcl::getvalue "res\$values"]
set vec [lrange [::rtcl::getvalue "res\$vectors"] 0 4]
puts "val :"
plist $val %6.3f
set sum [::tcl::mathop::+ {*}$val]
puts "sum= $sum"
puts "sum = $sum"
puts "vec :"
plist $vec %6.3f
set k 0
set Lvec [::rtcl::getvalue "res\$vectors"]
while {$k < 25} {
set vec [lrange $Lvec $k $k+4]
incr k 5
plist $vec %6.3f
}
puts ""
set vec [lrange $Lvec 0 4]
set sum [+ {*}$vec]
set new [lmap x $vec {expr {$x/$sum}}]
plist $new %6.3f
return $vec
}
......
This diff is collapsed.
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