in reply to How to find any of many motifs?

Regarding BioPerl, I have not used it, but you may be able to get more information by reading the Tutorial -> Perl and Bioinformatics

If you still want to pursue developing your own script, you need to provide more information:

The goal is to post something self-contained that anyone of us can download and run.

Replies are listed 'Best First'.
Re^2: How to find any of many motifs?
by Nikulina (Novice) on Jun 17, 2010 at 16:20 UTC
    Thank you for your quick resonse Here are some samples:
    genes saved in sequence file look like this: >hg18_refGene_NM_006511 range=chr1:15857951-15860804 cctagtcacctgctaattaatctttttcctttcccctgtgttccatatagagaaaagtggtaaagaatct +acctcactgggaATGTCATCATTACCAACTTCAGATGGGTTTAACCATCC >hg18_refGene_NR_027268 range=chr1:28294033-28296656 tttttttttttcttcttcttttttgtggagttgctttttttttttttcttcttttttgtgtcattgtttt +tttaccatgtcctcagagtctggaattttacaaagtagttgctgagtaaacaggTAGATACAAATCAAG +ATGAACTTTTCCGCAGGAGCTCTTATCATGAACAT and the binding motifs: >mot1 tttgtagatttt >mot2 ggatcctttaag >mot3 gtttaccccaa
      Here are the actual sequnces I analyse: for GENES:
      >uc002yje.1 chr21:13973492-13976330 cccctgccccaccgcaccctggattactgcacgccaagaccctcacctga acgcgccctacactctggcatgggggaacccggccccgcagagccctgga CTCTGACATTGGAGGACTCCTCGGCTACGTCCTGGACTCCTGCACAAGAG >uc002yje.1 chr21:13973492-13976330 cccctgccccaccgcaccctggattactgcacgccaagaccctcacctga acgcgccctacactctggcatgggggaaaaaacccggccccgcagagccctgga CTCTGACATTGGAGGACTCCTCGGCTACGTCCTGGACTCCTGCACAAGAG >uc002yje.1 chr21:13973492-13976330 cccctgccccaccgcaccctggattactgcacgccaagaccctcacctga acgcgccctacactctggcatgggggaacccggccccgcagagggccctgga CTCTGACATTGGAGGACTCCTCGGCTACGTCCTGGACTCCTGCACAAGAG for motifs: >ucmotif_1 gccccac >ucmotif_2 gggggaaaaaacc >ucmotif_3 agagggccc here is the output: the distance is the following: 88 the distance is the following: 20 the distance is the following: 4
      So, now the program searches for the first element in the first gene and for the second in the second and so on. I wish that it could find any of motifs for each gene if they present in it and count the length between the motif an exon start point (starts with capital letters).
        I wish that it could find any of motifs for each gene

        So it seems you want to test all motifs against every gene.  In case the list of all motifs fits into working memory, you could read them into an array (once, at the beginning), and then iterate over it for every gene.  Roughly sketched:

        my @motifs; while (my $motif = <MOTIF>) { ... push @motifs, $motif; } while (my $seq = <FILE>) { ... for my $motif (@motifs) { if ( $seq =~ /$motif/ ) { ... } ... } }