#!/bin/bash # Grid Engine options (lines prefixed with #$) #$ -N split_reads-3 #$ -cwd #$ -l h_rt=00:10:00 #$ -l h_vmem=1G #$ -P scs_speedup #Array job : #$ -t 1-1 #!!!!!!IMPORTANT: change to 1-num_of_samples specie="human" tag="only-CB-split" ## Variables declaration, change them to match your setup: # File with all the sample IDs, one per line idfile="/exports/eddie/scratch/$USER/Chimeras/Data/one-sample.txt" # ## Running # Assigning SAMPLE variable from the built-in array counter sample=`sed -n ${SGE_TASK_ID}p "$idfile"` echo "processing $sample" # Change directory to the main project folder cd /exports/eddie/scratch/$USER/Chimeras #reads="outs/filter_70/reads/${tag}" # now for test, use the previous one. reads="outs/filter_70/reads/only-CB" # split the file mkdir -p $reads/$sample split -n 50 $reads/${sample}_${specie}_ids.txt $reads/$sample/${sample}_${specie}_ids.