call module¶
-
class
mavis.validate.call.
EventCall
(b1, b2, source_evidence, event_type, call_method, contig=None, contig_alignment=None, untemplated_seq=None)[source]¶ Bases:
mavis.breakpoint.BreakpointPair
class for holding evidence and the related calls since we can’t freeze the evidence object directly without a lot of copying. Instead we use call objects which are basically just a reference to the evidence object and decisions on class, exact breakpoints, etc
Parameters: - evidence (Evidence) – the evidence object we are calling based on
- event_type (SVTYPE) – the type of structural variant
- breakpoint_pair (BreakpointPair) – the breakpoint pair representing the exact breakpoints
- call_method (CALL_METHOD) – the way the breakpoints were called
- contig (Contig) – the contig used to call the breakpoints (if applicable)
-
add_break1_split_read
(read)[source]¶ Parameters: read (pysam.AlignedSegment) – putative split read supporting the first breakpoint
-
add_break2_split_read
(read)[source]¶ Parameters: read (pysam.AlignedSegment) – putative split read supporting the second breakpoint
-
add_flanking_support
(flanking_pairs, is_compatible=False)[source]¶ counts the flanking read-pair support for the event called. The original source evidence may have contained evidence for multiple events and uses a larger range so flanking pairs here are checked specifically against the current breakpoint call
Returns: Return type: tuple
-
add_spanning_read
(read)[source]¶ Parameters: read (pysam.AlignedSegment) – putative spanning read
-
flanking_metrics
()[source]¶ computes the median and standard deviation of the flanking pairs. Note that standard deviation is calculated wrt the median and not the average. Also that the fragment size is calculated as a range so the start and end of the range are used in computing these metrics
Returns: float
- the median fragment sizefloat
- the fragment size standard deviation wrt the median
Return type: tuple
-
has_compatible
¶ bool – True if compatible flanking pairs are appropriate to collect
-
mavis.validate.call.
call_events
(source_evidence)[source]¶ generates a set of event calls based on the evidence associated with the source_evidence object will also narrow down the event type
Parameters: Returns: list of calls
Return type:
-
mavis.validate.call.
filter_consumed_pairs
(pairs, consumed_reads)[source]¶ given a set of read tuples, returns all tuples where neither read in the tuple is in the consumed set
Parameters: - pairs (set of tuples of
pysam.AlignedSegment
andpysam.AlignedSegment
) – pairs to be filtered - consumed_reads – (set of
pysam.AlignedSegment
): set of reads that have been used/consumed
Returns: set of filtered tuples
Return type: set of tuples of
pysam.AlignedSegment
andpysam.AlignedSegment
Note
this will work with any hash-able object
Example
>>> pairs = {(1, 2), (3, 4), (5, 6)} >>> consumed_reads = {1, 2, 4} >>> filter_consumed_pairs(pairs, consumed_reads) {(5, 6)}
- pairs (set of tuples of