[BiO BB] A question about the perl code

Dan Bolser dmb at mrc-dunn.cam.ac.uk
Tue Aug 16 13:29:56 EDT 2005


On Tue, 16 Aug 2005, Alex Zhang wrote:

>Dear All,
>
>I made a group A which includes 16 combinations of any
>two nucleotides like: AA,AC,AG,AT,
>CA,CC,CG,CT,
>GA,GC,GG,GT,
>TA,TC,TG,TT          
>
>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.

Dan.

>
>Thanks!
>   Alex
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>_______________________________________________
>Bioinformatics.Org general forum  -  BiO_Bulletin_Board at bioinformatics.org
>https://bioinformatics.org/mailman/listinfo/bio_bulletin_board
>




More information about the BBB mailing list