Tuesday, 21 May 2024 13:56:37 Problem unzipping loaded file ... Msg : stream error

wrong # args: should be "exit code" while executing "exit" (procedure "CheckNewTaxonomy" line 7) invoked from within "CheckNewTaxonomy"

OUTPUT BUFFER:

source /usr/local/apache2/PourRivet/SessionBeforeScript.tcl #!/usr/local/bin/tclsh cd /genomics/link/taxonomy/uniprot_taxonomy proc UploadNewTaxonomy {LLignes} { global TaxSystem db LGoldId TaxRoot Tx # Taxon | Mnemonic | Scientific name | Common name | Synonym | Other Names | Reviewed | Rank | Lineage | Parent # Check if first line is a header if {[string range [lindex $LLignes 0] 0 4] eq "Taxon"} { set LLignes [lrange $LLignes 1 end] } # Then parse file set nNodes -1 foreach Ligne $LLignes { if {! ([incr nNodes] % 10000)} { puts "$nNodes done ..." } if {[string trim $Ligne] eq ""} {continue} lassign [split $Ligne "\t"] TaxId Mnemonic Name CommonName Synonym OtherNames Reviewed Rank Lineage Parent vir set Name [string map {"'" "''"} $Name] set CommonName [string map {"'" "''"} $CommonName] set Synonym [string map {"'" "''"} $Synonym] set OtherNames [string map {"'" "''"} $OtherNames] set Lineage [string map {"'" "''"} $Lineage] # taxa vides if {$Name eq "" && $Parent eq "" && $Lineage eq ""} { continue } # other sequences if {$TaxId == 28384} { set Parent 0 } if {[string trim $Rank] eq ""} { set Rank "no rank" } # root if {[string trim $Name] eq "cellular organisms"} { puts " ==> root $TaxId" set TaxRoot $TaxId set Parent 0 } if {$Parent eq ""} { set Parent -1 puts "Parent -1 : $Name" } if {! [info exists Name2Tax($TaxId)]} { set Name2Tax($Name) $TaxId } else { puts "Warning ! $TaxId existe deja" } lappend LToInsert [join [list $TaxId $Mnemonic $Name $CommonName $Synonym $OtherNames $Rank $Lineage $Parent $vir] \t] } puts "reading done ! [llength $LToInsert] entries " puts "[DonneDateEtHeure]" # update ... file delete ins.tab set o [open ins.tab w] puts $o [join $LToInsert \n] close $o $db eval {PRAGMA synchronous=OFF} $db eval {PRAGMA journal_mode = OFF} $db copy abort taxonomy ins.tab "\t" $db eval {create index idx_taxonomy on taxonomy (taxid, Name, Rank, Parent)} $db eval {create index idx_taxonomy_parent on taxonomy (Parent)} $db eval {create index idx_taxonomy_rank on taxonomy (Rank)} puts "\nInsertions done ..." return } proc InitTable {} { set table " - taxonomy : { . taxid P . Mnemonic V32 . Name V32 . CommonName V32 . Synonymous V32 . OtherNames V32 . Rank V32 . Lineage T . Parent I . virus V32 }" set db [FabriqueDeTables $table "" uniprot_taxonomy.sql] return $db } proc CheckNewTaxonomy {} { set url "http://www.uniprot.org/taxonomy/?format=tab&compress=yes" set taxoGZ [HttpCopy $url] if {[catch {set taxoText [zlib gunzip $taxoGZ]} Msg]} { puts "Problem unzipping loaded file ..." puts "Msg : $Msg" exit } set taxo [split $taxoText \n] set tmd5 [::md5::md5 -hex $taxo] set omd5 [LesLignesDuFichier uniprot.md5] if {$omd5 eq $tmd5} { return "" } # save new md5 file delete uniprot.md5 set o [open uniprot.md5 w] puts $o $tmd5 close $o # save raw data file delete taxonomy.txt set o [open taxonomy.txt w] puts $o $taxoText close $o return $taxo } set ORDALIDIR /home/moumou/ordali set OrdaliDir $ORDALIDIR source /home/moumou/ordali/src/ordali_source.tcl source /home/ripp/gscope/gscope_outils.tcl package require http package require tls package require sqlite3 package require md5 package require tdom puts "\n[DonneDateEtHeure]" if {! [file exists uniprot.md5]} { set o [open uniprot.md5 w] puts $o "FIRSTTIME" close $o } if {[set out [CheckNewTaxonomy]] != ""} { # create new DB file delete old_uniprot_taxonomy.sql catch {file rename uniprot_taxonomy.sql old_uniprot_taxonomy.sql} set db [InitTable] UploadNewTaxonomy $out } puts "\n[DonneDateEtHeure]" exit