Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 0adb6003 authored by BOULLE Olivier's avatar BOULLE Olivier
Browse files

lowered abundancy for dsk, exit when starting sequence not found in kmers

parent cbe6d5f5
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,7 @@ def count_kmers_dsk(input_path: str, start_sequence: str) -> (str, dict):
dsk_script_path = currentdir+"/dsk/build/bin/dsk"
dsk_tempfile_path = currentdir+"/dsk/tmp/kmer_count"
min_occ = 2 # threshold of occurrences to save the kmer
min_occ = 1 # threshold of occurrences to save the kmer
kmer_count_command = dsk_script_path+' -file '+input_path+' -out '+dsk_tempfile_path+' -kmer-size '+ str(KMER_SIZE)+' -abundance-min '+str(min_occ)+' -verbose 0'
subprocess.call('/bin/bash -c "$DSK"', shell=True, env={'DSK': kmer_count_command})
......@@ -77,10 +77,9 @@ def count_kmers_dsk(input_path: str, start_sequence: str) -> (str, dict):
potential_starters_dict = dict((k,v) for k,v in kmer_occurrences_dict.items() if k.startswith(start_sequence))
if len(potential_starters_dict) == 0:
print("kmer_consensus warning : starting sequence not found in the reads")
return
print("kmer_consensus error : starting sequence not found in the reads")
exit(1)
start_kmer = max(potential_starters_dict, key=potential_starters_dict.get) # kmer with the maximum occurrences that begins with the starting sequence
return start_kmer, kmer_occurrences_dict
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment