extracting readings

2005-05-04
2013-04-18
  • Nobody/Anonymous

    I am new to staden and was wondering how, after finishing all of the editing and verification of a contig, I can get out all of the individual reads. I basically want to put them into fasta format and analyze this alignment in other programs. I would like, but do not need the chromatograms. I notice that the extract readings option is not available under the "file" in gap4. Can anyone offer me some advice?

     
    • James Bonfield

      James Bonfield - 2005-05-09

      Maybe it's only available in the expert mode (see Options -> Configure menus). Extract readings though doesn't really do what you want. It purely outputs the sequences as individual experiment files (close enough to EMBL format to work for many tools), but I'm guessing you want to use gap4 as a multiple alignment tool and actually gap sequences from base zero of the contig?

      That's not something available in the existing user interface (although it could be scripted if you wish to delve into Tcl).

      James

       
    • Nobody/Anonymous

      Thanks for the input. I have actually just found a solution that works well for me. Once I have edited the contig to my satisfaction and I have all of the sequences I want in my "alignment" I simply go to "File>Save Consensus" and save this in fasta format. This gives just what I need (minus the chromoatograms, but I am finished editing at this point so all is well with the world). Hopefully this might be of help to others as well!

       
    • Andrew Warry

      Andrew Warry - 2005-05-13

      Hi

      Just an extra thought: It is actually relatively simple to convert a contig dump text file (Gap4 contig editor window: Commands>>> Dump Contig to File) to an ordinary multiple sequence alignment e.g fasta/msf etc. I wrote a Perl script to do this a while ago
      (perhaps a Dump to MSF option could be added sometime in the future?)

      ANDREW

       
    • James Bonfield

      James Bonfield - 2005-05-17

      That's a good point. It's not trivial to "script" the editor so it wouldn't allow for a non-interactive way to dump a gap4 database as MSF, but practically speaking it's easy enough for the user and as you point out the code is more or less done, just in another format.

       
    • dlavrov

      dlavrov - 2005-06-08

      Is it possible to dump all contigs to a file?  Does anybody has a script to do this?  Thanks in advance!

      Dennis

       
    • dlavrov

      dlavrov - 2005-06-08

      Is it possible to dump all contigs to a file?  Does anybody have a script to do this?  Thanks in advance!

      Dennis

       
    • James Bonfield

      James Bonfield - 2005-06-20

      Please see https://sourceforge.net/docman/display_doc.php?docid=28975&group_id=100316  for an example.

      I hope it works correctly!

       
      • dlavrov

        dlavrov - 2005-06-30

        Hello James,

        Thank you for your help.  Unfortunately I cannot read this (or any other) doment in the DOC section.  It says "document unavailable".

        Best wishes,
        Dennis

         
    • bsenf

      bsenf - 2005-06-20

      Hi,

      I have to change line 36 (dump_contig.tcl);
      maybe some tcl syntax errors ?

      old:
      if { $c {} } {

      new:
      if { [string equal {} $contigs] } {

      Now it works like expected.

       
    • James Bonfield

      James Bonfield - 2005-06-20

      The text I see when I go to "edit document" on the source forge admin bit definitely has "if {$contig == {}} {". I've tried editing it and whatever I do $contig== gets rewritten as $c. Very odd!

      That and the lack of any way for people to reply to documents means that maybe it's not the best way of implementing a user-based code snippet/script library.

      I've also got a tracker set up (like patches, bugs etc) which I may enable to do the same thing, or perhaps forums would work. So, as a test, let's see how this looks :-). I expect forums will display poorly due to proportional fonts and I should go for the heavy-weight tracker solution.

      James

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

      # Globals
      set line_width 50
      set name_width 15
      set prefix contig

      proc dump_contig {io cnum ed prefix} {
           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]]
           $ed dump_contig $prefix.$cname 1 $clen $line_width $name_width
      }

      # 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 \          \[contig_identifier ...\]"
          exit
      }
      foreach {name version} [split [lindex $argv 0] .] {}
      set io [open_db -name $name -version $version -access r]

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

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

      exit

       
    • James Bonfield

      James Bonfield - 2005-06-30

      Try looking in the tracker section:

      https://sourceforge.net/tracker/?atid=749480&group_id=100316&func=browse

      I tried the document section, but in the end I just gave up with it as even entering in HTML it had a knack of trying to "rewrite" portions and broke the scripts.

      James

       
    • dlavrov

      dlavrov - 2005-07-01

      Thanks a lot!  I got the file.  Now when I try to use it I get the following error message:

      application-specific initialization failed: Can't find a usable init.tcl in the following
      directories:
          /usr/local/lib/tcl8.4 /usr/local/staden/lib/tcl8.4 /usr/local/lib/tcl8.4 /usr/local/staden/library /usr/local/library /usr/local/tcl8.4.6/library /usr/tcl8.4.6/library /usr/loc
      al/lib/tcl8.4

      This probably means that Tcl wasn't installed properly.

      can't read "0": no such variable
          while executing
      "exec stash $0 ${@+"$@"}  "

      What do I do wrong?

       
    • James Bonfield

      James Bonfield - 2005-07-04

      Not sure. It probably means that TCL_LIBRARY isn't setup, which normally gets done by the top-level scripts such as Gap4.

      Try setting it to be $STADENROOT/lib/tcl. I cannot really spend time supporting this stuff. The purpose of these code snippets are to provide examples to developers, not to act as supported programs for end-users to use.

      James

       

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks