-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspaceranger_5XFAD.sub
48 lines (40 loc) · 1.93 KB
/
spaceranger_5XFAD.sub
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
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
#SBATCH --job-name=sr-5XFAD ## Name of the job.
#SBATCH -p standard ## partition/queue name
#SBATCH -A vswarup_lab ## partition/queue name
#SBATCH --nodes=1 ## (-N) number of nodes to use
#SBATCH --ntasks=1 ## (-n) number of tasks to launch
#SBATCH --cpus-per-task=16 ## number of cores the job needs
#SBATCH --error=slurm-%J.err ## error log file
#SBATCH --mem 64G ## request 64GB of memory
#SBATCH --array=0-3 ## job array
#SBATCH --time=72:00:00
# set directory for fastqs and images:
fastqs="/dfs7/dfs3/swaruplab/smorabit/data/Visium_Mouse_2021/fastqs/5XFAD_samples/"
image_dir="/dfs7/dfs3/swaruplab/smorabit/data/Visium_Mouse_2021/images/5XFAD_tifs/"
align_dir="/dfs7/dfs3/swaruplab/smorabit/data/Visium_Mouse_2021/images/5XFAD_alignment/"
# list files and get all sample names
fastq_files=($(ls $fastqs))
samples=($(ls $fastqs | cut -d '_' -f 1 | uniq))
# index based on task ID
let index="$SLURM_ARRAY_TASK_ID"
# get sample based on index:
sample=${samples[$index]}
# get the image, slide, and area corresponding to this sample
image_name=$(ls $image_dir | grep $sample)
slide=$(echo $image_name | cut -d '_' -f 2)
area=$(echo $image_name | cut -d '_' -f 3 | cut -d '.' -f 1)
# get the alignment file:
align_name=$(ls $align_dir | grep $sample)
# run spaceranger
transcriptome="/dfs7/dfs3/swaruplab/smorabit/resources/spaceranger_reference/refdata-gex-mm10-2020-A"
~/swaruplab/smorabit/bin/software/spaceranger-1.2.1/spaceranger count --id=$sample \
--transcriptome=$transcriptome \
--fastqs=$fastqs \
--sample=$sample \
--colorizedimage=$image_dir$image_name \
--slide=$slide \
--area=$area \
--loupe-alignment=$align_dir$align_name \
--localcores=16 \
--localmem=64