Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
ordalie
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
luc.moulinier
ordalie
Commits
df2b88d0
Commit
df2b88d0
authored
Nov 18, 2019
by
luc.moulinier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
idmapping_sql OK !
parent
80a47313
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
29 deletions
+25
-29
src/ordali_services.tcl
src/ordali_services.tcl
+25
-29
No files found.
src/ordali_services.tcl
View file @
df2b88d0
...
...
@@ -701,6 +701,16 @@ proc IDMappingDir {} {
return
"/commun/bics/IDMapping/production/"
}
proc ListOfAllIDMappingBanks
{}
{
if
{
!
[
info exists ::ListAllIDMappingBanks
]}
{
set ::ListAllIDMappingBanks
[
lsort
[
LesLignesDuFichier
[
file join
[
IDMappingDir
]
id_dbs.txt
]]]
}
return $::ListAllIDMappingBanks
}
proc CheckIDMappingInputParam
{
args
}
{
# This proc is called when doing external call
# to IDMapping
(
setidmapping
)
...
...
@@ -717,7 +727,7 @@ proc CheckIDMappingInputParam {args} {
set from
[
string toupper $from
]
set to
[
string toupper $to
]
set LidmDBs
[
lsort
[
LesLignesDuFichier
[
file join
[
IDMappingDir
]
id_dbs.txt
]]
]
set LidmDBs
[
ListOfAllIDMappingBanks
]
lappend LidmDBs
"ACC+ID"
ACC ID
if
{
$from
ni $LidmDBs || $to ni $LidmDBs
}
{
puts
"
\n
Error :
\n
Bad <FROM_db> and/or <TO_db> names !"
...
...
@@ -745,23 +755,8 @@ proc CheckIDMappingInputParam {args} {
set Lids
[
split $Lids
" ,;|"
]
}
}
#puts
">
$from
< >
$to
< >
$
Lids< >
$taxid
<"
if
{
$from
in
{
ACC ID ACC+ID
}
&& $to in
{
ACC ID
}}
{
if
{
$from
eq
"ID"
}
{
set from UNIPROTKB_ID
}
elseif
{
$to
eq
"ID"
}
{
set to UNIPROTKB_ID
}
return
[
list $from $to $Lids $taxid
]
}
if
{
$from
in
{
"GENE_NAME"
"GENE_SYNONYM"
}
&& $taxid ne
""
}
{
return
[
list $from $to $Lids $taxid
]
}
else
{
return
[
list $from $to $Lids
]
}
}
...
...
@@ -785,13 +780,9 @@ proc DbIDMappingSQL {bank what} {
proc IDMapping_sql
{
from to Lids
{
taxid
""
}}
{
set Lacc
{}
if
{
$from
eq $to
}
{
puts
">
$from
> == <
$to
> !!"
IDMapping_Help
lassign
[
CheckIDMappingInputParam $from $to $Lids $taxid
]
from to Lids taxid
return
}
set Lacc
{}
if
{
$from
ni
{
ACC ID ACC+ID
}
&& $to ni
{
ACC ID
}}
{
set jointure 1
...
...
@@ -809,7 +800,7 @@ proc IDMapping_sql {from to Lids {taxid ""}} {
"ID"
-
"ACC+ID"
{
set source acc
if
{
$to
eq
"ACC"
}
{
if
{
0 &&
$to eq
"ACC"
}
{
set bank
""
}
else
{
set bank $to
...
...
@@ -850,6 +841,14 @@ proc IDMapping_sql {from to Lids {taxid ""}} {
return $Lacc
}
if
{
$to
eq
"ACC"
}
{
set target acc
}
if
{
$to
eq
"ID"
|| $to eq
"ACC"
}
{
set bank UNIPROTKB_ID
}
if
{
! $jointure
}
{
set db
[
DbIDMappingSQL $bank open
]
if
{
$taxid
eq
""
}
{
...
...
@@ -872,7 +871,7 @@ proc IDMapping_sql {from to Lids {taxid ""}} {
set cmd
"select db1.id, db2.id from
$from
as db1,
$to
as db2 where db1.id in ('
[
join $Lacc ','
]
') and db1.acc = db2.acc"
}
}
#puts
"cmd=
$cmd
\n
"
set Lout
[
$db
eval $cmd
]
$db
close
...
...
@@ -889,9 +888,6 @@ proc IDMapping_sql {from to Lids {taxid ""}} {
}
}
#lulu
puts
"
[
join $Lres
\n
]
"
exit
return $Lres
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment