Skip to content

Commit

Permalink
style: pre-commit reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Danderson123 committed Aug 14, 2024
1 parent d308ee3 commit 3ae42d7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
5 changes: 4 additions & 1 deletion amira_prototype/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,10 @@ def parse_fastq(fastq_file):
# Iterate over the lines in the file
for identifier, sequence, quality in parse_fastq_lines(fh):
# Add the identifier and sequence to the results dictionary
results[identifier.replace("\n", "")] = {"sequence": sequence, "quality": quality}
results[identifier.replace("\n", "")] = {
"sequence": sequence,
"quality": quality,
}
return results
except OSError:
pass
Expand Down
13 changes: 5 additions & 8 deletions tests/test_gene_mer_graph.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest
from collections import Counter

from amira_prototype.__main__ import parse_fastq, write_fastq
from amira_prototype.__main__ import parse_fastq
from amira_prototype.construct_edge import Edge
from amira_prototype.construct_graph import GeneMerGraph
from amira_prototype.construct_node import Node
Expand Down Expand Up @@ -5874,12 +5874,11 @@ def test___get_closest_allele(self):
def test___path_finding_between_junctions(self):
# setup
import json
with open("tests/test_paths.json") as i:

with open("tests/test_path_calls.json") as i:
calls = json.load(i)
graph = GeneMerGraph(calls, 3)
graph.filter_graph(3, 1)
fastq_data = parse_fastq("tests/test_1.fastq.gz")
graph.generate_gml("tests/test", 3, 1, 1)
# get the potential start nodes
potential_bubble_starts = graph.identify_potential_bubble_starts()
max_distance = graph.get_kmerSize() * 3
Expand All @@ -5899,12 +5898,12 @@ def test___path_finding_between_junctions(self):
def test___get_minhashes_for_paths_same_path(self):
# setup
import json

with open("tests/test_path_calls.json") as i:
calls = json.load(i)
with open("tests/test_path_positions.json") as i:
positions = json.load(i)
graph = GeneMerGraph(calls, 3, positions)
graph.filter_graph(3, 1)
fastq_data = parse_fastq("tests/test_1.fastq.gz")
# get the potential start nodes
potential_bubble_starts = graph.identify_potential_bubble_starts()
Expand All @@ -5919,9 +5918,7 @@ def test___get_minhashes_for_paths_same_path(self):
filtered_paths = graph.filter_paths_between_bubble_starts(unique_paths)
sorted_filtered_paths = sorted(filtered_paths, key=lambda x: len(x[0]), reverse=True)
# execution
path_minimizers = graph.get_minhashes_for_paths(
sorted_filtered_paths, fastq_data, 1
)
path_minimizers = graph.get_minhashes_for_paths(sorted_filtered_paths, fastq_data, 1)
min1 = path_minimizers[tuple([n[0] for n in sorted_filtered_paths[0][0]])]
min2 = path_minimizers[tuple([n[0] for n in sorted_filtered_paths[1][0]])]
# assertion
Expand Down

0 comments on commit 3ae42d7

Please sign in to comment.