Monday, July 20, 2009

perl problem 9 (HARD)

Make a program that reads a list of strings from a file, one string per line, and then lets the user interactively enter patterns that may match some of the strings. For each pattern, the program should tell how many strings from the file matched, then which ones those were. Don't re-read the file for each new pattern; keep the strings in memory. The filename may be hard-coded in the file. If a pattern is invalid (for example, if it has unmatched parentheses), the program should simply report that error and let the user continue trying patterns. When the user enters a blank line instead of a pattern, the program should quit.


Teja

1 comment:

  1. Hi teja
    I have a problem might be simple for you.
    A1 A2 1 2 3 4
    A T AA AT TT NN
    A G AG AG AA AG
    T C TT TC TC TC
    G A GA GG GA GA

    Where A1 is allele1, A2 is allele2 and 1,2,3,4 are sublects
    total 1700 subject (column) and 18000 rows for SNPs
    Now problem is to asign genotype in numarical value for statistical purpose.
    if A1 is A and A2 is T then in same row AA=2, AT= 3 and TT=4 and NN=0
    if A1 is T and A2 is C then in same row TT=2, TC=3 and CC=4 and so on......
    Can you wright me a script to convert/ replace this.
    At the moment i am using strawberry perl and I am new in this field
    thanks
    best

    ReplyDelete