Hi Guys,
I have a large text file that is has a bunch of records. Each record starts with a header line that starts with the ">" character. Then there are several lines under that line that contain sequences of letters.
For example, a file might look like:
>TEXT ID=2L TEXT
ABCDEDKGFKGJDJED
ALDKDKKFJFJGF
>TEXT ID=3R TEXT
FGDFGKDFSKDSLD
FGFDGDSFFDG
FDGF
I can send you the actual file if you would like to see it. All I want is a PERL script that inputs a file in the following format:
ID:START-STOP SEQUENCE
Where ID is an identifier for the record (in the above record 1 has identifier of 2L and record 2 has identifier of 3R and start and stop are first and last positions of a subsequence in the record. Then there is a space and a SEQUENCE.
I want the script to use the ranges to pull out the subsequence from the big record text file and then see if it matches the SEQUENCE in the input. The big record file is large so you can't load the whole file into memory, you need to stream it.
The output would be the subsequence from the record and a space and a YES or NO for where it matches.
Thanks
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|