-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
58 lines (51 loc) · 3.2 KB
/
main.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import sys
from Graph.Graph import Graph
from Graph.Parser import GFAProcessor
from Control.HandleProcess import HandleProcess
import os
import timeit
# graph_directory = os.path.join('input_files','paired_trimmed_assembly')
# id_for_graph_files={}
# for graph_file in os.listdir(graph_directory):
# file_path = os.path.join(graph_directory, graph_file)
# if os.path.isfile(file_path):
# id=graph_file.split('_')[1]
# id_for_graph_files[id]=graph_file
# fasta_directory = os.path.join('input_files','temphd_outputs')
# for fasta_file in os.listdir(fasta_directory):
# print('processing file:' + fasta_file)
# fasta_path=os.path.join(fasta_directory, fasta_file)
# id=fasta_file[0:4:1]
# graph_file=id_for_graph_files[id]
# graph_path=os.path.join(graph_directory,graph_file)
# output_path=os.path.join('output',graph_file[0:-4]+'_induced')
# comparator = HandleProcess("graph", graph_path, fasta_path, 20, 20,output_path, 'weighted', 'double_edged')
# fastq_directory = os.path.join('input_files','temphd_induced_phages')
# for fastq_file in os.listdir(fastq_directory):
# print('processing file:' + fastq_file)
# fastq_path=os.path.join(fastq_directory, fastq_file)
# id = fastq_file[0:4:1]
# graph_file = id_for_graph_files[id]
# graph_path = os.path.join(graph_directory, graph_file)
# output_path = os.path.join('output', graph_file[0:-4])
# comparator = HandleProcess("graph", graph_path, fastq_path, 20, 20, output_path, 'weighted', 'double_edged')
#Example calls:
#Searching sequences in a graph with the basic method
#comparator = HandleProcess("graph", 'input_files/graph.gfa', "input_files/mutated_graph_node.fasta", 20, 15, 'output')
#comparator = HandleProcess("graph", 'input_files/Bazsi_scaffolds.gfa', "input_files/BazsiFag.fasta", 20, 15, 'output', 'simple','double_edged')
#comparator = HandleProcess("graph", 'input_files/Bazsi_scaffolds.gfa', "input_files/test.fasta", 20, 15, 'output', 'simple','double_edged')
#comparator = HandleProcess("graph", 'input_files/Bazsi_scaffolds_with_circle.gfa', "input_files/test.fasta", 20, 15, 'output', 'simple','double_edged')
#Searching sequences in a graph with the advanced method
#comparator = HandleProcess("graph", 'input_files/graph.gfa', "input_files/mutated_graph_node.fasta", 20, 15,'output', 'weighted')
#comparator = HandleProcess("graph", 'input_files/Bazsi_scaffolds.gfa', "input_files/BazsiFag.fasta", 20, 15,'output', 'weighted','double_edged')
#comparator = HandleProcess("graph", 'input_files/Bazsi_scaffolds_with_circle.gfa', "input_files/test.fasta", 20, 15,'output', 'weighted', 'double_edged')
#comparator = HandleProcess("graph", 'input_files/paired_trimmed_assembly/SRR19859163_1320_assembly_graph_with_scaffolds.gfa', "input_files/fastq.fastq", 20, 15,'output', 'weighted', 'double_edged')
#Comparing fasta sequences (all to all comparisson)
start_time = timeit.default_timer()
input1=sys.argv[1]
input2=sys.argv[2]
output=sys.argv[3]
#comparator = HandleProcess("fasta", input1, input2, 200, 10, output)#, 'weighted', 'double_edged')
comparator = HandleProcess("graph", input1, input2, 50, 21, output, 'simple', 'double_edged')
stop_time = timeit.default_timer()
print("Time elapsed: ", stop_time - start_time)