error "mismatched tag" at line 1287 character 2
" }
      


    

OUTPUT BUFFER:

#!/usr/local/bin/tclsh lappend auto_path /Users/gerald/Personal/Projects/tclws/ package require log package require WS::Client 2.2.7 proc pdict { d {i 0} {p " "} {s " -> "} } { set errorInfo $::errorInfo set errorCode $::errorCode set fRepExist [expr {0 < [llength\ [info commands tcl::unsupported::representation]]}] while 1 { if { [catch {dict keys $d}] } { if {! [info exists dName] && [uplevel 1 [list info exists $d]]} { set dName $d unset d upvar 1 $dName d continue } return -code error "error: pdict - argument is not a dict" } break } if {[info exists dName]} { puts "dict $dName" } set prefix [string repeat $p $i] set max 0 foreach key [dict keys $d] { if { [string length $key] > $max } { set max [string length $key] } } dict for {key val} ${d} { puts -nonewline "${prefix}[format "%-${max}s" $key]$s" if { $fRepExist && ! [string match "value is a dict*"\ [tcl::unsupported::representation $val]] || ! $fRepExist && [catch {dict keys $val}] } { puts "'${val}'" } else { puts "" pdict $val [expr {$i+1}] $p $s } } set ::errorInfo $errorInfo set ::errorCode $errorCode return "" } proc DataFromeFetch {Lnm dct aft} { upvar $aft ft set Lres [dict get $dct GBSet GBSeq] foreach res $Lres n $Lnm { foreach {k v} $res { set ft($n,[string range $k 6 end]) $v } } return } proc DictFor {l} { global iLevel # should be organize on a key/value basis. # Each valid key starts with "GB" incr iLevel set gap [string repeat " " $iLevel] if {[llength $l] == 1} { # we may have a list of lists. # Check sub-listt if {([llength [lindex $l 0]] % 2) == 0} { puts "${gap}take \[lindex xx 0\]" DictFor [lindex $l 0] return } elseif {[llength [lindex $l 0]] == 1 || ! [regexp {^GB} [lindex $l 0]]} { # we are at the end of a key/value # nothing to do return } } # test the list/dict puts "${gap}llength [llength $l]" foreach {k v} $l { if {! [regexp {^GB} [lindex $l 0]]} { puts "${gap}not a proper key" puts "${gap}-> [llength $l] not even" set i 0 foreach e $l { puts "${gap}elt $i : [lindex $l $i]" incr i } return } puts "${gap}kfor = $k" puts "${gap}vfor = $v" if {$v eq ""} {return} DictFor $v } return } proc main_seq {{id ""}} { # WSDL address for fetch service set ret [::WS::Client::GetAndParseWsdl "http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/v2.0/efetch_seq.wsdl"] # list of entries to fetch set Lnm [list xp_570076 xp_002295841 xp_571738] # query data for a given Id puts -nonewline "Retreive Data ...." set ft [::WS::Client::DoCall eFetchSequenceService run_eFetch [list db protein id "[join $Lnm ,]"]] puts " done !" # retreive data puts -nonewline "\nAssign data ..." DataFromeFetch $Lnm $ft tab puts " done !" # examine output puts "\nExamine output dict" foreach res [dict get $ft GBSet GBSeq] { set Lout [list GBSeq $res] set ::iLevel 0 DictFor $Lout puts "" } # examine output set ::iLevel 0 puts "\nExamine feature table" set Lft [list feature-table [set tab([lindex $Lnm 0],feature-table)]] DictFor $ft return } main_seq exit