I have the sequence DNA and I want to find nucleotide of the sequence at the position which was chosed by people. Below is the example:
Enter the sequence DNA: ACTAAAAATACAAAAATTAGCCAGGCGTGGTGGCAC (the length of sequence is 33) Enter the position: (12)
I hope the result is the position number 12 the nucleotides are AAA.
I have no problem finding the amino acid of the position. Below is the current code I have.
print "ENTER THE FILENAME OF THE DNA SEQUENCE:= ";
$DNAfilename = <STDIN>;
chomp $DNAfilename;
unless ( open(DNAFILE, $DNAfilename) ) {
print "Cannot open file \"$DNAfilename\"\n\n";
}
@DNA = <DNAFILE>;
close DNAFILE;
$DNA = join( '', @DNA);
print " \nThe original DNA file is:\n$DNA \n";
$DNA =~ s/\s//g;
print" enter the number ";
$po=<STDIN>;
@pos=$DNA;
if ($po>length($DNA))
{
print" no data";
}
else
{
print " @pos\n\n";
}
Please advice how can I find the position at the DNA sequence.