Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #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


    • #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


      • #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


        • #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


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

            Comment


            • #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


              • #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


                • #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

                  • seqadmin
                    Essential Discoveries and Tools in Epitranscriptomics
                    by seqadmin




                    The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
                    04-22-2024, 07:01 AM
                  • seqadmin
                    Current Approaches to Protein Sequencing
                    by seqadmin


                    Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
                    04-04-2024, 04:25 PM

                  ad_right_rmr

                  Collapse

                  News

                  Collapse

                  Topics Statistics Last Post
                  Started by seqadmin, Today, 08:47 AM
                  0 responses
                  12 views
                  0 likes
                  Last Post seqadmin  
                  Started by seqadmin, 04-11-2024, 12:08 PM
                  0 responses
                  60 views
                  0 likes
                  Last Post seqadmin  
                  Started by seqadmin, 04-10-2024, 10:19 PM
                  0 responses
                  59 views
                  0 likes
                  Last Post seqadmin  
                  Started by seqadmin, 04-10-2024, 09:21 AM
                  0 responses
                  54 views
                  0 likes
                  Last Post seqadmin  
                  Working...
                  X