File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 19
19
20
20
lines_per_file = 25000
21
21
smallfile = None
22
- num_small_file = 0
23
22
with open (f'all_splicing_variants_{ tag } .bed' , 'r' ) as bigfile :
24
- num_small_file += 1
23
+ header = bigfile . readline ()
25
24
for lineno , line in enumerate (bigfile ):
26
25
if lineno % lines_per_file == 0 :
27
26
if smallfile :
28
27
smallfile .close ()
29
28
small_filename = 'small_file_{}.txt' .format (lineno + lines_per_file )
30
29
smallfile = open (small_filename , "w" )
30
+ smallfile .write (header )
31
31
smallfile .write (line )
32
32
if smallfile :
33
- num_small_file += 1
34
33
smallfile .close ()
35
34
#get chunks
36
35
files = glob .glob ('small_file_*' )
54
53
print ("Number of output files doesn't match the number of input files that should have been processed" )
55
54
files = glob .glob ('small_file_*' )
56
55
for file in files :
57
- os .remove (file )
56
+ os .remove (file )
58
57
You can’t perform that action at this time.
0 commit comments