def _get_column(in_file, out_file, column, data=None):
    """Subset one column from a file
    """
    with file_transaction(data, out_file) as tx_out_file:
        with open(in_file) as in_handle:
            with open(tx_out_file, 'w') as out_handle:
                for line in in_handle:
                    cols = line.strip().split("\t")
                    if line.find("eff_count") > 0:
                        continue
                    number = cols[column]
                    if column == 7:
                        number = int(round(float(number), 0))
                    out_handle.write("%s\t%s\n" % (cols[1], number))
    return out_file
def _get_column ( in_file , out_file , column , data = None ) : with file_transaction ( data , out_file ) as tx_out_file : with open ( in_file ) as in_handle : with open ( tx_out_file , 'w' ) as out_handle : for line in in_handle : cols = line . strip ( ) . split ( "\t" ) if line . find ( "eff_count" ) > 0 : continue number = cols [ column ] if column == 7 : number = int ( round ( float ( number ) , 0 ) ) out_handle . write ( "%s\t%s\n" % ( cols [ 1 ] , number ) ) return out_file
Subset one column from a file