Skip to content

Commit

Permalink
tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry-Antipov committed Aug 10, 2024
1 parent 2fd2479 commit b40c7f5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/scripts/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def run_clustering (graph_gfa, mashmap_sim, hic_byread, output_dir, no_rdna, une
LOGGING_FILENAME = "hicverkko.log"

CLEAR_HOMOLOGY = 500000 #for clear bulge like structures this limmit is decreased
MIN_ALIGNMENT = 100000 #smaller alingments will be filtered out
MIN_ALIGNMENT = 50000 #smaller alingments will be filtered out
MAX_COV = 100 # tempora# ry coverage cutoff, currently replaced by median coverage from gfa
FIXED_WEIGHT = 100000 # best result so far with 100000 #currently replaced with max pairwise weight among datasets

Expand Down
8 changes: 4 additions & 4 deletions src/scripts/scaffolding/match_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class MatchGraph:
CLEAR_BEST = 1.5

#homologous intervals should cover at least 1/3 of at least one of the nodes in pair
REQUIRED_COVERAGE_FRACTION = 1/3
REQUIRED_COVERAGE_FRACTION = 1/10

def __init__(self, mashmap_sim, G, homology_weight, min_big_homology, min_alignment, logger):
self.matchGraph = nx.Graph()
Expand Down Expand Up @@ -224,7 +224,7 @@ def __init__(self, mashmap_sim, G, homology_weight, min_big_homology, min_alignm
#homology storage may be asymetric, mashmap do not guararntee anything
#possibly should forcely symmetrize...
if self.hom_storage.isValid(ec[0], ec[1]) and (not G.has_edge(ec[0], ec[1])):
long_enough = True
long_enough = False
for i in range (0, 2):
best_homology = True
best_len = self.matchGraph.edges[ec]['homology_len']
Expand All @@ -233,8 +233,8 @@ def __init__(self, mashmap_sim, G, homology_weight, min_big_homology, min_alignm
best_homology = False
clear_best_match = clear_best_match or best_homology
#we have total length of homologous sequences without joining and approximate positions with joining, check if any is long enough
if max(best_len, self.hom_storage.getApproximatePositionLength(ec[0], ec[1], i)) < self.hom_storage.getLength(ec[i]) * MatchGraph.REQUIRED_COVERAGE_FRACTION:
long_enough = False
if max(best_len, self.hom_storage.getApproximatePositionLength(ec[0], ec[1], i)) > self.hom_storage.getLength(ec[i]) * MatchGraph.REQUIRED_COVERAGE_FRACTION:
long_enough = True
if clear_best_match and long_enough:
self.matchGraph.add_edge(ec[0], ec[1], weight = homology_weight, homology_len = best_len, intervals = self.hom_storage.homologies[ec[0]][ec[1]].filtered_intervals,
orientation = self.hom_storage.homologies[ec[0]][ec[1]].orientation)
Expand Down

0 comments on commit b40c7f5

Please sign in to comment.