Hello everybody,
I have a folder with paired end sequencing data (divided by the asterisk to make group clearly visible here). I would like to run an automated script, which analyses couple by couple (trimming, mapping and so one). I already introduced placeholders for the single steps, but I don't know how to introduce two file (which belong together) at the same time.
I would be thankful, if someone had a hint for me.
10pct-0_S3_R1_001.fastq
10pct-0_S3_R2_001.fastq
*
10pct-0_S7_R1_001.fastq
10pct-0_S7_R2_001.fastq
*
10pct-15_S4_R1_001.fastq
10pct-15_S4_R2_001.fastq
*
10pct-15_S8_R1_001.fastq
10pct-15_S8_R2_001.fastq
placeholder1='name1'
placeholder2='name2'
placeholder3='beginning_of_the_couple_name'
for placeholder1 in *; do
trim_galore ../$placeholder1.fastq ../$placeholder2.fastq -q 20 --paired --phred33
bowtie2 $bowtie_opts $bowtie_index -1 ../$placeholder1.fq -2 ../$placeholder2.fq > $placeholder3.SAM
samtools view -bS ../$placeholder3.SAM > $placeholder3.BAM
samtools sort $placeholder3.BAM Sorted_BAMs/sorted_$placeholder3
…
done
I have a folder with paired end sequencing data (divided by the asterisk to make group clearly visible here). I would like to run an automated script, which analyses couple by couple (trimming, mapping and so one). I already introduced placeholders for the single steps, but I don't know how to introduce two file (which belong together) at the same time.
I would be thankful, if someone had a hint for me.
10pct-0_S3_R1_001.fastq
10pct-0_S3_R2_001.fastq
*
10pct-0_S7_R1_001.fastq
10pct-0_S7_R2_001.fastq
*
10pct-15_S4_R1_001.fastq
10pct-15_S4_R2_001.fastq
*
10pct-15_S8_R1_001.fastq
10pct-15_S8_R2_001.fastq
placeholder1='name1'
placeholder2='name2'
placeholder3='beginning_of_the_couple_name'
for placeholder1 in *; do
trim_galore ../$placeholder1.fastq ../$placeholder2.fastq -q 20 --paired --phred33
bowtie2 $bowtie_opts $bowtie_index -1 ../$placeholder1.fq -2 ../$placeholder2.fq > $placeholder3.SAM
samtools view -bS ../$placeholder3.SAM > $placeholder3.BAM
samtools sort $placeholder3.BAM Sorted_BAMs/sorted_$placeholder3
…
done
Comment