SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
Fishers Exact test blast2go detq182 Bioinformatics 0 02-29-2012 02:57 PM
Processing Blast output for Blast2GO JueFish Bioinformatics 3 10-29-2011 06:37 AM
GO-slim Problem When Run Blast2GO, Help. byou678 Bioinformatics 0 09-01-2011 01:32 PM
Need ideas about the advantages of Blast2Go byou678 Bioinformatics 5 08-27-2011 10:47 AM
Analyse short reads using blast2go rururara Bioinformatics 1 04-12-2011 03:19 AM

Reply
 
Thread Tools
Old 05-19-2012, 07:07 PM   #1
letusgo
Member
 
Location: china

Join Date: Aug 2011
Posts: 17
Default 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
letusgo is offline   Reply With Quote
Old 07-24-2012, 12:37 PM   #2
islandemiaj
Junior Member
 
Location: São Paulo

Join Date: Jul 2012
Posts: 5
Default

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.
islandemiaj is offline   Reply With Quote
Old 07-25-2012, 10:17 AM   #3
islandemiaj
Junior Member
 
Location: São Paulo

Join Date: Jul 2012
Posts: 5
Default

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 at 10:33 AM.
islandemiaj is offline   Reply With Quote
Old 08-02-2012, 11:16 PM   #4
letusgo
Member
 
Location: china

Join Date: Aug 2011
Posts: 17
Default

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.
letusgo is offline   Reply With Quote
Old 09-04-2012, 12:55 AM   #5
dseide
Junior Member
 
Location: Valencia

Join Date: Sep 2012
Posts: 1
Default

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
dseide is offline   Reply With Quote
Old 09-04-2012, 04:44 AM   #6
letusgo
Member
 
Location: china

Join Date: Aug 2011
Posts: 17
Default

Thanks for your help. I used the blast2go for linux commend line version , Is it also fit for the wego format?
letusgo is offline   Reply With Quote
Old 01-07-2013, 02:53 AM   #7
hugh_hang
Member
 
Location: Hangzhou, China

Join Date: Jan 2013
Posts: 28
Question

Quote:
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?
hugh_hang is offline   Reply With Quote
Old 01-07-2013, 06:08 AM   #8
kmcarr
Senior Member
 
Location: USA, Midwest

Join Date: May 2008
Posts: 1,169
Default

Quote:
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).

Quote:
What should I do?
Use one of the scripts shown above.
kmcarr is offline   Reply With Quote
Old 01-07-2013, 07:46 PM   #9
hugh_hang
Member
 
Location: Hangzhou, China

Join Date: Jan 2013
Posts: 28
Default

Quote:
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.
hugh_hang is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 03:15 PM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO