Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • letusgo
    Member
    • Aug 2011
    • 17

    #1

    Blast2go result to WEGO

    i got a big blast2go result, it's just like:

    Contig1 GO:0016301
    Contig2 GO:0016301
    Contig3 GO:0016301
    Contig4 GO:0003700
    Contig4 GO:0009651
    Contig4 GO:0006355
    Contig5 GO:0009556
    Contig5 GO:0005515
    Contig5 GO:0080019
    Contig5 GO:0016563
    Contig5 GO:0016627
    Contig6 GO:0003700
    Contig6 GO:0010018

    now i want to use WEGO ,so i need to convert it like:

    Contig1 GO:0016301
    Contig2 GO:0016301
    Contig3 GO:0016301
    Contig4 GO:0003700 GO:0009651 GO:0006355
    Contig5 GO:0009556 GO:0005515 GO:0080019 GO:0016563 GO:0016627
    Contig6 GO:0003700 GO:0010018

    but i don't know how to write a script,could you write a script for me ? Thanks a lot
  • islandemiaj
    Junior Member
    • Jul 2012
    • 5

    #2
    If I were you, I would create a little script in Perl that read the file line by line. Do you create a hash table that for each first word of the file associate it to a new key of the hash. After that, the next string of the line becomes the hash table's content. For every line it's necessary to verificate if the key already exists, in this case you read the content of the hash that have this key and then use a string concatenation and then put this new string as your new content.

    Comment

    • islandemiaj
      Junior Member
      • Jul 2012
      • 5

      #3
      Here is a possible solution:

      # Converts blast2go results to Wego format

      # Read the lines from file
      $file1 = $ARGV[0];
      open(FILE1, $file1) or die $!;

      # Output file
      open (FILE, '>outputWego');

      # Hashtable declaration
      %hash1 = ();

      # Read line by line from file and insert it into the hashtable
      while(my $lines = <FILE1>){
      # Separate the columns
      @temp = split(' ', $lines);

      # Verify if exists element in the hash
      if(exists($hash1{$temp[0]})){
      # Do the concatenation
      $hash1{$temp[0]} = $hash1{$temp[0]}." ".$temp[1];

      # If don't have
      }else{
      # add into the hash (where the key is the element from the first column
      # and his value is the second element)
      $hash1{$temp[0]}=$temp[1];
      }
      }

      # Prints in the output file the hash values
      foreach $key (%hash1){
      print FILE "$hash1{$key}\n";
      }

      close(FILE1);
      exit(0);


      I dont't know how the Wego formatation works, so I do a sript that prints in the output file the exit without following the original order. In anycase, this is relatively easy to fix.

      And sorry about the indentation, because I can't edit very well here.
      Last edited by islandemiaj; 07-25-2012, 10:33 AM.

      Comment

      • letusgo
        Member
        • Aug 2011
        • 17

        #4
        Thanks a lot. I write a shorter script in perl just like:
        #/usr/bin/perl
        open o, ">Wego.out";
        open i, "blast2go.out";
        while (<i>) {
        chomp;
        ($name,$go)=split/\t/,$_;
        if ($name eq $name0) {
        print o "\t$go";
        }else{
        print o "\n$name\t$go";
        }
        $name0=$name;
        }

        Your script will be faster than mine if my blast2go.out file is very big.

        Comment

        • dseide
          Junior Member
          • Sep 2012
          • 1

          #5
          Hello there,


          I just wanted to announce that a new version of Blast2Go is out.
          In version 2.6.0 now it is possible to export annotation right away
          in the WEGO native format.

          Export -> Export Annotations -> Export Annotations in WEGO Format

          Feel free to contact me if results are incorrect!


          Best regards
          David Seide

          Comment

          • letusgo
            Member
            • Aug 2011
            • 17

            #6
            Thanks for your help. I used the blast2go for linux commend line version , Is it also fit for the wego format?

            Comment

            • hugh_hang
              Member
              • Jan 2013
              • 28

              #7
              Originally posted by dseide View Post
              Hello there,


              I just wanted to announce that a new version of Blast2Go is out.
              In version 2.6.0 now it is possible to export annotation right away
              in the WEGO native format.

              Export -> Export Annotations -> Export Annotations in WEGO Format

              Feel free to contact me if results are incorrect!


              Best regards
              David Seide
              The command is like this on my computer

              -> Export Annotations in WEGO Format(native)

              and it is not avaliable (I can't click it).
              What should I do?

              Comment

              • kmcarr
                Senior Member
                • May 2008
                • 1181

                #8
                Originally posted by hugh_hang View Post
                The command is like this on my computer

                -> Export Annotations in WEGO Format(native)

                and it is not avaliable (I can't click it).
                Apparently that feature is only available with a paid Blast2GO PRO subscription (720€ [~950 USD] per year, academic, single-user).

                What should I do?
                Use one of the scripts shown above.

                Comment

                • hugh_hang
                  Member
                  • Jan 2013
                  • 28

                  #9
                  Originally posted by kmcarr View Post
                  Apparently that feature is only available with a paid Blast2GO PRO subscription (720€ [~950 USD] per year, academic, single-user).



                  Use one of the scripts shown above.
                  well, I would like to write a script by myself.

                  Comment

                  Latest Articles

                  Collapse

                  • SEQadmin2
                    Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
                    by SEQadmin2



                    Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

                    Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
                    ...
                    10-14-2026, 09:55 AM
                  • SEQadmin2
                    New Genomics Technologies Take Aim at Long-Standing Limits
                    by SEQadmin2


                    Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

                    We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
                    ...
                    09-28-2026, 10:25 AM

                  ad_right_rmr

                  Collapse

                  News

                  Collapse

                  Topics Statistics Last Post
                  Started by SEQadmin2, 10-15-2026, 10:52 AM
                  0 responses
                  14 views
                  0 reactions
                  Last Post SEQadmin2  
                  Started by SEQadmin2, 10-14-2026, 05:39 AM
                  0 responses
                  21 views
                  0 reactions
                  Last Post SEQadmin2  
                  Started by SEQadmin2, 10-13-2026, 09:56 AM
                  0 responses
                  20 views
                  0 reactions
                  Last Post SEQadmin2  
                  Started by SEQadmin2, 10-09-2026, 11:14 AM
                  0 responses
                  27 views
                  0 reactions
                  Last Post SEQadmin2  
                  Working...