Skip to content

Commit

Permalink
Cleaning things up
Browse files Browse the repository at this point in the history
  • Loading branch information
Jakob37 committed Oct 18, 2024
1 parent 10d93f5 commit bc19f45
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 31 deletions.
5 changes: 0 additions & 5 deletions genmod/commands/score_compounds.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ def compound(context, variant_file, silent, outfile, vep, threshold: int, penalt
"""
logger.info('Running GENMOD score_compounds, version: {0}'.format(__version__))

print("Inside compounds")

variant_file = get_file_handle(variant_file)

start_time_analysis = datetime.now()
Expand All @@ -75,7 +73,6 @@ def compound(context, variant_file, silent, outfile, vep, threshold: int, penalt

logger.info("Headers parsed")


if not line.startswith('#'):
variant_file = itertools.chain([line], variant_file)
else:
Expand Down Expand Up @@ -159,8 +156,6 @@ def compound(context, variant_file, silent, outfile, vep, threshold: int, penalt
results_queue=results
)



logger.debug("Put stop signs in the variant queue")
for i in range(num_scorers):
variant_queue.put(None)
Expand Down
26 changes: 0 additions & 26 deletions genmod/score_variants/compound_scorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,6 @@ def _get_rankscore_normalization_bounds(variant_batch: Dict[str, Dict]) -> Dict[
return variant_rankscore_normalization_bounds

def run(self):


# THRESHOLD = 9
# PENALTY = 20


"""Run the consuming"""
logger.info('%s: Starting!' % self.proc_name)
# Check if there are any batches in the queue
Expand Down Expand Up @@ -191,11 +185,6 @@ def run(self):
#TODO check if correct family id
# Right now we assume that there is only one family in the vcf

# print("INSIDE ")
# print(family_rank_score)
if family_rank_score[0] == '':
continue

family_id = family_rank_score[0]
rank_score = float(family_rank_score[-1])

Expand Down Expand Up @@ -254,27 +243,17 @@ def run(self):

compound_rank_score = rank_scores[rank_score_type][compound_id]

if variant['POS'] == "46602462":
print(f"Compound: {compound_id} score: {compound_rank_score}")



if compound_rank_score > get_rank_score(rank_score_type=rank_score_type,
threshold=self.threshold,
min_rank_score_value=variant_rankscore_normalization_bounds[variant_id][0],
max_rank_score_value=variant_rankscore_normalization_bounds[variant_id][1]
):
only_low = False
if variant['POS'] == "46602462":
print(f"Hit something")
logger.debug("Setting only_low to {0}".format(only_low))

if (correct_score and only_low):

if variant['POS'] == "46602462":
print(f"Aha, didn't hit anything, penalizing")


logger.debug("correcting rank score for {0}".format(
variant_id))
current_rank_score -= get_rank_score_as_magnitude(rank_score_type=rank_score_type,
Expand Down Expand Up @@ -309,8 +288,6 @@ def run(self):
variant['info_dict'][f'{rank_score_type}'] = new_rank_score_string
variant['info_dict'][f'Compounds{rank_score_type.strip("RankScore")}'] = new_compound_string

if variant['POS'] == "46602462":
print("Point 1")
# print(variant["info_dict"])
# raise ValueError(variant)
# import sys
Expand All @@ -336,9 +313,6 @@ def run(self):
variant_dict=variant
)

if variant['POS'] == "46602462":
print("Point 2")
# print(variant["info_dict"])
logger.debug("Putting variant in results_queue")

self.results_queue.put(variant)
Expand Down

0 comments on commit bc19f45

Please sign in to comment.