@@ -353,9 +353,11 @@ def get_coordinate_by_read_id(spec: Assay, modality: str, read_id: str) -> Coord
353353
354354 return coord
355355
356+
356357FEATURE_REGION_TYPES = {"CDNA" , "GDNA" , "PROTEIN" , "TAG" , "SGRNA_TARGET" }
357358
358- def format_kallisto_bus (indices : List [Coordinate ], subregion_type = None ):
359+
360+ def format_kallisto_bus (indices : List [Coordinate ], subregion_type = None ) -> str :
359361 bcs = []
360362 umi = []
361363 feature = []
@@ -376,7 +378,9 @@ def format_kallisto_bus(indices: List[Coordinate], subregion_type=None):
376378 return x
377379
378380
379- def format_kallisto_bus_force_single (indices : List [Coordinate ], subregion_type = None ):
381+ def format_kallisto_bus_force_single (
382+ indices : List [Coordinate ], subregion_type = None
383+ ) -> str :
380384 bcs = []
381385 umi = []
382386 feature = []
@@ -408,7 +412,7 @@ def format_kallisto_bus_force_single(indices: List[Coordinate], subregion_type=N
408412
409413# this one should only return one string
410414# TODO: return to this
411- def format_seqkit_subseq (indices : List [Coordinate ], subregion_type = None ):
415+ def format_seqkit_subseq (indices : List [Coordinate ], subregion_type = None ) -> str :
412416 # The x string format is start:stop (1-indexed)
413417 # x = ""
414418 # region = indices[0]
@@ -422,7 +426,7 @@ def format_seqkit_subseq(indices: List[Coordinate], subregion_type=None):
422426 return x
423427
424428
425- def format_tab (indices : List [Coordinate ], subregion_type = None ):
429+ def format_tab (indices : List [Coordinate ], subregion_type = None ) -> str :
426430 x = ""
427431 for idx , coord in enumerate (indices ):
428432 rcv = coord .rcv
@@ -433,7 +437,7 @@ def format_tab(indices: List[Coordinate], subregion_type=None):
433437 return x [:- 1 ]
434438
435439
436- def format_starsolo (indices : List [Coordinate ], subregion_type = None ):
440+ def format_starsolo (indices : List [Coordinate ], subregion_type = None ) -> str :
437441 bcs = []
438442 umi = []
439443 cdna = []
@@ -451,7 +455,7 @@ def format_starsolo(indices: List[Coordinate], subregion_type=None):
451455 return x
452456
453457
454- def format_simpleaf (indices : List [Coordinate ], subregion_type = None ):
458+ def format_simpleaf (indices : List [Coordinate ], subregion_type = None ) -> str :
455459 x = ""
456460 xl = []
457461 for idx , coord in enumerate (indices ):
@@ -469,7 +473,7 @@ def format_simpleaf(indices: List[Coordinate], subregion_type=None):
469473 return "" .join (xl )
470474
471475
472- def format_zumis (indices : List [Coordinate ], subregion_type = None ):
476+ def format_zumis (indices : List [Coordinate ], subregion_type = None ) -> str :
473477 xl = []
474478 for idx , coord in enumerate (indices ):
475479 x = ""
@@ -486,7 +490,7 @@ def format_zumis(indices: List[Coordinate], subregion_type=None):
486490
487491
488492def stable_deduplicate_fqs (fqs ):
489- # stably deduplicate gdna_fqs
493+ # stably deduplicate fqs
490494 seen_fqs = set ()
491495 deduplicated_fqs = []
492496 for r in fqs :
@@ -496,7 +500,7 @@ def stable_deduplicate_fqs(fqs):
496500 return deduplicated_fqs
497501
498502
499- def format_chromap (indices : List [Coordinate ], subregion_type = None ):
503+ def format_chromap (indices : List [Coordinate ], subregion_type = None ) -> str :
500504 bc_fqs = []
501505 bc_str = []
502506 gdna_fqs = []
@@ -563,7 +567,7 @@ def filter_groupby_region_type(g, keep=["umi", "barcode", "cdna"]):
563567 return g
564568
565569
566- def format_relative (indices : List [Coordinate ], subregion_type = None ):
570+ def format_relative (indices : List [Coordinate ], subregion_type = None ) -> str :
567571 x = ""
568572 for idx , coord in enumerate (indices ):
569573 rg_strand = coord .strand # noqa
@@ -622,9 +626,6 @@ def groupby_region_type(rgns):
622626 return d
623627
624628
625- # def group_regions_by_region_type(rgns):
626-
627-
628629def format_splitcode_row (obj , rgncdiffs , idx = 0 , rev = False , complement = False ):
629630 # print(obj.region_id, idx)
630631 # TODO only have one object left and one object right of the sequence
@@ -689,7 +690,7 @@ def format_splitcode_row(obj, rgncdiffs, idx=0, rev=False, complement=False):
689690 return {"region_type" : obj .region_type , "fmt" : e }
690691
691692
692- def format_splitcode (indices : List [Coordinate ], subregion_type = None ):
693+ def format_splitcode (indices : List [Coordinate ], subregion_type = None ) -> str :
693694 # extraction based on fixed sequences
694695 # extraction based on onlist sequences
695696 # umi - bc3 - link2 - bc2 - link1 - bc1 - read
0 commit comments