File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -571,7 +571,7 @@ def save_mapped_output_json(
571571 "computed_reference_sequence" : None ,
572572 "mapped_reference_sequence" : None ,
573573 }
574- for layer in AnnotationLayer
574+ for layer in preferred_layers
575575 }
576576
577577 for layer in preferred_layers :
@@ -593,7 +593,19 @@ def save_mapped_output_json(
593593 # drop annotation layer from mapping object
594594 mapped_scores .append (ScoreAnnotation (** m .model_dump ()))
595595
596- # TODO drop any Nonetype reference sequences
596+ # drop Nonetype reference sequences
597+ for target_gene in reference_sequences :
598+ for layer in list (reference_sequences [target_gene ].keys ()):
599+ if (
600+ reference_sequences [target_gene ][layer ]["mapped_reference_sequence" ]
601+ is None
602+ and reference_sequences [target_gene ][layer ][
603+ "computed_reference_sequence"
604+ ]
605+ is None
606+ ) or layer is None :
607+ del reference_sequences [target_gene ][layer ]
608+
597609 output = ScoresetMapping (
598610 metadata = metadata .model_dump (),
599611 reference_sequences = reference_sequences ,
You can’t perform that action at this time.
0 commit comments