From da3e0d5829f58059ec5d4bbc447c773820387d7a Mon Sep 17 00:00:00 2001 From: casperjamin Date: Wed, 17 Jun 2020 14:02:45 +0200 Subject: [PATCH] commented some code --- scripts/unique.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/scripts/unique.py b/scripts/unique.py index a1467b7..3187e21 100644 --- a/scripts/unique.py +++ b/scripts/unique.py @@ -3,13 +3,23 @@ from joblib import Parallel, delayed - def unique(input_file, lower, upper, numcores = 1): + """ + count number of unique k-mers over a range of k-mers, returns fraction of unique k-mers + + INPUT: + input_file: fasta file that will be analysed + lower: lower limit of size k to use + upper: upper limit of size k to use + numcores: number of cores to use + OUTPUT: + sends for each size of k the fraction of unique k-mers + """ inputs = list(range(lower, upper + 1)) processed = Parallel(n_jobs = numcores)(delayed(determine_unique)(i, input_file) for i in inputs) - [print(x[0],'\t',x[1]) for x in processed] - + [print(x[0],'\t', x[1]) for x in processed] + def determine_unique(kmersize, input_file): series = kmercount(input_file, output_file = None, kmersize = kmersize, write = False)