Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • help needed to retrieve fasta reads from fasta db

    Hi There,

    I am quite new to Linux and Bioperl. I have used blast to find alignments. I need to store the complete query sequence of all hit reads to a seperate file (not just hit sequence). I tried regular expressions..may be i am not using the right match string..I also tried fastacmd command..

    So far no luck in extracting few reads from fasta file.

    Please help me!

    Thanks in advance..

    -Prashanth

  • #2
    found this

    Found code here to retrieve fasta for specific accessions: http://biostar.stackexchange.com/que...3gb-fasta-file

    use strict;
    use Bio:B::Fasta;

    my $database;
    my $fasta_library;
    my %records;
    open IDFILE, "NBS_LRR_IDs.txt" or die $!;
    open OUTPUT, ">NC_003070_NBS-LRR.faa" or die $!;
    # name of the library file - (here it is hardcoded)
    $fasta_library = 'NC_003070_all_chr.faa';

    # creates the database of the library, based on the file
    $database = Bio:B::Fasta->new("$fasta_library") or die "Failed to creat Fasta DP object on fasta library\n";


    # now, it parses the file with the fasta headers you want to get
    while (<IDFILE>) {



    my ($id) = (/^>*(\S+)/); # capture the id string (without the initial ">")
    my $header = $database->header($id);
    #print "$header\n";
    print ">$header\n", $database->seq( $id ), "\n";
    print OUTPUT ">$header\n", $database->seq( $id ), "\n";
    }

    exit;

    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
    10 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, Yesterday, 06:07 PM
    0 responses
    9 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 03-22-2024, 10:03 AM
    0 responses
    50 views
    0 likes
    Last Post seqadmin  
    Started by seqadmin, 03-21-2024, 07:32 AM
    0 responses
    67 views
    0 likes
    Last Post seqadmin  
    Working...
    X