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
              Essential Discoveries and Tools in Epitranscriptomics
              by seqadmin




              The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
              Yesterday, 07:01 AM
            • seqadmin
              Current Approaches to Protein Sequencing
              by seqadmin


              Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
              04-04-2024, 04:25 PM

            ad_right_rmr

            Collapse

            News

            Collapse

            Topics Statistics Last Post
            Started by seqadmin, 04-11-2024, 12:08 PM
            0 responses
            58 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 04-10-2024, 10:19 PM
            0 responses
            54 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 04-10-2024, 09:21 AM
            0 responses
            45 views
            0 likes
            Last Post seqadmin  
            Started by seqadmin, 04-04-2024, 09:00 AM
            0 responses
            55 views
            0 likes
            Last Post seqadmin  
            Working...
            X