SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
What is reciprocal best hit? Dinesh Bioinformatics 1 02-08-2011 03:51 AM
blast hit problem NicoBxl Bioinformatics 2 10-02-2010 06:55 PM
Reciprocal Blast With Multiple Contigs Per Gene jwhittall Bioinformatics 0 07-21-2010 01:20 PM
Need Help Regarding Reciprocal best hit in BLAST Bharat Bioinformatics 1 03-11-2010 03:04 AM
blast of the contigs dina Bioinformatics 5 11-02-2009 09:44 AM

Reply
 
Thread Tools
Old 08-02-2011, 07:48 AM   #1
Bueller_007
Member
 
Location: Earth

Join Date: May 2010
Posts: 16
Default Annotate contigs with BLAST hit names; remove contigs with no hit

Hi. I'm wondering if anyone knows a tool I can use to annotate contigs with BLAST hit names (and remove contigs that don't have BLAST hits).

I have an input .fa file containing the contigs and an output .xml file from blastx.

For smaller input files, I've been using the GUI version of BLAST2GO, but it can't really handle more than 20,000 BLAST hits at once and my newest fasta file contains many hundreds of thousands of contigs.

I could write my own bioperl script, but I wouldn't trust that it would work under all circumstances. Is there anything out there?


Thanks!
Bueller_007 is offline   Reply With Quote
Old 08-02-2011, 08:42 AM   #2
tboothby
Member
 
Location: DC

Join Date: May 2011
Posts: 56
Default

For B2G are you using a local database?

I run have been doing some annotation with B2G using a local database I setup and it works pretty well. I generate input blast.xml files using Stand Alone Blast first. Then run that through B2Gpipe.

The BLASTing is the part that takes the longest, the actual annotation goes very quickly (around a day for ~60k sequences).
tboothby is offline   Reply With Quote
Old 08-02-2011, 08:47 AM   #3
Bueller_007
Member
 
Location: Earth

Join Date: May 2010
Posts: 16
Default

Yes, I have a local database. But I don't want to annotate with GO info yet. I only want to sort out contigs that do and do not have blastx hits.
Bueller_007 is offline   Reply With Quote
Old 08-02-2011, 09:41 AM   #4
tboothby
Member
 
Location: DC

Join Date: May 2011
Posts: 56
Default

This should be pretty simple to do using a unix script (maybe even a one liner).

What format are your blast output files in?
tboothby is offline   Reply With Quote
Old 08-02-2011, 09:46 AM   #5
Bueller_007
Member
 
Location: Earth

Join Date: May 2010
Posts: 16
Default

Quote:
Originally Posted by tboothby View Post
This should be pretty simple to do using a unix script (maybe even a one liner).

What format are your blast output files in?
XML format generated with
Code:
>blastx -db caniformia_refseq_protein  -query mergedtrinity.fa -out blast_records.xml -evalue 1e-5 -outfmt 5 -show_gis -num_alignments 1 -num_descriptions 1 -num_threads 32
Bueller_007 is offline   Reply With Quote
Old 08-02-2011, 10:21 AM   #6
tboothby
Member
 
Location: DC

Join Date: May 2011
Posts: 56
Default

To find blast queries WITHOUT hits, try something like grep? The -A option selects lines above your search term, while -B selects lines after the search term. You will have to look at your xml file and count the number of lines above and below the 'No hits found' line and input them into the command line below.

grep -A -B 'No hits found' /path/to/your/file > /path/to/output/file

If you want to get all the blast results that DID have hits try the command below (the -v selects the inverse of your search pattern and options):

grep -v -A -B 'No hits found' /path/to/your/file > /path/to/output/file
tboothby is offline   Reply With Quote
Old 08-02-2011, 10:27 AM   #7
Bueller_007
Member
 
Location: Earth

Join Date: May 2010
Posts: 16
Default

Yes, thanks. I can do this quite easily with grep. But as I said, what I wish to do is annotate (i.e., rename contigs) with BLAST hits and put them in one file, then remove contigs that lack BLAST hits (i.e., place them in another file).
Bueller_007 is offline   Reply With Quote
Old 08-02-2011, 01:14 PM   #8
DZhang
Senior Member
 
Location: East Coast, US

Join Date: Jun 2010
Posts: 177
Default

Bueller_007,

In addition to tboothby's suggestion, which looks simple enough, a more complex way is to convert your xml file into a tab-based format. Then you can open it in excel and you will see the results right away - the contigs with no hits will only have the first column (contig ID).
DZhang is offline   Reply With Quote
Old 08-02-2011, 01:19 PM   #9
Bueller_007
Member
 
Location: Earth

Join Date: May 2010
Posts: 16
Default

Thanks, but as I've explained, this does not at all accomplish what I'm trying to do. (And the number of rows would overwhelm Excel in any case.)

I'll just write a bioperl script.
Bueller_007 is offline   Reply With Quote
Old 02-27-2013, 09:57 AM   #10
nr23
Member
 
Location: Ireland

Join Date: Oct 2012
Posts: 42
Default

Did you manage to write that script Bueller? I'm mid way through doing something similar and would appreciate any perl tips...
nr23 is offline   Reply With Quote
Old 02-27-2013, 10:22 AM   #11
Bueller_007
Member
 
Location: Earth

Join Date: May 2010
Posts: 16
Default

Quote:
Originally Posted by nr23 View Post
Did you manage to write that script Bueller? I'm mid way through doing something similar and would appreciate any perl tips...
I don't remember... That effort has been lost to the sands of time. But in the end I think I just switched to the command-line version of Blast2GO and that mostly did what I was looking for.
Bueller_007 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 12:08 AM.


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