Entering edit mode
21 months ago
rj.rezwan
▴
10
HI, please help me to improve the following code of picard for multiple files. All .bam
files are in the ~/path/file/mapped/
Code is given here
#!/bin/bash
#SBATCH --array=1-23
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=6
#SBATCH --time=06:00:00
#SBATCH --mem-per-cpu=30G
#SBATCH --job-name=1_23_duplicate
#SBATCH --output=1_23_duplicate.%A_%a.out
module load picard/2.20.4
var=$(ls /path/file/mapped/)
outdir="/scratch/abc/markduplication/"
N=${SLURM_ARRAY_TASK_ID}
v=${var[{N}-1]}
files="/path/file/mapped/${v}"
output=${outdir}${v}_marked.bam
picard -Xmx24G MarkDuplicates I=${files} O=${output} ASSUME_SORTED=true COMPRESSION_LEVEL=9 VALIDATION_STRINGENCY=LENIENT
and the layout of the files is given in the image
use a workflow manager like nextflow or snakemake. This is the answer.