Example #1
0
def h_analysis(htrees, seq_diff, regions, mhcs_dict):
    a = NGclassify.Classify()
    #print "Classification of sequence %s" % seq_diff.obj.name
    for htree, name in htrees:
        print "Classification according to tree:", name
        a.classify_by_tree(htree, seq_diff, regions)
        #print "start is ", seq_diff.start
        #print "end is ", seq_diff.end
        #print "haplo_stats: ", a.haplo_stats
        print "genome_state is ", a.get_genome_state()
        (haplo_stats_sorted, haplo_best) = a.prediction_sorting()
        print haplo_best
        #print "haplo_stats_sorted is:\n", haplo_stats_sorted
        print "=" * 20
        #print "haplo_best is: ", haplo_best
        #print "finding MHCS for sequence %s" % seq_diff.obj.name
        mhcss = a.get_mhcss(mhcs_dict)
        #print "MHCS ID for sequence %s is %s" % (seq_diff.obj.name, ','.join(list(mhcss)))

# PROVA PRINT
# print "stat_list is:"
# print type(a.__dict__['stat_list'])
#print a.__dict__
    print '-' * 30
    #print a.seq_diff.obj.name
    #print a.haplo_stats
    #pdb.set_trace()
    return a
Example #2
0
def align_sequence(muscle_exe, sequence, rif=None, ):
    """sequence is a datatypes.Sequence, rif"""
    if rif is None:
        rif = datatypes.Sequence('RSRS', consts.RCRS)
    seq_diff = NGclassify.SequenceDiff()
    #print "Aligning sequence %s" % sequence.name
    seq_diff.gen_diff(muscle_exe, rif, datatypes.Sequence(sequence.name, str(sequence)))
    #print "-"*30
    return seq_diff
Example #3
0
def h_analysis(htrees, seq_diff, regions, mhcs_dict):
    a = NGclassify.Classify()
    #print "Classification of sequence %s" % seq_diff.obj.name
    for htree, name in htrees:
        print "Classification according to tree:", name
        a.classify_by_tree(htree, seq_diff, regions)
        #print "start is ", seq_diff.start
        #print "end is ", seq_diff.end
        #print "haplo_stats: ", a.haplo_stats
        print "genome_state is ", a.get_genome_state()
        (haplo_stats_sorted, haplo_best) = a.prediction_sorting()
        print haplo_best
        #print "haplo_stats_sorted is:\n", haplo_stats_sorted
        print "="*20
        mhcss = a.get_mhcss(mhcs_dict)
    print '-'*30
    return a