-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
eb8bc86
commit 709ff81
Showing
13 changed files
with
343 additions
and
54 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import subprocess as sp | ||
|
||
from progress_bar import * | ||
from helpers import create_kmer_dirs, print_error, print_log | ||
from constants import * | ||
import os | ||
|
||
def count_kmers(threads, frag_count): | ||
''' Generates the kmer counts for each fragment using seq2vec | ||
''' | ||
try: | ||
print_log("Generating kmer counts...") | ||
create_kmer_dirs() | ||
progress_bar = create_progress_bar(kmer_bar_desc) | ||
for filename in os.listdir(frag_write_path): | ||
name = os.path.splitext(filename)[0] | ||
frag_file = os.path.join(frag_write_path, filename) | ||
write_file = os.path.join(kmer_write_path, name) | ||
args = [ | ||
seq2vec_path, | ||
'-f', str(frag_file), | ||
'-o', str(write_file), | ||
'-t', str(threads), | ||
'-k', str(k), | ||
] | ||
sp.run(args, stdout=sp.PIPE, stderr=sp.PIPE) | ||
|
||
update_val = frag_count[name] if name in frag_count.keys() else 0 | ||
update_progress_bar(progress_bar, update_val) | ||
|
||
close_progress_bar(progress_bar) | ||
except Exception as err: | ||
print_error(f"Error generating kmer counts {err}") | ||
|
||
print_log("Generating kmer counts completed.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters