Skip to content

Commit

Permalink
use replicate seed instead
Browse files Browse the repository at this point in the history
  • Loading branch information
idfarbanecha committed Jul 7, 2021
1 parent 8dc1b05 commit 88c6550
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mess/scripts/read_counts_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import random
replicate = snakemake.wildcards.rep
seed = snakemake.params.seed
random.seed(seed)
logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', datefmt='%d %b %Y %H:%M:%S',
filename=snakemake.log[0], level=logging.DEBUG)
inputval = snakemake.params.value
Expand All @@ -14,14 +15,15 @@
sdr = snakemake.config["sd_rep"]

read_status = snakemake.config["read_status"]
if read_status == 'single' or snakemake.config["seq_tech"] == 'longreads':
if read_status == 'single' or snakemake.config["seq_tech"] == 'pacbio' or snakemake.config["seq_tech"] == 'ont':
pair = 1
else:
pair = 2
if snakemake.config["seq_tech"] == 'illumina':
rl = snakemake.config["illumina_read_len"]
else:
rl = snakemake.config["longreads_mean_len"]

"""
Functions
"""
Expand Down Expand Up @@ -92,7 +94,7 @@ def calculate_reads_and_coverage(table, total, sd, read_len, pairing, rep, input
dic[name]['Reads'] = int(read)
dic[name]['Coverage'] = cov
logging.info(f"simulating {read} reads, with a coverage value of {cov} reads for accession {name}, "
f"replicate {rep}")
f"replicate {rep} with seed {seed}")
tb = pd.DataFrame.from_dict(dic, orient='index').reset_index(drop=True)
return tb

Expand Down

0 comments on commit 88c6550

Please sign in to comment.