##################################
#                                #
# Last modified 02/15/2011       # 
#                                #
# Georgi Marinov                 #
#                                # 
##################################

import sys
import string
from sets import Set

def run():

    if len(sys.argv) < 1:
        print 'usage: python %s GTF-comparison' % sys.argv[0]
        sys.exit(1)
    
    input=sys.argv[1]

    outfile = open(input+'-scores', 'w')

    linelist = open(input)
    for line in linelist:
        if line.startswith('ID1'):
            continue
        fields=line.strip().split('\t')
        FPKM1=fields[1]
        FPKM2=fields[5]
        if FPKM1=='-1' or 'nan' in FPKM1:
            FPKM1='0'
        if FPKM2=='-1' or 'nan' in FPKM2:
            FPKM2='0'
        outline=FPKM1+'\t'+FPKM2
        outfile.write(outline+'\n')

    outfile.close()   

run()