|
|
@@ -1,9 +1,10 @@ |
|
|
|
task TrimAdapt { |
|
|
|
String sample_ID |
|
|
|
String sample_id |
|
|
|
File in_fastq |
|
|
|
|
|
|
|
String adapter_seq |
|
|
|
Int randomBase_in_adapter |
|
|
|
Int sequencing_length |
|
|
|
|
|
|
|
String docker |
|
|
|
String cluster_config |
|
|
@@ -15,28 +16,32 @@ task TrimAdapt { |
|
|
|
set -e |
|
|
|
nt=$(nproc) |
|
|
|
|
|
|
|
echo -e "Trim adapter's invariant part." > ${sample_ID}.trimAdapt.log |
|
|
|
fastp --thread $nt -Q -L\ |
|
|
|
echo -e "Trim adapter's invariant part." > ${sample_id}.trimAdapt.log |
|
|
|
|
|
|
|
fastp --thread $nt -Q \ |
|
|
|
--length_required 0 \ |
|
|
|
--length_limit $[${sequencing_length}-1] \ |
|
|
|
--adapter_sequence ${adapter_seq} \ |
|
|
|
-i ${in_fastq} \ |
|
|
|
-o ${sample_ID}.trimAdapt.fastq.tmp.gz \ |
|
|
|
2>> ${sample_ID}.trimAdapt.log |
|
|
|
-o ${sample_id}.trimAdapt.fastq.tmp.gz \ |
|
|
|
2>> ${sample_id}.trimAdapt.log |
|
|
|
|
|
|
|
if [ ${randomBase_in_adapter} -gt 0 ] |
|
|
|
then |
|
|
|
echo -e "\nTrim ${randomBase_in_adapter} random base from both sides\n" >> ${sample_ID}.trimAdapt.log |
|
|
|
echo -e "\nTrim ${randomBase_in_adapter} random base from both sides\n" >> ${sample_id}.trimAdapt.log |
|
|
|
fastp --thread $nt -A -Q -L \ |
|
|
|
--trim_front1 ${randomBase_in_adapter} --trim_tail1 ${randomBase_in_adapter} \ |
|
|
|
-i ${sample_ID}.trimAdapt.fastq.tmp.gz \ |
|
|
|
-o ${sample_ID}.trimAdapt.fastq.gz \ |
|
|
|
2>> ${sample_ID}.trimAdapt.log |
|
|
|
-i ${sample_id}.trimAdapt.fastq.tmp.gz \ |
|
|
|
-o ${sample_id}.trimAdapt.fastq.gz \ |
|
|
|
2>> ${sample_id}.trimAdapt.log |
|
|
|
else |
|
|
|
mv ${sample_ID}.trimAdapt.fastq.tmp.gz ${sample_ID}.trimAdapt.fastq.gz |
|
|
|
mv ${sample_id}.trimAdapt.fastq.tmp.gz ${sample_id}.trimAdapt.fastq.gz |
|
|
|
fi |
|
|
|
|
|
|
|
zcat ${sample_ID}.trimAdapt.fastq.gz | paste - - - - | cut -f 2 | \ |
|
|
|
echo -e "Length\tReadCount" > ${sample_id}.trimAdapt.lengthDistribute |
|
|
|
zcat ${sample_id}.trimAdapt.fastq.gz | paste - - - - | cut -f 2 | \ |
|
|
|
awk '{a[length($1)]++}END{for(i in a){print i,a[i]}}' | sort -n \ |
|
|
|
> ${sample_ID}.trimAdapt.lengthDistribute |
|
|
|
>> ${sample_id}.trimAdapt.lengthDistribute |
|
|
|
|
|
|
|
>>> |
|
|
|
|
|
|
@@ -48,8 +53,8 @@ task TrimAdapt { |
|
|
|
} |
|
|
|
|
|
|
|
output { |
|
|
|
File out_fastq="${sample_ID}.trimAdapt.fastq.gz" |
|
|
|
File out_log="${sample_ID}.trimAdapt.log" |
|
|
|
File out_lengthDistribute="${sample_ID}.trimAdapt.lengthDistribute" |
|
|
|
File out_fastq="${sample_id}.trimAdapt.fastq.gz" |
|
|
|
File out_log="${sample_id}.trimAdapt.log" |
|
|
|
File out_lengthDistribute="${sample_id}.trimAdapt.lengthDistribute" |
|
|
|
} |
|
|
|
} |