Perl Monk, Perl Meditation | |
PerlMonks |
Re: Identifying Overlapping Matches in Nucleotide Sequenceby thanos1983 (Parson) |
on Oct 27, 2017 at 08:11 UTC ( [id://1202127]=note: print w/replies, xml ) | Need Help?? |
Hello FIJI42, I am not a biologist or bioinformatics engineer but I will try to tackle your question based on simple logic. I am a bit confused as why the nucleoside sequence should be 6? If you want to count the number of occurrences of a string as 'AA' then the correct answer is 5. For example AAGAATGCCAGTTTGTAAGTACTGACTTTGGAAAA is equal to 5. In case you want to count the number of occurrences of sets of characters (which means individual sets even apart from each other not in a sequence) then yes the number of occurrences is 6. If this is the case you are trying to resolve then you can simply count the number of occurrences and divide by 2 (which is the number of sets/pairs) that you are interested. But because when you divide by odd number then you will have a remainder. In this case you can use modulo e.g. Modulo operation to return quotient and remainder. Sample of code:
Hope this helps, BR.
Seeking for Perl wisdom...on the process of learning...not there...yet!
In Section
Seekers of Perl Wisdom
|
|