[BiO BB] A question about the perl code
dmb at mrc-dunn.cam.ac.uk
Tue Aug 16 13:29:56 EDT 2005
On Tue, 16 Aug 2005, Alex Zhang wrote:
>I made a group A which includes 16 combinations of any
>two nucleotides like: AA,AC,AG,AT,
>If I randomly got a pair like AC, I want to exclude
>AC, AT, AG, AA, TC, CC, GC. In other words, I want to
>exclude the pairs in group A which has the same
>nucleotide with the pair randomly selected. Can
>anybody suggest me how to approach this using Perl?
If you have time try reading the chapter on sets in 'Mastering Algorithms
in Perl' (the wolf book). That should get you started.
If you are in a rush, use a regular expression matched over a list of your
pairs (for example with the perl grep function). Use your first random
choice to initalize a variable in the regexp pattern.
>Do You Yahoo!?
>Tired of spam? Yahoo! Mail has the best spam protection around
>Bioinformatics.Org general forum - BiO_Bulletin_Board at bioinformatics.org
More information about the BBB