-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpancdb_Final_26_T2D_scRNA.bash
110 lines (90 loc) · 5.46 KB
/
pancdb_Final_26_T2D_scRNA.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
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/usr/bin/env bash
#=========================================================================================
# I'm going to edit this script to download each file, process the data, then
# , run fastp and salmon to clean and align the cells
#
# List of TO DO's
# - Make sure all data temp (Including FTP stuff) files are done outside of the code folder
# - Somehow $p2 is what would need to be used to keep track of the output directory
# directory that holds the data that needs to be processed
# - Use $p2 to download all the riht data
# - figure out what is wrong with the fastq folder and why isn't it being transfered over to the data_save_loc variable
# This script downloads HPAP experiments in your current working directory:
# * The data files (if requested) will be saved in "hpapdata" sub-folder;
# * Metadata files (if requested) will be saved in "metadata" sub-folder.
#
# IMPORTANT: Before starting to download experiment data, please:
# ==============================================================================
# (1) Register your SSH PUBLIC key at: https://hpap.pmacs.upenn.edu/explore/ftp
# (2) Modify "SSH_KEYFILE" on the next uncommented line to the path of your own
# SSH PRIVATE key.
# Otherwise the script WON'T work.
# Read this article on SSH public key authentication:
# https://www.ssh.com/academy/ssh/public-key-authentication
SSH_KEYFILE="/home/jon/.ssh/id_rsa"
if [[ ! -r "${SSH_KEYFILE}" ]]; then
echo "Error: SSH private key file not found"
exit 1
fi
FILES="
hpapdata/HPAP-001/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq"
# hpapdata/HPAP-007/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-010/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-013/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-051/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-057/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-058/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-061/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-065/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-070/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-079/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-081/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-083/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-085/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-088/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-090/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-091/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-096/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-100/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-106/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-108/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-109/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-111/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-120/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-124/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# hpapdata/HPAP-126/Islet Studies/Islet molecular phenotyping studies/Single-cell RNAseq/Upenn_scRNAseq/fastq
# "
# Set IFS (Internal Field Separator)
IFS_BAK=$IFS
IFS=$'\n'
for f in $FILES; do
p=$(dirname $f)
echo "f variable:"
echo "$f"
echo "p variable:"
echo "$p"
p2=${p//' '/'-'} # escape space character in dir name
data_save_loc="../Data/TestingDownload/PANCB/${p2}"
echo "File location: ${data_save_loc}"
# mkdir -p "${data_save_loc}"
f2=${f//' '/'\ '} # escape space character in file name
# sftp -i ${SSH_KEYFILE} -r [email protected]:"$f2" "$data_save_loc"
done
# Recover original IFS
IFS=$IFS_BAK
unset IFS_BAK
echo "------------------------"
echo "------------------------"
echo "------------------------"
ls "$data_save_loc"
# Todo: Standardize the meta data. Write it in your note file.
# echo; echo "$(date): experiment data downloaded"; echo
# # Download metadata files into ./metadata
# META_URL="https://hpap.pmacs.upenn.edu/assets/metadata/latest"
# test -d ./metadata || mkdir ./metadata
# cd ./metadata
# curl --silent "$META_URL/PancDB_Donors.xlsx" -O
# curl --silent "$META_URL/PancDB_scRNA-seq_metadata_2022-06-15.xlsx" -O
# curl --silent "$META_URL/README.xlsx" -O
# cd ..
# echo "$(date): metadata downloaded"