Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • pick up some unigene sequences based on a id set

    Hello,

    I am wondering if anyone would like to share some scripts to pick up sequences from fasta format dataset (Unigene) based on a group of id. Thanks a lot.


    Lisa

  • #2
    Rather than write scripts to do this I'd normally create a local database using the tools in EMBOSS (dbxfasta for a fasta database). Once you've indexed it then you can do batch retrieval of sequences really easily using the seqret program.

    If you'd rather handle this in a script then there are existing indexing schemes available in most languages. For Perl you could use a simple Fasta index via something like Bio::Index::Fasta or go the more formal route to create a Bio:: DB::Flat database

    Comment


    • #3
      Thanks a lot. That would definitely help!
      Lisa

      Comment


      • #4
        If you want to using scripting, for a Python option you might try Biopython's Bio.SeqIO.index() functionality which can be used on a FASTA file or many other formats. See:

        Comment


        • #5
          I downloaded a Unigene set fron NCBI, which is in fasta format as the following,

          >gnl|UG|Les#S50866699 Solanum lycopersicum cDNA, clone: LEFL1002BB12, HTC in leaf /gb=AK319185 /gi=225321
          324 /ug=Les.1 /len=3282
          CAACTCCCAATTC......

          I created a index with the following sample code ( eg, test1.pl) based the data set with the command as

          perl test1.pl myindex Les.seq.uniq

          # Complete code for making an index for several
          # fasta files ----------test1.pl
          use Bio::Index::Fasta;
          use strict;
          my $Index_File_Name = shift;
          my $inx = Bio::Index::Fasta->new(
          '-filename' => $Index_File_Name,
          '-write_flag' => 1);
          $inx->make_index(@ARGV);


          Then, I tried the following sample code ( test2.pl) to retrieve a sequence with the command as

          perl test2.pl myindex UG:Les#S50866699

          # Print out several sequences present in the index
          # in Fasta format --------test2.pl
          use Bio::Index::Fasta;
          use strict;
          my $Index_File_Name = shift;
          my $inx = Bio::Index::Fasta->new('-filename' => $Index_File_Name);
          my $out = Bio::SeqIO->new('-format' => 'Fasta','-fh' => *STDOUT);
          foreach my $id (@ARGV) {
          my $seq = $inx->fetch($id); # Returns Bio::Seq object
          $out->write_seq($seq);
          }

          Finally, I got this error message


          ------------- EXCEPTION -------------
          MSG: Did not provide a valid Bio::PrimarySeqI object
          STACK Bio::SeqIO::fasta::write_seq /usr/lib/perl5/site_perl/5.8.8/Bio/SeqIO/fasta.pm:178
          STACK toplevel retrieve_seq.pl:12
          -------------------------------------


          What is the wrong I made? Please help! Thanks a lot!

          Comment


          • #6
            I'd try asking on the BioPerl mailing list - they're a helpful bunch

            Comment

            Latest Articles

            Collapse

            • seqadmin
              Strategies for Sequencing Challenging Samples
              by seqadmin


              Despite advancements in sequencing platforms and related sample preparation technologies, certain sample types continue to present significant challenges that can compromise sequencing results. Pedro Echave, Senior Manager of the Global Business Segment at Revvity, explained that the success of a sequencing experiment ultimately depends on the amount and integrity of the nucleic acid template (RNA or DNA) obtained from a sample. “The better the quality of the nucleic acid isolated...
              03-22-2024, 06:39 AM
            • seqadmin
              Techniques and Challenges in Conservation Genomics
              by seqadmin



              The field of conservation genomics centers on applying genomics technologies in support of conservation efforts and the preservation of biodiversity. This article features interviews with two researchers who showcase their innovative work and highlight the current state and future of conservation genomics.

              Avian Conservation
              Matthew DeSaix, a recent doctoral graduate from Kristen Ruegg’s lab at The University of Colorado, shared that most of his research...
              03-08-2024, 10:41 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by seqadmin, Yesterday, 06:37 PM
            0 responses
            11 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, Yesterday, 06:07 PM
            0 responses
            10 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 03-22-2024, 10:03 AM
            0 responses
            51 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 03-21-2024, 07:32 AM
            0 responses
            68 views
            0 likes
            Last Post seqadmin  
            Working...
            X