in reply to Re: Perl code for reverse complement of DNA sequence
in thread Perl code for reverse complement of DNA sequence

My understanding, feeble as it is, of the FASTA file format is that the base sequence portion of a FASTA record in such a file is of indeterminate length and can be multi-line, e.g., something like:

... >4c2a958... TCCCCACGCTTTCGCGCTTC... TAGTAGTAGTAGTAG... ... >0639b5b... ...

I think it should be noted that your solution++ reverse-complements the DNA sequence on a line-by-line basis, so the entire DNA sequence of a FASTA record (possibly many lines of varying length) will not, as I understand it, be correctly processed.


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^3: Perl code for reverse complement of DNA sequence
by kcott (Archbishop) on Apr 27, 2021 at 23:51 UTC

    The DNA sequences could be spread over multiple lines; however, the OP sample data only showed single lines. My code dealt with the sample data that was presented.

    Records could start with a semicolon. The OP sample data did not show any such records, so I made no attempt to process that either.

    There could be errors in the input — for instance, illegally embedded blank lines or letters that didn't represent a nucleotide — which I made no attempt to validate.

    I made it clear that the solution I presented was "code something like this". It provides the basic elements of what is required based on what was asked. If there are additional, or different, requirements which the OP cannot code, that should form a follow-up question.

    — Ken