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
              The Factors Reshaping Genome Assembly
              by SEQadmin2



              When the Human Genome Project declared the human genome finished in 2003, portions of the sequence were still missing, including many of its most repetitive and structurally complex regions.1 Still, for the next two decades, researchers analyzed their sequencing data against the single linear reference that came out of this effort. Released in 2013 as GRCh38, that reference has powered countless discoveries, but it has gaps and cannot capture the genetic diversity of the world’s...
              Today, 07:04 AM
            • SEQadmin2
              16S/ITS Profiling vs. Shotgun Metagenomics: What Changes in Your Workflow?
              by SEQadmin2





              NGS has revolutionized clinical microbiology by offering new ways to identify and surveil pathogens without prior knowledge of the target. One popular approach is 16S rRNA and ITS amplicon sequencing, which targets specific microbial markers. But studies are increasingly incorporating shotgun metagenomics, a technique that sequences all DNA from a sample without targeting specific microbial markers. This approach allows more detailed taxonomic classification,...
              10-30-2026, 06:46 AM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by SEQadmin2, Yesterday, 11:11 AM
            0 responses
            14 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 11-17-2026, 06:27 AM
            0 responses
            39 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 11-12-2026, 07:59 AM
            0 responses
            55 views
            0 reactions
            Last Post SEQadmin2  
            Started by SEQadmin2, 11-05-2026, 09:25 AM
            0 responses
            61 views
            0 reactions
            Last Post SEQadmin2  
            Working...