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
                    Beyond CRISPR/Cas9: Understand, Choose, and Use the Right Genome Editing Tool
                    by SEQadmin2



                    CRISPR/Cas9 sparked the gene editing revolution for both research and therapeutics.1 But this system still showed severe issues that limited its applications. The most prominent were the heavy reliance on PAM sequences, delivery limitations, double-stranded breaks that prompt unintended edits and cell death, and editing inefficiency (both in targeting and in knock-in reliability).

                    Despite this, “CRISPR helped turn genome editing from a specialized technique into
                    ...
                    07-31-2026, 11:01 AM
                  • SEQadmin2
                    Proteomic Platforms: How to Choose the Right Analytical Strategy to Improve Detection and Clinical Applications
                    by SEQadmin2


                    Proteomics platforms are evolving rapidly, with advances in mass spectrometry and affinity-based approaches expanding what researchers can detect and at what scale. As the field moves toward deeper proteome coverage and clinical applications, scientists face an increasingly complex landscape of tools. This article will explore how researchers are navigating these choices to find the right platform for their work.

                    The systematic characterization of the human proteome has
                    ...
                    07-20-2026, 11:48 AM

                  ad_right_rmr

                  Collapse

                  News

                  Collapse

                  Topics Statistics Last Post
                  Started by SEQadmin2, 08-06-2026, 07:41 AM
                  0 responses
                  17 views
                  0 reactions
                  Last Post SEQadmin2  
                  Started by SEQadmin2, 08-03-2026, 10:13 AM
                  0 responses
                  33 views
                  0 reactions
                  Last Post SEQadmin2  
                  Started by SEQadmin2, 07-31-2026, 02:55 AM
                  0 responses
                  43 views
                  0 reactions
                  Last Post SEQadmin2  
                  Started by SEQadmin2, 07-24-2026, 12:17 PM
                  0 responses
                  26 views
                  0 reactions
                  Last Post SEQadmin2  
                  Working...