@@ -30,7 +30,7 @@ def scale(x, themin, themax):
3030def  reverse_complement (dna ):
3131    dna  =  dna .upper ()
3232    ''' 
33-     Reverse complement a DNA string   
33+     Reverse complement a DNA string 
3434    ''' 
3535    dna  =  dna [::- 1 ]
3636    revcom  =  []
@@ -159,13 +159,10 @@ def write_fastq_multi(fastq_dict, outputfile):
159159                    f2 .write (reads2 )
160160
161161
162- def  run_read_simulation_multi (INFILE , NREAD ,  COV , READLEN , INSERLEN , LENDEV , A1 , A2 , MINLENGTH , ERR ,  DAMAGE , GEOM_P , THEMIN , THEMAX , fastq_dict , QUALITY ):
162+ def  run_read_simulation_multi (INFILE , COV , READLEN , INSERLEN , LENDEV , A1 , A2 , MINLENGTH , ERR ,  DAMAGE , GEOM_P , THEMIN , THEMAX , fastq_dict , QUALITY ):
163163    print ("===================" )
164164    print ("Genome: " , INFILE )
165-     if  COV :
166-         print ("Coverage: " , COV )
167-     else :
168-         print ("Number of reads: " , NREAD )
165+     print ("Coverage: " , COV )
169166    print ("Read length: " , READLEN )
170167    print ("Mean Insert length: " , INSERLEN )
171168    print ("Insert length standard deviation: " , LENDEV )
@@ -178,15 +175,14 @@ def run_read_simulation_multi(INFILE, NREAD, COV, READLEN, INSERLEN, LENDEV, A1,
178175    basename  =  get_basename (INFILE )
179176    fasta  =  read_fasta (INFILE )
180177
181-     if  COV :
182-         nread  =  int (fasta [1 ] /  INSERLEN )
183-         print ("Number of reads: " , nread )
184-         print ("===================\n " )
178+     nread  =  int ((fasta [1 ] /  INSERLEN ) *  COV )
179+     print ("Number of reads: " , nread )
180+     print ("===================\n " )
185181
186182    insert_lengths  =  [int (n ) for  n  in  npr .normal (INSERLEN , LENDEV , nread )]
187183
188184    all_inserts  =  random_insert (fasta , insert_lengths , READLEN , MINLENGTH )
189-     if  DAMAGE   ==   True :
185+     if  DAMAGE :
190186        all_inserts  =  add_damage (
191187            all_inserts = all_inserts ,
192188            geom_p = GEOM_P ,
0 commit comments