@@ -134,15 +134,17 @@ def main(sample_id, fastq_pair, genome_size, depth, clear, seed):
134134 # print ("Writing R1.fq.gz")
135135 ps = subprocess .Popen (('seqtk' , 'sample' , parsed_seed , p1 , str (ratio )),
136136 stdout = subprocess .PIPE )
137- with open ('{}_ss.fq.gz' .format (bn1 ), 'w' ) as outfile :
137+ with open ('{}_ss_{}.fq.gz' .format (bn1 , str (target_depth )), 'w' ) as \
138+ outfile :
138139 subprocess .Popen (('gzip' , '--fast' , '-c' ),
139140 stdin = ps .stdout , stdout = outfile )
140141 ps .wait ()
141142
142143 # print ("Writing R2.fq.gz")
143144 ps = subprocess .Popen (('seqtk' , 'sample' , parsed_seed , p2 , str (ratio )),
144145 stdout = subprocess .PIPE )
145- with open ('{}_ss.fq.gz' .format (bn2 ), 'w' ) as outfile :
146+ with open ('{}_ss_{}.fq.gz' .format (bn2 , str (target_depth )), 'w' ) as \
147+ outfile :
146148 subprocess .Popen (('gzip' , '--fast' , '-c' ),
147149 stdin = ps .stdout , stdout = outfile )
148150 ps .wait ()
@@ -157,8 +159,8 @@ def main(sample_id, fastq_pair, genome_size, depth, clear, seed):
157159 os .remove (rp )
158160
159161 else :
160- shutil . copy (p1 , "{}._ss. fq.gz" .format (bn1 ))
161- shutil . copy (p2 , "{}._ss. fq.gz" .format (bn2 ))
162+ os . symlink (p1 , "{}_ss_{}. fq.gz" .format (bn1 , str ( target_depth ) ))
163+ os . symlink (p2 , "{}_ss_{}. fq.gz" .format (bn2 , str ( target_depth ) ))
162164
163165 # Record the original estimated coverage
164166 with open (".report.json" , "w" ) as fh :
0 commit comments