4 ms·
if {[llength $argv] < 1} { puts "Usage: ./joinmods3 <\[file\].joinmods2> \n\n" exit } set HOME [pwd] set DATABASE [lindex $argv 0] set DIM
by biomimic 12y ago
if {[llength $argv] < 1} {
puts "Usage: ./joinmods3 <\[file\].joinmods2> \n\n"
exit
}
set HOME [pwd]
set DATABASE [lindex $argv 0]
set DIM 10000
proc CalcLine {line} {
set termData [lindex $line 1]
set termDataLength [llength $termData]
foreach {x y} $termData {
set score1 0
set score2 0
set score3 0
foreach sData [split $y {:}] {
set sd [split $sData {,}]
set score1 [expr {$score1+[lindex $sd 0]}]
set score2 [expr {$score2+[lindex $sd 1]}]
set score3 [expr {$score3+[lindex $sd 2]}]
}
lappend newLine "$x [format %.4f [expr {($score1+$score2)/$score3}]]"
}
set returnVal "[lindex $line 0] [list [string map {\{ "" \} ""} [lsort -real -index 1 -decreasing $newLine]]]"
}
proc Invoke {} {
global HOME
global DATABASE
set lCount 10
set wCount 0
set wData ""
set f1 [open $DATABASE "r"]
set f2 [open ${DATABASE}.j3 "TRUNC CREAT RDWR"]
while {[gets $f1 wordByte] >= 0} {
incr wCount
append wData [CalcLine $wordByte]\n
if {$wCount >= $lCount} {
puts -nonewline $f2 $wData
set lCount [expr {$lCount + 10}]
set wData ""
}
}
puts -nonewline $f2 $wData
close $f1
close $f2
}
Invoke
- xantronix 12y agoPlease explain for the masses!
- biomimic 12y agoAI preprocessing ai priori code. I found that Tcl is the best for this. It includes some efficient structures acute to Tcl. I use Tcl as a rapid application programming and proof of concept language. I find it to be the best at it. Used to use it for chip design too. After that at Berkeley Lab for knowledge discovery and gene discovery.