bwa mem for multiple paired read samples FastQfiles
0
0
Entering edit mode
22 months ago
salman_96 ▴ 70

Hi,

I want to make alignments for multiple fastq files. They are named as follows:

  • forwardC123_1.fq.gz forwardC124_1.fq.gz forwardC124_1.fq.gz forwardC126_1.fq.gz . .

    and reverseC123_1.fq.gz reverseC124_1.fq.gz reverseC124_1.fq.gz reverseC126_1.fq.gz . .

I have tried the following code in the script from a previous post

#/bin/bash
#date
#author
#purpose

total_files=`find -name '*.fq.gz' | wc -l`
arr=( $(ls *.fq.gz) )
echo "mapping started" >> map.log
echo "---------------" >> map.log

for ((i=0; i<$total_files; i+=2))
{
sample_name=`echo ${arr[$i]} | awk -F "_" '{print $1}'`
echo "[mapping running for] $sample_name"
printf "\n"
echo "bwa mem -t 12 GRCh38.primary_assembly.genome.fa ${arr[$i]} ${arr[$i+1]} > $sample_name.sam" >> map.log
bwa mem GRCh38.primary_assembly.genome.fa ${arr[$i]} ${arr[$i+1]} > $sample_name.sam

This is the error

./Alignment_bwa_TEST.sh: line 19: syntax error: unexpected end of file

Can anyone please assist or recommend some other script/changes? I have in total 23 paired end files.

Best

fastq reads mem bwa paired • 457 views
ADD COMMENT
0
Entering edit mode

for ((i=0; i<$total_files; i+=2))

you should use a workflow manager like Snakemake or Nextflow.

ADD REPLY

Login before adding your answer.

Traffic: 3720 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6