Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Lisa
    Member
    • Jan 2010
    • 10

    #1

    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
  • simonandrews
    Simon Andrews
    • May 2009
    • 870

    #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

    • Lisa
      Member
      • Jan 2010
      • 10

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

      Comment

      • maubp
        Peter (Biopython etc)
        • Jul 2009
        • 1544

        #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

        • Lisa
          Member
          • Jan 2010
          • 10

          #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

          • maubp
            Peter (Biopython etc)
            • Jul 2009
            • 1544

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

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