File tree 3 files changed +17
-8
lines changed 3 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -404,14 +404,14 @@ def summary(
404
404
dfs .append (df )
405
405
logging .debug (f"\t Rank: { rank } ({ reason } )" )
406
406
else :
407
- logging .debug (
407
+ logging .info (
408
408
f"Skipping { sample ['id' ]} ({ sample ['path' ]} ) due to missing files. Missing:"
409
409
)
410
410
for missing_file in parsable_files :
411
- logging .debug (f"\t { missing_file } " )
411
+ logging .info (f"\t { missing_file } " )
412
412
increment_and_append ("ignore-unknown" , sample ["id" ])
413
413
else :
414
- logging .debug (
414
+ logging .info (
415
415
f"Skipping { sample ['id' ]} ({ sample ['path' ]} ), incomplete or not a Bactopia directory"
416
416
)
417
417
increment_and_append ("ignore-unknown" , sample ["id" ])
Original file line number Diff line number Diff line change @@ -57,7 +57,8 @@ def _parse_annotation(path: str, name: str) -> dict:
57
57
with open (path , "rt" ) as fh :
58
58
for line in fh :
59
59
line = line .rstrip ()
60
- key , val = line .split (":" )
61
- if key in COLS :
62
- results [f"annotator_total_{ key } " ] = int (val .lstrip ())
60
+ if ":" in line :
61
+ key , val = line .split (":" )
62
+ if key in COLS :
63
+ results [f"annotator_total_{ key } " ] = int (val .lstrip ())
63
64
return results
Original file line number Diff line number Diff line change 1
1
"""
2
2
A list of files that can be parsed by Bactopia
3
3
"""
4
+ import logging
4
5
from pathlib import Path
5
6
6
7
EXCLUDE_COLUMNS = [
24
25
def get_parsable_files (path : str , name : str ) -> list :
25
26
parsable_files = {
26
27
# main
27
- # annotator
28
- f"{ path } /main/annotator/prokka/{ name } .txt" : "annotator" ,
29
28
# assembler
30
29
f"{ path } /main/assembler/{ name } .tsv" : "assembler" ,
31
30
# gather
@@ -49,14 +48,23 @@ def get_parsable_files(path: str, name: str) -> list:
49
48
50
49
# Check annotation files seperately, since Prokka or Bakta can be used
51
50
if Path (f"{ path } /main/annotator/bakta/{ name } .txt" ).exists ():
51
+ logging .debug (
52
+ f"Found Bakta annotation file: { path } /main/annotator/bakta/{ name } .txt"
53
+ )
52
54
parsable_files [f"{ path } /main/annotator/bakta/{ name } .txt" ] = "annotator"
53
55
elif Path (f"{ path } /main/annotator/prokka/{ name } .txt" ).exists ():
56
+ logging .debug (
57
+ f"Found Prokka annotation file: { path } /main/annotator/prokka/{ name } .txt"
58
+ )
54
59
parsable_files [f"{ path } /main/annotator/prokka/{ name } .txt" ] = "annotator"
55
60
else :
56
61
is_complete = False
57
62
missing_files .append (f"{ path } /main/annotator/prokka/{ name } .txt" )
58
63
missing_files .append (f"{ path } /main/annotator/bakta/{ name } .txt" )
59
64
65
+ logging .debug (f"Missing Files: { missing_files } " )
66
+ logging .debug (f"Is Complete: { is_complete } " )
67
+
60
68
if is_complete :
61
69
parsable_files [f"{ path } /main/qc/summary/{ name } -original.json" ] = "qc"
62
70
parsable_files [f"{ path } /main/qc/summary/{ name } -final.json" ] = "qc"
You can’t perform that action at this time.
0 commit comments