User Tools

Site Tools


scripts:qc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
scripts:qc [2025/03/11 12:23] 37.26.174.181scripts:qc [2025/03/21 12:43] (current) 37.26.174.181
Line 12: Line 12:
 # SCRIPT FOR PERFORMING FASTQC # SCRIPT FOR PERFORMING FASTQC
 # NOTE: Run this script from the directory where the "log" directory is located, # NOTE: Run this script from the directory where the "log" directory is located,
-#       /mnt/proj/ibd/ds-06_cd-fecal/common+#       Example: /mnt/proj/ibd/ds-06_cd-fecal/common
 # #
 # PURPOSE: # PURPOSE:
Line 47: Line 47:
 #SBATCH --mem=10gb #SBATCH --mem=10gb
 #SBATCH --cpus-per-task=10 #SBATCH --cpus-per-task=10
-#SBATCH --job-name=fastqc_multiqc_00+#SBATCH --job-name=fastqc_00
 #SBATCH --output=log/fastqc_00%j.log  # %j will be replaced with the job ID #SBATCH --output=log/fastqc_00%j.log  # %j will be replaced with the job ID
  
Line 57: Line 57:
 src/fastqc.sh $input $output src/fastqc.sh $input $output
 </code> </code>
 +=== MultiQC ===
 +
 +MultiQC generates a report based on multiple FastQC reports and enables to view then simultaneously. MultiQC also takes Fastp reports as input and allocates a separate section.
  
 == Dauther script == == Dauther script ==
Line 63: Line 66:
 # SCRIPT FOR PERFORMING MultiQC # SCRIPT FOR PERFORMING MultiQC
 # NOTE: Run this script from the directory where the "log" directory is located, # NOTE: Run this script from the directory where the "log" directory is located,
-#       /mnt/proj/ibd/ds-06_cd-fecal/common+#       Example: /mnt/proj/ibd/ds-06_cd-fecal/common
 # #
 # PURPOSE: # PURPOSE:
Line 87: Line 90:
 output_dir="$2" output_dir="$2"
  
-echo "Running FastQC on reads..."+echo "Running MultiQC..."
 mkdir -p "$output_dir" mkdir -p "$output_dir"
-multiqc -o "$output_dir" "$input_dir/"*.fq.gz+multiqc -o "$output_dir" "$input_dir"
 </code> </code>
- 
-=== MultiQC === 
- 
-MultiQC generates a report based on multiple FastQC reports and enables to view then simultaneously. MultiQC also takes Fastp reports as input and allocates a separate section. 
  
 == Parent script == == Parent script ==
Line 102: Line 101:
 #SBATCH --mem=10gb #SBATCH --mem=10gb
 #SBATCH --cpus-per-task=10 #SBATCH --cpus-per-task=10
-#SBATCH --job-name=fastqc_multiqc_00 +#SBATCH --job-name=multiqc_00 
-#SBATCH --output=log/fastqc_00%j.log  # %j will be replaced with the job ID+#SBATCH --output=log/multiqc_00%j.log  # %j will be replaced with the job ID
  
 #parameters #parameters
Line 115: Line 114:
 You can also perform them simultaneously with one parent script: You can also perform them simultaneously with one parent script:
 == Combined parent script == == Combined parent script ==
 +qc_00.sh
 <code> <code>
 #!/bin/bash #!/bin/bash
Line 134: Line 133:
 </code> </code>
  
-You can also use the same scripts on trimmed files. Just add "_trimmed" to the inputs and outputs like this. Remember to save them in separate olders (fastqc_trimmed, multiqc_trimmed)+You can also use the same scripts on trimmed files. Just add "_trimmed" to the inputs and outputs like this. Remember to save them in separate folders (fastqc_trimmed, multiqc_trimmed) 
 + 
 +fastqc_post_00.sh
 <code> <code>
-#Input parameters+#!/bin/bash 
 +#SBATCH --mem=10gb 
 +#SBATCH --cpus-per-task=10 
 +#SBATCH --job-name=fastqc_post_00 
 +#SBATCH --output=log/fastqc_post_00%j.log  # %j will be replaced with the job ID 
 + 
 +#parameters 
 input=fq_trimmed input=fq_trimmed
 output=fastqc_trimmed output=fastqc_trimmed
 +
 +src/fastqc.sh $input $output
 </code> </code>
  
-Fastp +multiqc_post_00.sh 
-If you want to add Fastp reports to MultiQC, you can add "fq_trimmed" directory as input to MultiQC.+<code> 
 +#!/bin/bash 
 +#SBATCH --mem=10gb 
 +#SBATCH --cpus-per-task=10 
 +#SBATCH --job-name=multiqc_post_00 
 +#SBATCH --output=log/multiqc_post_00%j.log  # %j will be replaced with the job ID
  
-In daughter script:+#parameters 
 + 
 +input=fastqc_trimmed 
 +output=multiqc_trimmed 
 + 
 +src/multiqc.sh $input $output 
 +</code> 
 + 
 +=== Fastp === 
 +If you want to add Fastp reports to MultiQC, you can add "fq_trimmed" directory as input to MultiQC (multiqc_fastp.sh). 
 + 
 +== Daughter script == 
 +multiqc_fastp.sh:
 <code> <code>
 +# SCRIPT FOR PERFORMING MultiQC
 +# NOTE: Run this script from the directory where the "log" directory is located,
 +#       Example: /mnt/proj/ibd/ds-06_cd-fecal/common
 +#
 +# PURPOSE:
 +#   This script performs MultiQC.
 +#
 +# PARAMETERS:
 +#   1: input_dir - Directory where FastQC reports are located.
 +#   2: output_dir - Directory where MultiQC report will be located
 +# SAMPLE USAGE:
 +#   In a parent script: src/multiqc.sh <input_dir> <output_dir>
 +#
 +# IMPORTANT:
 +#   - Run from a parent script.
 +
 +# Check if correct number of arguments are provided
 +if [ "$#" -ne 2 ]; then
 +    echo "Usage: $0 <input_dir> <output_dir>"
 +    exit 1
 +fi
 +
 # Input parameters # Input parameters
-input_dir="$1" +input_dir=$1 
-input_fastp="$2" +input_fastp=$2 
-output_dir="$3"+output_dir=$3 
 + 
 +echo "Running MultiQC..." 
 +mkdir -p "$output_dir" 
 +multiqc -o "$output_dir" "$input_dir" "$input_fastp"
 </code> </code>
  
-In parent script:+== Parent == 
 +multiqc_fastp_00.sh
 <code> <code>
-src/multiqc.sh $input_dir $input_fastp $output_dir+#!/bin/bash 
 +#SBATCH --mem=10gb 
 +#SBATCH --cpus-per-task=10 
 +#SBATCH --job-name=multiqc_fastp_00 
 +#SBATCH --output=log/multiqc_fastp_00%j.log  # %j will be replaced with the job ID 
 + 
 +#parameters 
 + 
 +input=fastqc_trimmed 
 +input_fastp=fq_trimmed 
 +output=multiqc_trimmed 
 + 
 +src/multiqc.sh $input $input_fastp $output
 </code> </code>
scripts/qc.1741695788.txt.gz · Last modified: by 37.26.174.181

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki