-
Notifications
You must be signed in to change notification settings - Fork 0
/
find_unfinished.py
39 lines (31 loc) · 1.06 KB
/
find_unfinished.py
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 27 11:00:15 2020
@author: YudongCai
@Email: [email protected]
"""
import os
import glob
import click
@click.command()
@click.option('--suffix1')
@click.option('--suffix2')
@click.option('--path1', help='suffix1文件所在目录,默认当前目录', default='.')
@click.option('--path2', help='suffix2文件所在目录,默认当前目录', default='.')
def main(suffix1, suffix2, path1, path2):
"""
比较当前目录下,suffix1比suffix2多出来的个体
比如suffix1为.g.vcf.gz
suffix2为.g.vcf.gz.tbi
运行后可知有哪些个体的GVCF没跑完
"""
len1 = len(suffix1) * -1
len2 = len(suffix2) * -1
set1 = {os.path.basename(i)[:len1] for i in glob.glob(f'{path1}/*{suffix1}')}
set2 = {os.path.basename(i)[:len2] for i in glob.glob(f'{path2}/*{suffix2}')}
print(f'number of suffix1: {len(set1)}')
print(f'number of suffix2: {len(set2)}')
for i in set1 - set2:
print(i)
if __name__ == '__main__':
main()