-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnova-cellRanger.sh
executable file
·71 lines (52 loc) · 1.69 KB
/
nova-cellRanger.sh
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#!/bin/bash
# initial commit FA200323
# version 1
if [ "$1" = "help" ] || [ -z "$1" ]
then
echo ""
echo "--------------------------------------------------------------------------------------"
echo " To run this script, use the following syntax:"
echo " bash" $0 "<idoi> "
# echo " auto - autodetects duplicate sampleIDs "
# echo " no-dups - autodetects all sampleIDs"
echo " idoi - expects user to provide a sample ID list named idoi"
echo "--------------------------------------------------------------------------------------"
echo ""
echo ""
echo ""
exit 1
else [[ "$1" = "idoi" ]]
# for i in */
# do
# cd $i
# echo `pwd` >> ../paths
# cd ..
# done
find . -type d | sed 1d | cut -d / -f2 | sort >> names
# cellranger count
cat idoi | while read i
do
ID=$i
G="$ID$|^R$ID|^$ID|R$ID$|$ID$"
GREP_NAME=`egrep -h $G names | xargs | sed -e 's/ /,/g'`
echo "SAMPLE_ID = $ID"
echo "FASTQ_PATH = $GREP_NAME"
# echo "SAMPLE_NAME = $GREP_NAME"
echo "-----------------------------------"
echo ""
/programs/cellranger-3.0.2/cellranger count --id=$ID \
--transcriptome=/workdir/singleCellData/10x_reference_files/refdata-cellranger-GRCh38-3.0.0/ \
--fastqs=$GREP_NAME \
--sample=$GREP_NAME \
--localcores 20 --localmem 250
done
DATE=`date +"%m_%d_%H-%M"`
mkdir CellRanger-scRNAseq-Output_${DATE}
readarray sampleIDs < idoi
for i in "${sampleIDs[@]}"
do
mv $i CellRanger-scRNAseq-Output_${DATE}
done
mv paths names idoi CellRanger-scRNAseq-Output_${DATE}
chmod -R 777 CellRanger-scRNAseq-Output_${DATE}
fi