Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Perl
Perl Misc
Subroutine on Mutation of Codons
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="xhoster, post: 4859547"] There is a nearly infinite number of ways one could edit code that would introduce errors. If you don't show us the errors, and don't show us the edited code, it makes it rather difficult to help you. Are you using "use strict" and "use warnings"? Where is $origDNASeq coming from? Since @nucleotides doesn't seem to be used anywhere, you could just capture the number of characters in $origDNASeq directly without creating an intermediate variable by doing: my $nuc = length $origDNASeq; opening a file to a "handle" which is a variable that has some arbitrary data in it is not a good idea. And under "use strict", which is a very good idea, it will fail. Maybe that is one of the errors you refer to? You should also check to see if open succeeded. open (my $seq_handle, "<", $nucFile) or die $!; $nucFile contains the *name* of the file. It does not have a file handle in it, which is what you try to read from. And what is going on with $origDNASeq? First you assume it starts out set to something, we know not what. Then you try to make it a filehandle, now you try to make it the line of text read from a file. Don't re-use variables willy-nilly. This will only operate on the first codon of each line of the file. Maybe that is what you want, but it seems odd to me. Also, the entire line will be in $1; and the first three individual bases will be in $2, $3, and $4. Drop the outermost capturing parenthesis. And once you do there is not point in having the trailing .* if ($origDNASeq =~ m/^(.)(.)(.)/) This will copy all of $newDNASeq each time. If $newDNASeq gets quite large, this will be slow. It would be faster (but not change the end result) to tell Perl to append directly to the end of it. $newDNASeq .= $1 . $2 . randNuc($nuc); Xho -- -------------------- [URL]http://NewsReader.Com/[/URL] -------------------- The costs of publication of this article were defrayed in part by the payment of page charges. This article must therefore be hereby marked advertisement in accordance with 18 U.S.C. Section 1734 solely to indicate this fact. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Perl
Perl Misc
Subroutine on Mutation of Codons
Top