@@ -79,6 +79,26 @@ sub get_fastp_command {
79
79
return ($trim_command );
80
80
}
81
81
82
+ # format command to run custom UMI trimming (ConcensusCruncher)
83
+ sub get_extractUMI_command {
84
+ my %args = (
85
+ r1 => undef ,
86
+ r2 => undef ,
87
+ stem => undef ,
88
+ @_
89
+ );
90
+
91
+ my $trim_command = join (' ' ,
92
+ ' python3 /cluster/projects/pughlab/src/ConsensusCruncher/scripts/extract_barcodes.py' ,
93
+ ' --blist /cluster/projects/pughlab/src/UMI-tools/idt_dual_index_barcodes.txt' ,
94
+ ' --read1' , $args {r1 },
95
+ ' --read2' , $args {r2 },
96
+ ' --outfile' , $args {stem }
97
+ );
98
+
99
+ return ($trim_command );
100
+ }
101
+
82
102
# ## MAIN ###########################################################################################
83
103
sub main {
84
104
my %args = (
@@ -138,16 +158,22 @@ sub main {
138
158
print $log " \n Tool config used: $tool_config " ;
139
159
print $log " \n Output directory: $output_directory " ;
140
160
print $log " \n Sample config used: $data_config " ;
141
- print $log " \n ---" ;
142
161
143
162
# set tools and versions
144
163
my $trim_tool = ' ' ;
145
- if (defined ($tool_data -> {baits_bed })) {
164
+ if (' caphla' eq $tool_data -> {seq_type }) {
165
+ print $log " \n\n Trimming using tool: ConsensusCruncher" ;
166
+ $trim_tool = ' python3/3.7.2' ;
167
+ } elsif (defined ($tool_data -> {baits_bed })) {
168
+ print $log " \n\n Trimming using tool: trim_galore" ;
146
169
$trim_tool = ' trim_galore/' . $tool_data -> {trim_galore_version };
147
170
} else {
171
+ print $log " \n\n Trimming using tool: fastq" ;
148
172
$trim_tool = ' fastp/' . $tool_data -> {fastp_version };
149
173
}
150
174
175
+ print $log " \n ---" ;
176
+
151
177
# get user-specified tool parameters
152
178
my $parameters = $tool_data -> {trim_adapters }-> {parameters };
153
179
@@ -209,7 +235,18 @@ sub main {
209
235
my $output_stem = join (' /' , $output_directory , $stem );
210
236
my ($trim_command , $new_r1 , $new_r2 );
211
237
212
- if (defined ($tool_data -> {baits_bed })) {
238
+ if (' caphla' eq $tool_data -> {seq_type }) {
239
+
240
+ $trim_command = get_extractUMI_command(
241
+ r1 => $r1 ,
242
+ r2 => $r2 ,
243
+ stem => $output_stem
244
+ );
245
+
246
+ $new_r1 = $output_stem . ' _barcode_R1.fastq' ;
247
+ $new_r2 = $output_stem . ' _barcode_R2.fastq' ;
248
+
249
+ } elsif (defined ($tool_data -> {baits_bed })) {
213
250
214
251
$trim_command = get_trim_galore_command(
215
252
r1 => $r1 ,
@@ -223,6 +260,7 @@ sub main {
223
260
$new_r2 = join (' /' , $output_directory , basename($r2 ));
224
261
$new_r2 =~ s / .fastq.gz/ _val_2.fq.gz/ ;
225
262
263
+
226
264
} else {
227
265
228
266
$trim_command = get_fastp_command(
0 commit comments