Confidence Score Reading using io_read_data...

jkb at mrc-lmb.cam.ac.uk jkb at mrc-lmb.cam.ac.uk
Wed Jul 11 08:10:03 EST 2001

In <3B4B3F0C.E3B600A8 at genome.wi.mit.edu> major at genome.wi.mit.edu (major) writes:
> set conf_vals [io_read_data $io [keylget r confidence] [keylget r
> length] 1];
> I get what appears to be a setid, or pointer:
> puts $conf_vals =
>   But i can't manage to resolve the scores from this.  And once I do, I
> need to be able to modify the scores, and re-write them.

This is a block of binary data, hence the io_read_data instead of
io_read_text. It's an array of 1-byte values (the item size is last argument in
io_read_data) which can be converted to numerics using the Tcl "binary scan"


binary scan $conf_vals c* str
puts $str

=> 37 42 46 50 55 59 64 68 68 73 73 74 ...

The these can be looped around using a for loop or foreach. Eg:

foreach val $str {
    puts val=$val

James Bonfield (jkb at mrc-lmb.cam.ac.uk)   Tel: 01223 402499   Fax: 01223 213556
Medical Research Council - Laboratory of Molecular Biology,
Hills Road, Cambridge, CB2 2QH, England.
Also see Staden Package WWW site at http://www.mrc-lmb.cam.ac.uk/pubseq/

More information about the Staden mailing list

Send comments to us at biosci-help [At] net.bio.net