Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Bueller_007
    Member
    • May 2010
    • 16

    #1

    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!
  • tboothby
    Member
    • May 2011
    • 56

    #2
    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).

    Comment

    • Bueller_007
      Member
      • May 2010
      • 16

      #3
      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.

      Comment

      • tboothby
        Member
        • May 2011
        • 56

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

        What format are your blast output files in?

        Comment

        • Bueller_007
          Member
          • May 2010
          • 16

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

          Comment

          • tboothby
            Member
            • May 2011
            • 56

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

            Comment

            • Bueller_007
              Member
              • May 2010
              • 16

              #7
              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).

              Comment

              • DZhang
                Senior Member
                • Jun 2010
                • 177

                #8
                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).

                Comment

                • Bueller_007
                  Member
                  • May 2010
                  • 16

                  #9
                  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.

                  Comment

                  • nr23
                    Member
                    • Oct 2012
                    • 42

                    #10
                    Did you manage to write that script Bueller? I'm mid way through doing something similar and would appreciate any perl tips...

                    Comment

                    • Bueller_007
                      Member
                      • May 2010
                      • 16

                      #11
                      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.

                      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, Yesterday, 11:13 AM
                      0 responses
                      19 views
                      0 reactions
                      Last Post SEQadmin2  
                      Started by SEQadmin2, Yesterday, 10:48 AM
                      0 responses
                      18 views
                      0 reactions
                      Last Post SEQadmin2  
                      Started by SEQadmin2, 10-15-2026, 10:52 AM
                      0 responses
                      36 views
                      0 reactions
                      Last Post SEQadmin2  
                      Started by SEQadmin2, 10-14-2026, 05:39 AM
                      0 responses
                      42 views
                      0 reactions
                      Last Post SEQadmin2  
                      Working...