Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jstrohm
    Member
    • Aug 2014
    • 14

    #1

    Coverting QIIME formatted reference database to be used with BLAST

    Hi there,

    I have a custom database of fungal reference sequences formatted to be used with the RDP classifier in QIIME.

    I would like to be able to merge them into a larger BLAST database for local use.

    This involves merging the FASTA file and the taxonomy map (after that I've got it under control).

    Any idea how to do this? I was hoping RDP had some options but it doesn't seem that way...

    Thanks!
  • WhatsOEver
    Senior Member
    • Apr 2012
    • 215

    #2
    It depends how you want to merge your files. Do you just want to concatenate them? For this you could simply use "cat" under Linux.

    Comment

    • jstrohm
      Member
      • Aug 2014
      • 14

      #3
      Thanks, I thought about cat but they need to be merged in a more complicated way i.e.

      In the FASTA file there is the sequence and it is accompanied with a header that links it with an entry in the taxonomy map.

      Sequence file:

      >AB015711
      GTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAAGTATACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATAGTTTATTTGATAGTGCCTTACTACTTGGATAACC...

      Links with taxonomy file:

      AB015711 Fungi;Glomeromycota;Archaeosporomycetes;Archaeosporales;Ambisporaceae;Ambispora_leptoticha

      So... I need to replace the headers in the FASTA file with the entries in the taxonomy file.

      Comment

      • WhatsOEver
        Senior Member
        • Apr 2012
        • 215

        #4
        Originally posted by jstrohm View Post
        Thanks, I thought about cat but they need to be merged in a more complicated way i.e.

        In the FASTA file there is the sequence and it is accompanied with a header that links it with an entry in the taxonomy map.

        Sequence file:

        >AB015711
        GTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAAGTATACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATAGTTTATTTGATAGTGCCTTACTACTTGGATAACC...

        Links with taxonomy file:

        AB015711 Fungi;Glomeromycota;Archaeosporomycetes;Archaeosporales;Ambisporaceae;Ambispora_leptoticha

        So... I need to replace the headers in the FASTA file with the entries in the taxonomy file.
        So, in your example you want to end up with

        >AB015711 Fungi;Glomeromycota;Archaeosporomycetes;Archaeosporales;Ambisporaceae;Ambispora_leptoticha
        GTAGTCATATGCTTGTCTCAAAGATTAAGCCATGCATGTCTAAGTATAAGCAAGTATACTGTGAAACTGCGAATGGCTCATTAAATCAGTTATAGTTTATTTGATAGTGCCTTACTACTTGGATAACC..

        In this case you have to be careful as blast will probably truncate your header at the first space leaving you with the same information as you have had before. I would rather suggest to use an abbreviation of the species name - something like
        >AB015711_Amlep
        You probably have to replace the IDs in your taxonomic afterwards, too, but it will be the same work as before.

        Concerning your original question:
        I have a small java prog which is doing almost exactly what you want. It would just take minutes to modify it to your needs (you would have to give me an example of your exact output before, of course). However, I'm currently on a conference at will not be able to send it before Tuesday.

        So, if noone has a faster solution, just give me a quick reminder

        Comment

        • asperjelly
          Member
          • Jan 2013
          • 11

          #5
          If you just need/want to change the fasta headers, then you can do something like this which involves making a two column tab delimited 'annotation' file - which is actually probably the format of your taxonomy file. This is essentially a find and replace for fasta headers, I've modified the perl script from this thread: http://stackoverflow.com/questions/1...h-another-name . You will just need to have BioPerl installed.

          Code:
          #!/usr/bin/perl -w
          =usage 
          
          reformat_fasta_headers.pl -f fasta_file -a annotation file (2 columns tab delimited: find col 1 and replace with col2)
          
          =cut
          
          use strict;
          use warnings;
          use Bio::SeqIO;
          use Getopt::Long;
          
          #set command line arguments
          my ($fasta, $annot) = @ARGV;
          my $version="reformat_fasta_headers.pl\tv0.0.1";
          GetOptions(
          	'f|fasta:s'=>\$fasta,
          	'a|annot:s'=>\$annot,
          	'v|version'=>sub{print $version."\n"; exit;},
          );
          
          
          open my $fh, '<', $annot or die $!;
          my %annot = map { /(\S+)\s+(.+)/; $1 => $2 } <$fh>;
          close $fh;
          
          my $in = Bio::SeqIO->new( -file => $fasta, -format => 'Fasta' );
          
          while ( my $seq = $in->next_seq() ) {
              my $seqID = $annot{ $seq->id } // $seq->id;
              print ">$seqID\n" . $seq->seq . "\n";
          }
          I have a question for you jstrohm - how did you manage to create the custom fungal ITS database with the correct taxonomy information? I have a similar problem working on now, where we have several thousand ITS sequences from various projects and would like to get them into a format to be used with either QIIME or RDP or UTAX (usearch8).

          Comment

          • jstrohm
            Member
            • Aug 2014
            • 14

            #6
            Thanks for the script! I'll give it a shot. I have a feeling that even when I merge the two, BLAST won't like the header formats anyway...

            I'm afraid the answer I have for your question isn't helpful. I was given a QIIME formatted version of the marjaam database, so I didn't have to create my own taxonomy file. http://maarjam.botany.ut.ee/

            I have actually been generating my own "libraries" for mapping reads to taxonomy assigned OTUs in usearch8.

            Briefly, I assign IDs to my OTUs using SILVA/SINA or BLAST/ UNITE. Then I use MEGAN 5 to pick the "most correct" IDs.

            From MEGAN 5 I choose "Export -> DSV -> read names, taxon paths.

            Then with some fiddling in Excel, I add the taxonomy paths to the headers in my OTU fasta file
            Last edited by jstrohm; 11-09-2014, 08:23 AM.

            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
            17 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...