-
Notifications
You must be signed in to change notification settings - Fork 1
/
scpathoquant
executable file
·57 lines (51 loc) · 2.62 KB
/
scpathoquant
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python
__author__ = "Leanne Whitmore"
__email__ = "[email protected]"
__description__ = "Quantifies single cell pathogen derived reads"
# ----Libraries
import os
import argparse
import shutil
from spq.map_reads import process_reads as pr
from spq.map_reads import map_reads as mr
from spq.process_10x import extract10x as ex
from spq.quantify import patho_copies as vc
from spq.quantify import patho_genes as vg
from spq.quantify import integrate
from spq.visualization import viz
def parse_arguments():
parser = argparse.ArgumentParser(prog="scPathoQuant", description="Quantify sc viral/bacterial mapping reads")
parser.add_argument("-10x", "--path10x", type=str, required=True)
parser.add_argument("-op", "--output_path", default="output_scPathoQuant")
parser.add_argument("-p", "--processors", default=1)
parser.add_argument("-p2genome", "--path2genome", type=str, required=True)
parser.add_argument("-align", "--aligner", type=str, default="bbmap")
parser.add_argument("-v", "--vizualization", type=str, default="True")
parser.add_argument("-c", "--coveragemaps", type=str, default="True")
parser.add_argument("-in_filtered", "--input_filtered_folder", type=str, required=False, default="filtered_feature_bc_matrix")
parser.add_argument("-out_filtered", "--output_filtered_folder", type=str, required=False, default="filtered_feature_bc_matrix")
parser.add_argument("-in_raw", "--input_raw_folder", type=str, required=False, default="raw_feature_bc_matrix")
parser.add_argument("-out_raw", "--output_raw_folder", type=str, required=False, default="raw_feature_bc_matrix")
parser.add_argument("--tmp_removal", required=False, action="store_true")
parser.add_argument("--bbmap_params", nargs="+")
parser.add_argument("--bowtie2_params", nargs="+")
return parser.parse_args()
if __name__ == '__main__':
args = parse_arguments()
ex.checkgenomefile(args)
viable_cb = ex.extract_viable_10x(args.path10x)
pr.process_unmapped_reads(args, viable_cb)
mr.map2pathogengenome(args)
dfvc, virus_names = vc.htseq_run(args)
if args.vizualization=="True":
viz.generate_viral_copy_plots(args, dfvc)
if args.coveragemaps=="True":
viz.generate_coverage_maps(args, dfvc)
integrate.integrate_data_2_matrix(args, dfvc, virus_names)
dfgenes = vg.htseq_run(args, virus_names)
if dfgenes is not False:
if args.vizualization=="True":
viz.generate_viral_gene_plots(args, dfgenes)
integrate.integrate_pathogenes_data_2_matrix(args, dfgenes)
if args.tmp_removal:
shutil.rmtree(os.path.join(args.output_path,"_tmp"))