
from typing import Mapping, Set, Callable, Union, Tuple, Iterable

# Pairwise local alignments
OrientedDNASegment = 'phasm.alignments.OrientedDNASegment'
OrientedRead = 'phasm.alignments.OrientedRead'
LocalAlignment = 'phasm.alignments.LocalAlignment'
AlignmentsT = Mapping[OrientedRead, Set[LocalAlignment]]

# Assembly Graphs
AssemblyGraph = 'phasm.assembly_graph.AssemblyGraph'
Node = OrientedDNASegment
Edge = Tuple[Node, Node]
Path = Iterable[Edge]
Bubble = Tuple[Node, Node]

# Phasing algorithm parameters
PruneParam = Union[float, Callable[[float], float]]


from typing import Mapping, Set, Callable, Union, Tuple, Iterable

# Pairwise local alignments
OrientedDNASegment = 'phasm.alignments.OrientedDNASegment'
OrientedRead = 'phasm.alignments.OrientedRead'
LocalAlignment = 'phasm.alignments.LocalAlignment'
AlignmentsT = Mapping[OrientedRead, Set[LocalAlignment]]

# Assembly Graphs
AssemblyGraph = 'phasm.assembly_graph.AssemblyGraph'
Node = Union[OrientedDNASegment, str]
Edge = Tuple[Node, Node]
Path = Iterable[Edge]
Bubble = Tuple[Node, Node]

# Phasing algorithm parameters
PruneParam = Union[float, Callable[[float], float]]

Change Node type a bit
Change Node type a bit

In a reconstructed assembly graph sometimes the nodes can be str

  
  from typing import Mapping, Set, Callable, Union, Tuple, Iterable
  
  # Pairwise local alignments
  OrientedDNASegment = 'phasm.alignments.OrientedDNASegment'
  OrientedRead = 'phasm.alignments.OrientedRead'
  LocalAlignment = 'phasm.alignments.LocalAlignment'
  AlignmentsT = Mapping[OrientedRead, Set[LocalAlignment]]
  
  # Assembly Graphs
  AssemblyGraph = 'phasm.assembly_graph.AssemblyGraph'
- Node = OrientedDNASegment
+ Node = Union[OrientedDNASegment, str]
  Edge = Tuple[Node, Node]
  Path = Iterable[Edge]
  Bubble = Tuple[Node, Node]
  
  # Phasing algorithm parameters
  PruneParam = Union[float, Callable[[float], float]]
  
Change Node type a bit
## Code Before:

from typing import Mapping, Set, Callable, Union, Tuple, Iterable

# Pairwise local alignments
OrientedDNASegment = 'phasm.alignments.OrientedDNASegment'
OrientedRead = 'phasm.alignments.OrientedRead'
LocalAlignment = 'phasm.alignments.LocalAlignment'
AlignmentsT = Mapping[OrientedRead, Set[LocalAlignment]]

# Assembly Graphs
AssemblyGraph = 'phasm.assembly_graph.AssemblyGraph'
Node = OrientedDNASegment
Edge = Tuple[Node, Node]
Path = Iterable[Edge]
Bubble = Tuple[Node, Node]

# Phasing algorithm parameters
PruneParam = Union[float, Callable[[float], float]]

## Instruction:
Change Node type a bit
## Code After:

from typing import Mapping, Set, Callable, Union, Tuple, Iterable

# Pairwise local alignments
OrientedDNASegment = 'phasm.alignments.OrientedDNASegment'
OrientedRead = 'phasm.alignments.OrientedRead'
LocalAlignment = 'phasm.alignments.LocalAlignment'
AlignmentsT = Mapping[OrientedRead, Set[LocalAlignment]]

# Assembly Graphs
AssemblyGraph = 'phasm.assembly_graph.AssemblyGraph'
Node = Union[OrientedDNASegment, str]
Edge = Tuple[Node, Node]
Path = Iterable[Edge]
Bubble = Tuple[Node, Node]

# Phasing algorithm parameters
PruneParam = Union[float, Callable[[float], float]]
