---
title: "01-data-explore"
format: html
editor: visual
---
### Metadata
### Raw reads:
### Trimmed reads:
#### MultiQC report:
#### Trimming notebook:
# BISMARK
```{bash}
# Directories
reads_dir="../data/"
genome_folder="../data/genome"
output_dir="../output/06-bismark-xarg"
# Ensure the output directory exists
mkdir -p ${output_dir}
# Find and process samples
find ../data/*_R1_001.fastp-trim.20220827.fq.gz \
| xargs -n 1 basename -s _R1_001.fastp-trim.20220827.fq.gz \
| while read sample; do
# Check if the output file already exists
if [ -f ${output_dir}/${sample}_PE_report.txt ]; then
echo "Skipping ${sample}: output already exists."
continue
fi
# Run bismark
echo "Processing ${sample}..."
bismark \
-genome ${genome_folder} \
-p 8 \
-score_min L,0,-0.8 \
--non_directional \
-1 ${reads_dir}${sample}_R1_001.fastp-trim.20220827.fq.gz \
-2 ${reads_dir}${sample}_R2_001.fastp-trim.20220827.fq.gz \
-o ${output_dir} \
--basename ${sample} \
>> ${output_dir}/output.log 2>&1
done
```