#!/bin/sh # the next line restarts using wish \ exec wish "$0" "$@" set waitlimit 2000 exec clear puts { // \\ // \\ // \\ // \\ // \\ ': | \\ // | :,\\': | \\ // | :,\\': | \\ \\ | | \\ // | | // \\ | | \\ // | | // \\ | | \\ | :,\\': | // \\ | :,\\': | // \\ | \\ // \\ // \\ // \\ // \\ Biowish is a C-extension for the Tcl/Tk scripting language. It consists of one main library which can be loaded dynamically into a running Tcl/Tk interpreter. Biowish adds additional molecular biology related Tcl commands like basic nucleotide sequence editing/analysing and for Tk a sequence editing widget. // \\ // \\ // \\ // \\ // \\ ': | \\ // | :,\\': | \\ // | :,\\': | \\ \\ | | \\ // | | // \\ | | \\ // | | // \\ | | \\ | :,\\': | // \\ | :,\\': | // \\ | \\ // \\ // \\ // \\ // \\ ... This is a testing script for Biowish .... } wm withdraw . after $waitlimit puts "loading biowish .." load ./biowish.so puts "wait [ expr $waitlimit/1000] seconds until next command ..." set file testseq.embl # seq is the target array for the sequence puts "reading $file ..." biowish::readseq $file seq puts "array names:\n [array names seq]" after $waitlimit # sequence information puts "Seqinfo: [ biowish::seqinfo $seq(sequence)]" after $waitlimit # G+C% puts "G+C%: [biowish::gc $seq(sequence)]" after $waitlimit # subsequence biowish::subseq seq 0 100 # subsequence now in seq(subseq,name) and seq(subseq) puts "Subsequence: [array names seq]" after $waitlimit set sseq(sequence) $seq(subseq) set sseq(name) $seq(subseq,name) set sseq(length) $seq(subseq,length) # Reverse, Complement and Antiparallel puts -nonewline "checking reverse, complement and antiparallel ..." set rev [ biowish::reverse $sseq(sequence) ] set com [ biowish::complement $sseq(sequence)] set anti [ biowish::antiparallel $sseq(sequence)] set rev_com [ biowish::complement $rev] if {$anti!=$rev_com} { puts stderr "Ooooppps new_s != original sequence" } else { puts "ok !!! " } after $waitlimit set s $sseq(sequence) # Translation frames puts "\n\n\n6 frames: [ biowish::6frame $s]" after $waitlimit puts "\n\n\n3 frames: [ biowish::3frame $s]" after $waitlimit puts "\n\n\n2 frames [ biowish::1frame $s]" after $waitlimit puts "\n\n\nall frames [ biowish::all_frames $s]" after $waitlimit # single frame translation for { set i 1} {$i<4} {incr i} { set frame($i) [biowish::translate $i $s] puts " \n\n\nFrame $i: $frame($i)" after $waitlimit } for { set i -1} {$i>-4} {incr i -1} { set frame($i) [biowish::translate $i $s] puts "\n\n\nFrame $i: $frame($i)" after $waitlimit } # Mutate sequence 100 times puts "mutating 100 times \n [biowish::mutate $s 35 35 15 15 100]" after $waitlimit # DNA increment set nt a puts "DNA increment ..." for { set i 0} {$i<50} {incr i} { biowish::dna_incr nt puts -nonewline "$nt " after 100 flush stdout } puts -nonewline "\n" after $waitlimit # converting sequences to .. # fasta embl genbank gcg pir raw ig stanford gb nbrf uwgcg dnastrider # strider fitch pearson zuker olsen phylip phylip3.2 phylip3.3 phylip3.4 # phylip-interleaved phylip-sequential plain codata asn.1 msf paup nexus puts "\n\n\nconverting sequence\n\t [ biowish::convertseq sseq gcg ]" after $waitlimit # write sequence to file # biowish::writeseq outfile sseq fasta # TK only ... # a sequence editor puts -nonewline "starting sequence editor ...";flush stdout biowish::xbbtools .xb update after $waitlimit destroy .xb puts "ok" # a sequence editor with file on startup puts -nonewline "starting sequence editor with file...";flush stdout biowish::xbbtools_file .xb $file update after $waitlimit destroy .xb puts "ok" # a sequence editor with part of the file on startup puts -nonewline "starting sequence editor with subsequence ...";flush stdout biowish::xbbtools_subfile .xb $file 100 200 update after $waitlimit destroy .xb puts "ok" # a sequence editor with open reading frames puts -nonewline "starting sequence editor with open reading frames ...(this may take a while).." flush stdout biowish::xbbtools_file .xb $file set id [biowish::xbb::orfs .xb] update lower .xb puts "ok" puts -nonewline "zooming 20% ..." flush stdout biowish::orfs::zoom $id 0.2 puts "ok" puts -nonewline "reading features ..." flush stdout biowish::orfs::parse_features $id test.features puts "ok" update after [ expr 3*$waitlimit] destroy .xb exit