---
title: "14-Apul-bismark"
output: html_document
date: "2025-01-03"
author: Steven Roberts
---
#min score determination
```{bash}
# Set variables
reads_dir="/home/shared/8TB_HDD_01/sam/gitrepos/urol-e5/timeseries_molecular/D-Apul/output/01.20-D-Apul-WGBS-trimming-fastp-FastQC-MultiQC/"
genome_folder="/home/shared/8TB_HDD_01/sam/gitrepos/urol-e5/timeseries_molecular/D-Apul/data/"
output_dir="../output/14-Apul-bismark/"
# Get the list of sample files and corresponding sample names
for file in ${reads_dir}*_R1_001.fastp-trim.fq.gz; do
sample_name=$(basename "$file" "_R1_001.fastp-trim.fq.gz")
# Loop through each score_min parameter manually
for score_min in "L,0,-0.4" "L,0,-0.6" "L,0,-0.8" "L,0,-1.0" "L,-1,-0.6"; do
echo "Running Bismark for sample ${sample_name} with score_min ${score_min}"
# Define output directory for each parameter
param_output_dir="${output_dir}${sample_name}_${score_min//,/}"
mkdir -p ${param_output_dir}
# Run Bismark alignment
/home/shared/Bismark-0.24.0/bismark \
--path_to_bowtie2 /home/shared/bowtie2-2.4.4-linux-x86_64 \
-genome ${genome_folder} \
-p 8 \
-u 10000 \
-score_min ${score_min} \
-1 ${reads_dir}${sample_name}_R1_001.fastp-trim.fq.gz \
-2 ${reads_dir}${sample_name}_R2_001.fastp-trim.fq.gz \
-o ${param_output_dir} \
--basename ${sample_name}_${score_min//,/} \
2> "${param_output_dir}/${sample_name}-bismark_summary.txt"
done
done
```
```{bash}
find . -type f -name '*report.txt' -print0 | sort -z | xargs -0 grep -H -E 'Mapping efficiency|C methylated'
```
```{bash}
# Set variables
reads_dir="/home/shared/8TB_HDD_01/sam/gitrepos/urol-e5/timeseries_molecular/D-Apul/output/01.20-D-Apul-WGBS-trimming-fastp-FastQC-MultiQC/"
genome_folder="/home/shared/8TB_HDD_01/sam/gitrepos/urol-e5/timeseries_molecular/D-Apul/data/"
output_dir="../output/14-Apul-bismark/"
score_min="L,0,-1.0" # Single value for score_min
# Get the list of sample files and corresponding sample names
for file in ${reads_dir}*_R1_001.fastp-trim.fq.gz; do
sample_name=$(basename "$file" "_R1_001.fastp-trim.fq.gz")
echo "Running Bismark for sample ${sample_name} with score_min ${score_min}"
# Run Bismark alignment
/home/shared/Bismark-0.24.0/bismark \
--path_to_bowtie2 /home/shared/bowtie2-2.4.4-linux-x86_64 \
-genome ${genome_folder} \
-p 8 \
-score_min ${score_min} \
-1 ${reads_dir}${sample_name}_R1_001.fastp-trim.fq.gz \
-2 ${reads_dir}${sample_name}_R2_001.fastp-trim.fq.gz \
-o ${output_dir} \
--basename ${sample_name} \
2> "${output_dir}/${sample_name}-bismark_summary.txt"
done
```