Skip to content

Commit

Permalink
commented some code
Browse files Browse the repository at this point in the history
  • Loading branch information
Casperjamin committed Jun 17, 2020
1 parent d6d1664 commit da3e0d5
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions scripts/unique.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit da3e0d5

Please sign in to comment.