Part 4: Using Coordinates to Extract DNA (1)
Now we will need to extract the dna sequences that do NOT need to be reverse complemented. DNA sequences that need to be complemented have the word “Complement” in their coordinates, so an algorithm to do this would be:
- search through the coordinates we have
- if the coordinate does NOT have the word “Complement”, return the DNA sequence corresponding to that coordinate.
To do this we'll need to create a simple perl subroutine to help us. Insert a new rule called “To write simple Perl code to convert data.”
Name the rule something like “Non-Reversed Genes”. Click on the grey-highlighted word “user rule” and replace the code inside with the following:
sub { # Do not name your subroutine to avoid name conflicts.
my ($tag, $gene) = @_;
return ($gene) if defined($tag) && !($tag =~ /complement/);
return;
}
If you don't know perl and want to know what it means, please refer to a Perl manual or tutorial to help you with it.
Set input1 to be Coordinates Line and input2 to be Extracted Genes. You should now have a list dna sequences that need not be reversed. Your end result should look like the following:
Click to view larger image
|