Menu

save_consensus_trace -- tcl scripting error

John Major
2005-10-07
2013-04-18
  • John Major

    John Major - 2005-10-07

    Using the techniqe similar to the one used in the dump_contig script, I wrote a script to save_consensus_trace.  It appears something is not quite right though.  When I run the script  I get the following error:
    -----------------
    bad option "save_consensus_trace": must be FIXME
        while executing
    "$ed save_consensus_trace $prefix.$cname 1 $clen $strand $matching"
        (procedure "save_consensus_trace" line 20)
    -----------------

    It seems the function save_consensus_trace is not a valid name? [though I find it used in the source]  Is there something unusual about this function call?  Like a different name I should use?

    below I've attached the script i'm using.

    #!/bin/sh
    #\ exec stash $0 ${@+"$@"}

    # Globals
    set line_width 50
    set name_width 15
    set prefix contig

    proc save_consensus_trace {io cnum ed prefix strand} {
         global line_width name_width
         set c [io_read_contig $io $cnum]
         set clen [keylget c length]
         set cname [io_read_reading_name $io [keylget c left]]
       
         set matching "1";

    ##DEBUGGING OUTPUT START
    puts "start vars for save_cons_trace -- "
    puts $prefix.$cname
    puts 1
    puts $clen
    puts $strand
    puts $matching
    puts "done w/ovars..\n";
    ##DEBUGGING OUTPUT END

         $ed save_consensus_trace $prefix.$cname 1 $clen $strand $matching
    }

    # Various setup stuff
    load_package gap
    tkinit
    wm withdraw .
    InitTagArray
    InitLists
    tk_utils_init

    # Parse args & open the db
    if {"$argc" < 1 } {
        puts stderr "Usage: dump_contig database.version \ \[strand\]
         \[contig_identifier ...\]"
        exit
    }
    foreach {name version} [split [lindex $argv 0] .] {}
    set io [open_db -name $name -version $version -access r]

    set strand [lrange $argv 1 2];
    set contigs [lrange $argv 2 end]
    if {$contigs == {}} {
       set contigs [ListGet allcontigs]
    }

    # Loop through contigs dumping the output
    foreach c $contigs {
        set w [edit_contig -io $io -contig $c]
        save_consensus_trace $io [db_info get_contig_num $io $c] $w $prefix $strand
        destroy $w   
    }

    exit

     
    • John Major

      John Major - 2005-10-07

      Got it...

      I figured out that 'save_consensus_trace' is aliased to 'consensus_trace' in the contig editor....  making this one change in the code above did the trick.

       

Log in to post a comment.