The sequence file could be as large as 40Mb and the list could contain as many as 35000 sequences. I'm new to perl and have been struggling with this for a couple of days. Here's the part I wrote, but it doesn't give me the full list I want:(
my $nohit_list = "data.txt"; open (NOHIT, "<$nohit_list")or die "can't open file: $!"; foreach $line (<NOHIT>) { print $line; my $all = "all.txt"; open (ALL, "<$all") or die "can't open file: $!"; { local $/ = '>'; @fasta = <ALL>; } my $requery = "requery.txt"; open (FASTA, ">$requery")or die "can't open file: $!"; my @nohit_fasta = (); @nohit_fasta = grep /$line/,@fasta; print FASTA @nohit_fasta;

In reply to Re^2: compare a list from one file with another text file by sm2004
in thread compare a list from one file with another text file by sm2004

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.