I have two files: File 1: contain many FASTA sequences >84C2_Locus_14_Transcript_1/3_Confidence_0.571_Length_1244 AAACTAGTCAATAGAGAAAATCCAAAGTGGATGAAATTGAAGTGATTGTATGGCACAAGT...so on

>84C2_Locus_14_Transcript_2/3_Confidence_0.857_Length_1961 AAACTAGTCAATAGAGAAAATCCAAAGTGGATGAAATTGAAGTGATTGTATGGCACAAGT...so on

>84C2_Locus_15_Transcript_1/9_Confidence_0.190_Length_757 ATTTGCTCGGAAAAACACTTCTCGTGGAACTTGTTAGCGCTGAGCTTGATCCCAAGACGA.....so on

>84C2_Locus_15_Transcript_5/9_Confidence_0.333_Length_1841 ATTTGCTCGGAAAAACACTTCTCGTGGAACTTGTTAGCGCTGAGCTTGATCCCAAGACGA....so on

File2: only the sequence headers so many

84C2_Locus_14_Transcript_1/3_Confidence_0.571_Length_1244 84C2_Locus_14_Transcript_2/3_Confidence_0.857_Length_1961 84C2_Locus_14_Transcript_3/3_Confidence_0.571_Length_1248 84C2_Locus_15_Transcript_1/9_Confidence_0.190_Length_757 ........ many more

my output file should be contain the sequence associated with header. i.e. matching the sequence header file (file2) header portion with original fasta sequence file (file1) and those headers match the fasta sequence header in file 1 only those sequences store in another output file containing header with sequence.Just like this: Original output file should like this:

>84C2_Locus_15_Transcript_5/9_Confidence_0.333_Length_1841 ATTTGCTCGGAAAAACACTTCTCGTGGAACTTGTTAGCGCTGAGCTTGATCCCAAGACGA......so on

Please suggest me the way in perl which is applicable for my problem.


In reply to EXTRACT FASTA SEQUENCE FROM ORIGINAL FASTA FILE DEPENDING ON ANOTHER SEQUENCE HEDAER FILE by rameshchand123

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.