Mercurial > repos > lgueguen > sartools
comparison pre_sartools.py @ 1:fe0ee346b17d draft
RSEM process files corrected in pre_sartools.py
author | lgueguen |
---|---|
date | Wed, 26 Apr 2017 05:04:18 -0400 |
parents | 581d217c7337 |
children | 05c9b1a7f44e |
comparison
equal
deleted
inserted
replaced
0:581d217c7337 | 1:fe0ee346b17d |
---|---|
38 with open(join(tmpdir, basename(filename)), 'wb') as out: | 38 with open(join(tmpdir, basename(filename)), 'wb') as out: |
39 spamwriter = csv.writer(out, delimiter='\t') | 39 spamwriter = csv.writer(out, delimiter='\t') |
40 reader = csv.DictReader(csvfile, delimiter='\t', skipinitialspace=True) | 40 reader = csv.DictReader(csvfile, delimiter='\t', skipinitialspace=True) |
41 if len(reader.fieldnames) > 2: | 41 if len(reader.fieldnames) > 2: |
42 for row in reader: | 42 for row in reader: |
43 spamwriter.writerow((row['gene_id'], int(float(row['effective_length'])))) | 43 spamwriter.writerow((row['gene_id'], int(float(row['expected_count'])))) |
44 zip_cmd += ' %s ' % (join(tmpdir, basename(filename))) | 44 zip_cmd += ' %s ' % (join(tmpdir, basename(filename))) |
45 else : | 45 else : |
46 zip_cmd += ' %s ' % (filename) | 46 zip_cmd += ' %s ' % (filename) |
47 counts_files.write( label + "\t" + filename_base + "\t" + level + "\t" + batch_name + "\n" ) | 47 counts_files.write( label + "\t" + filename_base + "\t" + level + "\t" + batch_name + "\n" ) |
48 else : | 48 else : |
55 with open(join(tmpdir, basename(filename)), 'wb') as out: | 55 with open(join(tmpdir, basename(filename)), 'wb') as out: |
56 spamwriter = csv.writer(out, delimiter='\t') | 56 spamwriter = csv.writer(out, delimiter='\t') |
57 reader = csv.DictReader(csvfile, delimiter='\t', skipinitialspace=True) | 57 reader = csv.DictReader(csvfile, delimiter='\t', skipinitialspace=True) |
58 if len(reader.fieldnames) > 2: | 58 if len(reader.fieldnames) > 2: |
59 for row in reader: | 59 for row in reader: |
60 spamwriter.writerow((row['gene_id'], int(float(row['effective_length'])))) | 60 spamwriter.writerow((row['gene_id'], int(float(row['expected_count'])))) |
61 zip_cmd += ' %s ' % (join(tmpdir, basename(filename))) | 61 zip_cmd += ' %s ' % (join(tmpdir, basename(filename))) |
62 else: | 62 else: |
63 zip_cmd += ' %s ' % (filename) | 63 zip_cmd += ' %s ' % (filename) |
64 | 64 |
65 counts_files.write( label + "\t" + filename_base + "\t" + level + "\n" ) | 65 counts_files.write( label + "\t" + filename_base + "\t" + level + "\n" ) |