StatusFlags
Bases: IntFlag
A class used to represent different status flags for read alignment. Each status flag corresponds to a different power of 2, allowing combinations of flags to be represented as a sum of these powers.
Attributes:
Name | Type | Description |
---|---|---|
BARCODE |
int
|
Corresponds to a barcode failure. |
MAPQ |
int
|
Corresponds to a MAPQ failure. |
INSERT_SEQ |
int
|
Corresponds to an insert sequence failure. |
FIVE_PRIME_CLIP |
int
|
Corresponds to a failure due to 5’ end clipping in the read. |
UNMAPPED |
int
|
Corresponds to the read being unmapped. |
NOT_PRIMARY |
int
|
Corresponds to the read not being primary. |
ALIGNER_QC_FAIL |
int
|
Corresponds to the read failing aligner QC. |
RESTRICTION_ENZYME |
int
|
Corresponds to a failure due to restriction enzyme. |
Source code in callingcardstools/QC/StatusFlags.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
|
decompose(nums, as_str=True)
staticmethod
¶
Decomposes a number, list, ndarray, or pandas Series of numbers representing the sum of the powers of two into a list of those powers of two. Optionally, return the string representation of the powers of two according to the StatusFlags object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
nums |
Union[int, List[int], ndarray, Series]
|
The input number, list, ndarray, or pandas Series to decompose. |
required |
as_str |
bool
|
Whether to return the string representation of the powers of two according to the StatusFlags object. Defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
List |
List[int]
|
A list representing the sum of the powers of two if
|
Raises:
Type | Description |
---|---|
TypeError
|
If the input type is neither int, list, numpy array, nor pandas Series. |
ValueError
|
If the input is a negative integer. |
Source code in callingcardstools/QC/StatusFlags.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 |
|
flag()
¶
Returns the power of 2 corresponding to the flag’s value.
Returns:
Name | Type | Description |
---|---|---|
int |
int
|
The power of 2 corresponding to the flag’s value. |
Source code in callingcardstools/QC/StatusFlags.py
39 40 41 42 43 44 45 46 |
|