I am working with RNAseq data and I am doing the mapping in unix.Si I have several individual bash scripts, which everyone using as input the output of the previous one. Now I want to merge them all together and run one script at once. I am pretty new in Unix environment and I don't know how to this, i guess it's not just copy pasting , right
PS. first thing i supposed I have to change variable f to another,let's say z
first script :
for f in `ls ../reads/*.fastq.gz | sed 's/_[12].fastq.gz//g' `
do
hisat2 -x ../genome -1 ${f}_01.fastq.gz -2 ${f}_02.fastq.gz > ${f}.mapped.sam
done
second script :
for f in `ls *.mapped.sam|sed 's/.mapped.sam//g' `
do
samtools view -b ${f} > ${f}.mapped.bam
done
sh script1.sh && sh script2.shlsor working with other fixed names.for file in "$@"; do …; doneand then usingbash script.sh *.mapped.samis generally better (and a lot more flexible) than using a version withls *.mapped.samin it.