-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4.0_Do_assembly_using_HybPiper.bash
38 lines (32 loc) · 1.48 KB
/
4.0_Do_assembly_using_HybPiper.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
#
#SBATCH --chdir=/path/to/my/working/directory/on/the/HPC/cluster/where/all/the/raw/data/is/stored/assembly
#SBATCH --job-name=HybPiper
#SBATCH --partition=long
#SBATCH --array=1-353%10
#SBATCH --ntasks=1
#SBATCH --cpus-per-task=8
#SBATCH --mem=24G
#SBATCH [email protected]
#SBATCH --mail-type=END,FAIL
# Print the SLURM array task ID
echo $SLURM_ARRAY_TASK_ID
# Retrieve sample name from FamilyList.txt using SLURM array task ID
name=$(awk -v lineid=$SLURM_ARRAY_TASK_ID 'NR==lineid{print;exit}' /path/to/my/working/directory/on/the/HPC/cluster/where/all/the/raw/data/is/stored/assembly/FamilyList.txt)
# Print the sample name
echo $name
# Change to the temporary directory
cd $TMPDIR
# Assemble targeted angio353 baits loci using HybPiper
hybpiper assemble \
-t_dna /path/to/my/working/directory/on/the/HPC/cluster/where/all/the/target/file/is/stored/targetfile.fasta \
--readfiles /path/to/directory/where/all/the/trimmed/data/is/stored/trimmed_file/"$name"_R1_Tpaired.fastq.gz /mnt/shared/projects/rbgk/projects/cbitencourt/Apocys/PAFTOL_1KP_NIF-CB/trimmed_file/"$name"_R2_Tpaired.fastq.gz \
--prefix $name \
--bwa \
--cov_cutoff 8 \
--cpu ${SLURM_CPUS_PER_TASK}
# Copy results back to the original folder
# Copy folders
parallel 'cp -r {} /path/to/my/working/directory/on/the/HPC/cluster/where/all/the/raw/data/is/stored/assembly/' ::: *
# Copy files
parallel 'cp {} /path/to/my/working/directory/on/the/HPC/cluster/where/all/the/raw/data/is/stored/assembly/' ::: *