deduplicate
ReadDeduplicationParserProcess
¶
Bases: Process
Process subclass for parsing fastq file(s) into a hashed {id:sequence} json format.
Attributes:
Name | Type | Description |
---|---|---|
inq |
Input read queue |
|
outq |
Output read queue (Not currently used) |
|
hash_seed |
Seed for xxhash64 algorithm to ensure consistency |
|
save_hash_dict_path |
Path to save hashed dictionary |
Source code in capcruncher/api/deduplicate.py
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 |
|
__init__(inq, hash_seed=42, output_path='parsed.json')
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inq |
SimpleQueue
|
Input queue for fastq reads. |
required |
outq |
SimpleQueue
|
Output queue for processed reads. Only used if part of a pipeline |
required |
hash_seed |
int
|
Seed to use for hashing. Defaults to 42. |
42
|
output_path |
PathLike
|
Path to save hashed reads. |
'parsed.json'
|
Source code in capcruncher/api/deduplicate.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
|
run()
¶
Processes fastq reads from multiple files and generates a hashed json dict.
Dictionary is hashed and in the format {(read 1 name + read 2 name): (s1 + s2)}
Output path is specified by save_hashed_dict_path.
Source code in capcruncher/api/deduplicate.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 |
|
ReadDuplicateRemovalProcess
¶
Bases: Process
Process subclass for parsing fastq file(s) and removing identified duplicates.
Attributes:
Name | Type | Description |
---|---|---|
inq |
Input read queue |
|
outq |
Output queue for deduplicated reads. |
|
duplicated_ids |
Concatenated read ids to remove from input fastq files. |
|
statq |
Output queue for statistics. |
|
reads_total |
Number of fastq reads processed. |
|
reads_unique |
Number of non-duplicated reads output. |
|
hash_seed |
Seed for xxhash algorithm. Same as ReadDuplicationParserProcess. |
Source code in capcruncher/api/deduplicate.py
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 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
|
__init__(inq, outq, stats_tx, duplicated_ids, hash_seed=42, hash_read_name=True)
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
inq |
SimpleQueue
|
Input queue for reads to be deduplicated. |
required |
outq |
SimpleQueue
|
Output queue for deduplicated reads. |
required |
duplicated_ids |
set
|
Hashed read ids to be removed if encountered. |
required |
statq |
Queue
|
Output queue for statistics. |
required |
hash_seed |
int
|
Seed for xxhash algorithm. Defaults to 42. |
42
|
Source code in capcruncher/api/deduplicate.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
|
run()
¶
Performs read deduplication based on sequence.
Unique reads are placed on outq and deduplication stats are placed on statq.
Source code in capcruncher/api/deduplicate.py
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
|