Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^4: Reverse Complement

by stamp1982 (Novice)
on Jun 30, 2013 at 23:12 UTC ( #1041670=note: print w/replies, xml ) Need Help??

in reply to Re^3: Reverse Complement
in thread Reverse Complement

My apologies for being so slow. At the moment this is what I have.
perl -wMstrict -l GGGGaaaaaaCatttatatat atatataaattttt +ATtcccc die "Please enter two sequences as arguments on the command line\n" unless @ARGV == 2; my ($orig, $comp) = map { uc } @ARGV; die "Please enter only ATCG sequences\n" if grep { /[^ATCG]/ } $orig, +$comp; die "Sorry, the two sequences you have just entered are of different l +engths." . "\nPlease try again on the command line.\n" if length $orig != length $comp; # $comp will transform back to $orig iff it is the reverse complement $comp =~ y/ATCG/TAGC/; if ($orig eq reverse $comp) { print "Yes, the two sequences are reverse-complement of each other +.\n"; exit; } else { die "Unfortunately, the two sequences are not reverse-complement.\ +n"; }

comments I get are : unquoted strings may clash with future reserved words and compilation error and syntax error at wMstrict -l

Replies are listed 'Best First'.
Re^5: Reverse Complement
by AnomalousMonk (Chancellor) on Jun 30, 2013 at 23:54 UTC
    ... this is what I have. ...

    I'm guessing, but the only thing that occurs to me is that you actually have the line
        perl -wMstrict -l  GGGGaaaaaaCatttatatat  atatataaatttttATtcccc
    as the first non-blank line in your source code file. If so, this line should not be in the source code file. This line is intended as the command line invocation of the source code file. Please see previous examples.

    The source code file (which I have named in these examples) should have everything from the first
        die "Please enter two sequences as arguments on the command line\n"
             unless @ARGV == 2;
    statement to the very last  } closing curly brace on the final if-statement.

    If this is not the problem, please include exact copies of all warnings or error messages in future posts.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1041670]
and the questions are moot...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2018-06-18 10:23 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (109 votes). Check out past polls.