Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004

    Smile Unanswered: counting simple repeat in a sequence

    Hi all,
    I have a problem that I have a dna sequence and i want to count the number of times a particular pattern appears in the entire sequence(for ex. how many times the triplet ATT or ATG appears in the dna sequence ). I wrote a programme it finds only the pattern and i also want to get count of the pattern. Can anyone there help me i am giving the programme below.

    #searching for motifs

    #Ask the user for the file name
    print "Please enter the file name of the dna sequence data \n";
    $dna_filename= <STDIN>;
    print "For this program to run, the sequence file to be processed must be in the\n";
    print "current working directory. Ie. in:\n";
    system pwd;
    print "\n";

    #remive filename from dna file
    chomp $dna_filename;

    #open the file or exit
    unless (open(DNAFILE,"$dna_filename")){
    print "cannot open file \"$dna_filename\"\n\n";
    #read the protein sequence data from the file and store it into
    #an array variable @dna
    @dna = <DNAFILE>;

    #close the file we've read dna into @dna
    close DNAFILE;
    $dna = join('',@dna);
    $dna =~ s/\s//g;
    do {
    print "Enter a motif to search for:";
    $motif = <STDIN>;
    chomp $motif;
    if ( $dna =~ /$motif/i ){
    print "I found it:\n\n";
    print "I couldn\'t find it\n\n";
    }until ( $motif =~/^\s*$/ );

  2. #2
    Join Date
    May 2003
    Is the data stored in a DB2 table (DB2 is an IBM DBMS product)? If not, you are in the wrong forum. If the data is stored in DB2, please show the table DDL.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts