-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheck_train.py
More file actions
27 lines (22 loc) · 1.04 KB
/
check_train.py
File metadata and controls
27 lines (22 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import sys
import os
import subprocess
import argparse
def make_new_csv(input_path,output_path,funannotate_dir):
with open(input_path,'r') as fh_in, open(output_path,'w') as fh_out:
_ = next(fh_in)
fh_out.write('sample_id\n')
for line in fh_in:
sample = line.strip()
checkpaths = []
checkpaths.append(f'{funannotate_dir}{sample}/training/left.fq.gz')
checkpaths.append(f'{funannotate_dir}{sample}/training/right.fq.gz')
checkpaths.append(f'{funannotate_dir}{sample}/training/trinity_gg')
checkpaths.append(f'{funannotate_dir}{sample}/training/trimmomatic')
if all([os.path.exists(x) for x in checkpaths]):
_ = fh_out.write(line)
if __name__ == "__main__":
inp = 'results/2025-05-06_ncbiPathogen_t30_v1/assembly_pass_samples.csv'
outp = 'results/2025-05-06_ncbiPathogen_t30_v1/assembly_pass_samples_PART1.csv'
funannotate_dir = 'results/2025-05-06_ncbiPathogen_t30_v1/funannotate/'
make_new_csv(inp,outp,funannotate_dir)