This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Shell script for assembling sets of pair-end reads using unicycler

Hi guys, I am having some problems while running my home script to assemble. Below is the script. Thank you all in advance!

# Script interpreted by bash shell
#!/bin/bash

# Source to my bashrc file in /home/liu
source ~/.bashrc

# Folder with pair-end reads
folder="./L_brevis"

# Build a list of fastq files in the folder
files=($folder/*.fastq.gz)
echo "files: $files"

# Loop through all fastq files in pairs
for ((i=0; i<${#files[@]}; i+=2)); do
    # Get the path to current pairs of reads
    read1=${file[i]}
    read2=${file[i+1]}

    # Extract sample name of ecery pair
    sample_name=${read1%_R1.*}
    mkdir "$sample_name"_assembly

    # Debug to print the values of read1 and read2
    echo "read1: $read1"
    echo "read2: $read2"

    # Assemble paried-reads using Unicycler
    conda activate liu_tools_env
    unicycler -1 "$read1" -2 "$read2" -o "$folder/$sample_name"_assembly
done
unicycler script shell assemble

Thank you for your reply. I found the mistake in my script and solved it.

0 answers

No answers yet.

Log in to answer this question.