Exemplo n.º 1
0
def main():

    # Parse command line arguments
    options, args = doc_optparse.parse( __doc__ )

    try:
        lnorm = bool( options.lnorm )
        recalculate = bool( options.recalculate )
    except:
        doc_optparse.exit()

    hox70 = score.build_scoring_scheme( """  A    C    G    T
                                      91 -114  -31 -123
                                    -114  100 -125  -31
                                     -31 -125  100 -114
                                    -123  -31 -114   91 """, 400, 30, default=0 )

    maf_reader = maf.Reader( sys.stdin )

    for m in maf_reader: 
        if m.text_size == 0:
            print "NA"
            continue
        s = m.score
        # Recalculate?
        if recalculate:
            s = hox70.score_alignment( m )
        # Normalize?
        if lnorm:
            s = s / m.text_size
        # Print
        print s
Exemplo n.º 2
0
def main():

    # Parse command line arguments
    options, args = doc_optparse.parse(__doc__)

    try:
        lnorm = bool(options.lnorm)
        recalculate = bool(options.recalculate)
    except Exception:
        doc_optparse.exit()

    hox70 = score.build_scoring_scheme("""  A    C    G    T
                                      91 -114  -31 -123
                                    -114  100 -125  -31
                                     -31 -125  100 -114
                                    -123  -31 -114   91 """,
                                       400,
                                       30,
                                       default=0)

    maf_reader = maf.Reader(sys.stdin)

    for m in maf_reader:
        if m.text_size == 0:
            print("NA")
            continue
        s = m.score
        # Recalculate?
        if recalculate:
            s = hox70.score_alignment(m)
        # Normalize?
        if lnorm:
            s = s / m.text_size
        # Print
        print(s)