comparison pre_sartools.py @ 4:05c9b1a7f44e draft default tip

Uploaded new release 1.7.3
author lgueguen
date Thu, 07 Jan 2021 11:12:01 +0000
parents fe0ee346b17d
children
comparison
equal deleted inserted replaced
3:de6d0b7c17af 4:05c9b1a7f44e
49 counts_files.write("label\tfiles\tgroup\n") 49 counts_files.write("label\tfiles\tgroup\n")
50 for (level, filename, label) in inputs: 50 for (level, filename, label) in inputs:
51 filename_base = basename(filename) 51 filename_base = basename(filename)
52 # For RSEM files we process files as HTSeq count output 52 # For RSEM files we process files as HTSeq count output
53 tmpdir = tempfile.mkdtemp() 53 tmpdir = tempfile.mkdtemp()
54 with open(filename, 'rb') as csvfile: 54 with open(filename, 'rt') as csvfile:
55 with open(join(tmpdir, basename(filename)), 'wb') as out: 55 with open(join(tmpdir, basename(filename)), 'wt') 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['expected_count'])))) 60 spamwriter.writerow((row['gene_id'], int(float(row['expected_count']))))