forked from CRG-Beato/utils_beatolab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathucsc_track_hub_upload.sh
executable file
·503 lines (406 loc) · 21.7 KB
/
ucsc_track_hub_upload.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
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
#!/bin/bash
#==================================================================================================
# Created on: 2016-11-04
# Usage: ./ucsc_track_hub_upload.sh
# Author: Javier Quilez (GitHub: jaquol)
# Goal: (i) copy data to the `file_transfer` directory, which is accessible for the UCSC Genome browser
# (ii) print the sample UCSC Genome Browser custom track hub definition
#==================================================================================================
# this script is an evolution of, and aims to deprecate*, these 2 scripts:
# utils/make_ucsc_genome_browser_custom_track.sh
# utils/print_ucsc_track_hub_track_definition.sh
# *in terms of using them for uploading data to the browser
#==================================================================================================
# CONFIGURATION VARIABLES AND PATHS
#==================================================================================================
# variables
samples="rz_008_02_01_rnaseq"
data_type=rnaseq
call_peaks_mode=
project=rzaurin
# paths
python=`which python`
bed2bb=`which bedToBigBed`
bedgraph_to_bigwig=`which bedGraphToBigWig`
bedtools=`which bedtools`
narrow_peak_specification=/users/mbeato/projects/assemblies/misc/narrowPeak.as
#==================================================================================================
# COMMANDS
#==================================================================================================
echo
for s in $samples; do
echo $s
#==================================================================================================
# Retrieve metadata
#==================================================================================================
echo "... retrieving metadata"
# script to access the metadata
if [[ $project == "4DGenome" ]]; then
io_metadata=/users/project/4DGenome/utils/io_metadata.sh
else
io_metadata=/users/mbeato/projects/utils/io_metadata.sh
fi
# sample name
sample_name=`$io_metadata -m get_from_metadata -s $s -t input_metadata -a SAMPLE_NAME`
# cell line
cell_line=`$io_metadata -m get_from_metadata -s $s -t input_metadata -a CELL_TYPE`
cell_line_new=`echo ${cell_line,,} |sed "s/-/_/g"`
# treatment and treatment time
# convert to the keys/values for the treatment time into those used in the track hub
treatment=`$io_metadata -m get_from_metadata -s $s -t input_metadata -a TREATMENT`
treatment_time=`$io_metadata -m get_from_metadata -s $s -t input_metadata -a TREATMENT_TIME`
if [[ $treatment_time == '0' ]]; then treatment_time_new=t0000
elif [[ $treatment_time == '5' ]]; then treatment_time_new=t0005
elif [[ $treatment_time == '15' ]]; then treatment_time_new=t0015
elif [[ $treatment_time == '30' ]]; then treatment_time_new=t0030
elif [[ $treatment_time == '60' ]]; then treatment_time_new=t0060
elif [[ $treatment_time == '180' ]]; then treatment_time_new=t0180
elif [[ $treatment_time == '360' ]]; then treatment_time_new=t0360
elif [[ $treatment_time == '720' ]]; then treatment_time_new=t0720
elif [[ $treatment_time == '1440' ]]; then treatment_time_new=t1440
fi
# user
user=`$io_metadata -m get_from_metadata -s $s -t input_metadata -a USER`
user_new=`echo ${user,,} |sed "s/ /_/g"`
# sequencing type
sequencing_type=`$io_metadata -m get_from_metadata -s $s -t input_metadata -a SEQUENCING_TYPE`
if [[ $sequencing_type == 'SE' ]]; then
sequencing_type_long=single_end
elif [[ $sequencing_type == 'PE' ]]; then
sequencing_type_long=paired_end
fi
# species and chromosomes lengths
species=`$io_metadata -m get_from_metadata -s $s -t input_metadata -a SPECIES`
if [[ $species == "Homo_sapiens" ]]; then
version=hg38_mmtv
chrom_sizes=/users/mbeato/projects/assemblies/homo_sapiens/$version/ucsc/${version}_chr1-22XYMUn.chrom.sizes
db=hg38
elif [[ $species == "Mus_musculus" ]]; then
version=mm10
chrom_sizes=/users/mbeato/projects/assemblies/mus_musculus/$version/ucsc/${version}_chr1-19XYMUn.chrom.sizes
db=mm10
fi
# target protein (only for non-4DGenome projects)
if [[ $project != "4DGenome" ]]; then
target_protein=`$io_metadata -m get_from_metadata -s $s -t input_metadata -a TARGET_PROTEIN`
target_protein_new=`echo ${target_protein,,} |sed "s/chip-//g"`
fi
#==================================================================================================
# ChIP-seq
#==================================================================================================
if [[ $data_type == "chipseq" ]]; then
# read per per million profiles
echo "... preparing read per million profiles"
# define paths
SHARED_PATH=data/$data_type/samples/$s/profiles/$version/$sequencing_type_long
ifile=/users/mbeato/projects/$SHARED_PATH/${s}*rpm.bw
fname=`basename $ifile`
ODIR=/users/mbeato/public-docs/$SHARED_PATH
mkdir -p $ODIR
obw=$ODIR/$fname
# copy data to the `file_transfer` directory
cp $ifile $obw
# print track hub definitions
track_type=profiles
composite_track=${data_type}_$track_type
echo -e >> $composite_track.txt
echo -e "\t\ttrack ${s}_profile" >> $composite_track.txt
echo -e "\t\tparent $composite_track" >> $composite_track.txt
echo -e "\t\tbigDataUrl https://data:adenine&thymine@public_docs.crg.es/mbeato/public-docs/data/$data_type/samples/$s/$track_type/$version/$sequencing_type_long/$s.rpm.bw" >> $composite_track.txt
echo -e "\t\tshortLabel $sample_name" >> $composite_track.txt
echo -e "\t\tlongLabel $sample_name ($s) RPM profile" >> $composite_track.txt
echo -e "\t\ttype bigWig" >> $composite_track.txt
if [[ $project != "4DGenome" ]]; then
echo -e "\t\tsubGroups cell_line=$cell_line_new antibody=${target_protein_new,,} treatment_time=$treatment_time_new treatment=${treatment,,} user=$user_new" >> $composite_track.txt
else
echo -e "\t\tsubGroups cell_line=$cell_line_new treatment_time=$treatment_time_new treatment=${treatment,,} user=$user_new" >> $composite_track.txt
fi
# peaks coordinates with -log10(FDR q-value)
echo "... preparing peaks coordinates with -log10(FDR q-value)"
# define paths
SHARED_PATH=data/$data_type/samples/$s/peaks/macs2/$version/$call_peaks_mode/$sequencing_type_long
ifile=/users/mbeato/projects/$SHARED_PATH/${s}_peaks.narrowPeak
ODIR=/users/mbeato/public-docs/$SHARED_PATH
mkdir -p $ODIR
# convert to bigWig
fname=`basename $ifile |sed "s/narrowPeak/bw/g"`
tbed=$ODIR/tbed.bed
obw=$ODIR/$fname
grep -v mmtv_luciferase $ifile | cut -f1-3,9 |$bedtools groupby -i stdin -g 1,2,3 -c 4 -o mean > $tbed
$bedgraph_to_bigwig $tbed $chrom_sizes $obw
# print track hub definitions
track_type=peaks_macs2_qvalues
composite_track=${data_type}_$track_type
echo -e >> $composite_track.txt
echo -e "\t\ttrack ${s}_$track_type" >> $composite_track.txt
echo -e "\t\tparent $composite_track" >> $composite_track.txt
echo -e "\t\tbigDataUrl https://data:adenine&thymine@public_docs.crg.es/mbeato/public-docs/data/$data_type/samples/$s/peaks/macs2/$version/$call_peaks_mode/$sequencing_type_long/${s}_peaks.bw" >> $composite_track.txt
echo -e "\t\tshortLabel $sample_name" >> $composite_track.txt
if [[ $call_peaks_mode == "sample_alone" ]]; then
echo -e "\t\tlongLabel $sample_name ($s) MACS2 peaks without control, -log10(q-value)" >> $composite_track.txt
elif [[ $call_peaks_mode == "with_control" ]]; then
echo -e "\t\tlongLabel $sample_name ($s) MACS2 peaks, -log10(q-value)" >> $composite_track.txt
fi
echo -e "\t\ttype bigWig" >> $composite_track.txt
if [[ $project != "4DGenome" ]]; then
echo -e "\t\tsubGroups cell_line=$cell_line_new antibody=${target_protein_new,,} treatment_time=$treatment_time_new treatment=${treatment,,} user=$user_new" >> $composite_track.txt
else
echo -e "\t\tsubGroups cell_line=$cell_line_new treatment_time=$treatment_time_new treatment=${treatment,,} user=$user_new" >> $composite_track.txt
fi
# alignments
echo "... alignments profiles"
# define paths
SHARED_PATH=data/$data_type/samples/$s/alignments/bwa/$version/$sequencing_type_long
ifile=/users/mbeato/projects/$SHARED_PATH/${s}_sorted_filtered.bam
fname=`basename $ifile`
ODIR=/users/mbeato/public-docs/$SHARED_PATH
mkdir -p $ODIR
obam=$ODIR/$fname
# copy data to the `file_transfer` directory
cp $ifile $obam
cp $ifile.bai $ODIR
# print track hub definitions
track_type=alignments
composite_track=${data_type}_$track_type
echo -e >> $composite_track.txt
echo -e "\t\ttrack ${s}_alignments" >> $composite_track.txt
echo -e "\t\tparent $composite_track" >> $composite_track.txt
echo -e "\t\tbigDataUrl https://data:adenine&thymine@public_docs.crg.es/mbeato/public-docs/data/$data_type/samples/$s/$track_type/bwa/$version/$sequencing_type_long/${s}_sorted_filtered.bam" >> $composite_track.txt
echo -e "\t\tshortLabel $sample_name" >> $composite_track.txt
echo -e "\t\tlongLabel $sample_name ($s) alignments BAM" >> $composite_track.txt
echo -e "\t\ttype bam" >> $composite_track.txt
if [[ $project != "4DGenome" ]]; then
echo -e "\t\tsubGroups cell_line=$cell_line_new antibody=${target_protein_new,,} treatment_time=$treatment_time_new treatment=${treatment,,} user=$user_new" >> $composite_track.txt
else
echo -e "\t\tsubGroups cell_line=$cell_line_new treatment_time=$treatment_time_new treatment=${treatment,,} user=$user_new" >> $composite_track.txt
fi
echo
#==================================================================================================
# HiChIP-seq
#==================================================================================================
elif [[ $data_type == "hichipseq" ]]; then
# read per per million profiles
echo "... preparing read per million profiles"
# define paths
SHARED_PATH=data/$data_type/samples/$s/profiles/$version/$sequencing_type_long
ifile=/users/mbeato/projects/$SHARED_PATH/${s}*rpm.bw
fname=`basename $ifile`
ODIR=/users/mbeato/public-docs/$SHARED_PATH
mkdir -p $ODIR
obw=$ODIR/$fname
# copy data to the `file_transfer` directory
cp $ifile $obw
target_protein_new_no_hi=`echo ${target_protein_new,,} |sed 's/hi//g'`
# print track hub definitions
track_type=profiles
composite_track=${data_type}_$track_type
echo -e >> $composite_track.txt
echo -e "\t\ttrack ${s}_profile" >> $composite_track.txt
echo -e "\t\tparent $composite_track" >> $composite_track.txt
echo -e "\t\tbigDataUrl https://data:adenine&thymine@public_docs.crg.es/mbeato/public-docs/data/$data_type/samples/$s/$track_type/$version/$sequencing_type_long/$s.rpm.bw" >> $composite_track.txt
echo -e "\t\tshortLabel $sample_name" >> $composite_track.txt
echo -e "\t\tlongLabel $sample_name ($s) RPM profile" >> $composite_track.txt
echo -e "\t\ttype bigWig" >> $composite_track.txt
if [[ $project != "4DGenome" ]]; then
echo -e "\t\tsubGroups cell_line=$cell_line_new antibody=${target_protein_new_no_hi} treatment_time=$treatment_time_new treatment=${treatment,,} user=$user_new" >> $composite_track.txt
else
echo -e "\t\tsubGroups cell_line=$cell_line_new treatment_time=$treatment_time_new treatment=${treatment,,} user=$user_new" >> $composite_track.txt
fi
#echo >> $composite_track.txt
# peaks coordinates with -log10(FDR q-value)
echo "... preparing peaks coordinates with -log10(FDR q-value)"
# define paths
SHARED_PATH=data/$data_type/samples/$s/peaks/macs2/$version/$call_peaks_mode/$sequencing_type_long
ifile=/users/mbeato/projects/$SHARED_PATH/${s}_peaks.narrowPeak
ODIR=/users/mbeato/public-docs/$SHARED_PATH
mkdir -p $ODIR
# convert to bigWig
fname=`basename $ifile |sed "s/narrowPeak/bw/g"`
tbed=$ODIR/tbed.bed
obw=$ODIR/$fname
grep -v mmtv_luciferase $ifile | cut -f1-3,9 |$bedtools groupby -i stdin -g 1,2,3 -c 4 -o mean > $tbed
$bedgraph_to_bigwig $tbed $chrom_sizes $obw
# print track hub definitions
track_type=peaks_macs2_qvalues
composite_track=${data_type}_$track_type
echo -e >> $composite_track.txt
echo -e "\t\ttrack ${s}_$track_type" >> $composite_track.txt
echo -e "\t\tparent $composite_track" >> $composite_track.txt
echo -e "\t\tbigDataUrl https://data:adenine&thymine@public_docs.crg.es/mbeato/public-docs/data/$data_type/samples/$s/peaks/macs2/$version/$call_peaks_mode/$sequencing_type_long/${s}_peaks.bw" >> $composite_track.txt
echo -e "\t\tshortLabel $sample_name" >> $composite_track.txt
if [[ $call_peaks_mode == "sample_alone" ]]; then
echo -e "\t\tlongLabel $sample_name ($s) MACS2 peaks without control, -log10(q-value)" >> $composite_track.txt
elif [[ $call_peaks_mode == "with_control" ]]; then
echo -e "\t\tlongLabel $sample_name ($s) MACS2 peaks, -log10(q-value)" >> $composite_track.txt
fi
echo -e "\t\ttype bigWig" >> $composite_track.txt
if [[ $project != "4DGenome" ]]; then
echo -e "\t\tsubGroups cell_line=$cell_line_new antibody=${target_protein_new,,} treatment_time=$treatment_time_new treatment=${treatment,,} user=$user_new" >> $composite_track.txt
else
echo -e "\t\tsubGroups cell_line=$cell_line_new treatment_time=$treatment_time_new treatment=${treatment,,} user=$user_new" >> $composite_track.txt
fi
# alignments
echo "... alignments profiles"
# define paths
SHARED_PATH=data/$data_type/samples/$s/alignments/bwa/$version/$sequencing_type_long
ifile=/users/mbeato/projects/$SHARED_PATH/${s}_sorted_filtered.bam
fname=`basename $ifile`
ODIR=/users/mbeato/public-docs/$SHARED_PATH
mkdir -p $ODIR
obam=$ODIR/$fname
# copy data to the `file_transfer` directory
cp $ifile $obam
cp $ifile.bai $ODIR
# print track hub definitions
track_type=alignments
composite_track=${data_type}_$track_type
echo -e >> $composite_track.txt
echo -e "\t\ttrack ${s}_alignments" >> $composite_track.txt
echo -e "\t\tparent $composite_track" >> $composite_track.txt
echo -e "\t\tbigDataUrl https://data:adenine&thymine@public_docs.crg.es/mbeato/public-docs/data/$data_type/samples/$s/$track_type/bwa/$version/$sequencing_type_long/${s}_sorted_filtered.bam" >> $composite_track.txt
echo -e "\t\tshortLabel $sample_name" >> $composite_track.txt
echo -e "\t\tlongLabel $sample_name ($s) alignments BAM" >> $composite_track.txt
echo -e "\t\ttype bam" >> $composite_track.txt
if [[ $project != "4DGenome" ]]; then
echo -e "\t\tsubGroups cell_line=$cell_line_new antibody=${target_protein_new,,} treatment_time=$treatment_time_new treatment=${treatment,,} user=$user_new" >> $composite_track.txt
else
echo -e "\t\tsubGroups cell_line=$cell_line_new treatment_time=$treatment_time_new treatment=${treatment,,} user=$user_new" >> $composite_track.txt
fi
echo
#==================================================================================================
# RNA-seq or ChrRNA-seq
#==================================================================================================
elif [[ $data_type == "rnaseq" || $data_type == "chrrnaseq" ]]; then
# read per per million profiles
echo "... preparing read per million profiles"
# print track hub definitions
track_type=profiles
composite_track=${data_type}_$track_type
echo -e >> $composite_track.txt
echo -e "\ttrack ${s}_profile" >> $composite_track.txt
echo -e "\tparent $composite_track" >> $composite_track.txt
echo -e "\tcontainer multiWig" >> $composite_track.txt
echo -e "\tshortLabel $sample_name" >> $composite_track.txt
echo -e "\tlongLabel $sample_name ($s) RPM profile" >> $composite_track.txt
echo -e "\ttype bigWig" >> $composite_track.txt
echo -e "\tvisibility full" >> $composite_track.txt
echo -e "\tautoscale off" >> $composite_track.txt
echo -e "\talwaysZero on" >> $composite_track.txt
echo -e "\tviewLimits -1.0:1.0" >> $composite_track.txt
echo -e "\taggregate transparentOverlay" >> $composite_track.txt
echo -e "\tshowSubtrackColorOnUi on" >> $composite_track.txt
echo -e "\tmaxHeightPixels 100:50:10" >> $composite_track.txt
echo -e "\tcolor 0,128,0" >> $composite_track.txt
echo -e "\tpriority 6" >> $composite_track.txt
echo >> $composite_track.txt
strands="strand1 strand2"
for strand in $strands; do
# input/output filez/directories
SHARED_PATH=data/$data_type/samples/$s/profiles/$version/$sequencing_type_long
ifile=/users/mbeato/projects/$SHARED_PATH/${s}_unique_multiple_${strand}_rpm.bw
fname=`basename $ifile`
ODIR=/users/mbeato/public-docs/$SHARED_PATH
mkdir -p $ODIR
ofile=$ODIR/$fname
# copy data to the `file_transfer` directory, which is accessible for the UCSC Genome browser
cp $ifile $ofile
echo -e "\t\ttrack ${s}_profile_${strand}" >> $composite_track.txt
echo -e "\t\tparent ${s}_profile" >> $composite_track.txt
echo -e "\t\tbigDataUrl https://data:adenine&thymine@public_docs.crg.es/mbeato/public-docs/data/$data_type/samples/$s/$track_type/$version/$sequencing_type_long/${s}_unique_multiple_${strand}_rpm.bw" >> $composite_track.txt
echo -e "\t\ttype bigWig" >> $composite_track.txt
echo -e "\t\tcolor 0,128,0" >> $composite_track.txt
if [[ $strand == "strand2" ]]; then
echo -e "\t\tnegateValues on" >> $composite_track.txt
fi
echo >> $composite_track.txt
done
# alignments
echo "... alignments profiles"
# define paths
SHARED_PATH=data/$data_type/samples/$s/alignments/star/$version/$sequencing_type_long
ifile=/users/mbeato/projects/$SHARED_PATH/${s}.Aligned.sortedByCoord.out.bam
fname=`basename $ifile`
ODIR=/users/mbeato/public-docs/$SHARED_PATH
mkdir -p $ODIR
obam=$ODIR/$fname
# copy data to the `file_transfer` directory
cp $ifile $obam
cp $ifile.bai $ODIR
# print track hub definitions
track_type=alignments
composite_track=${data_type}_$track_type
echo -e >> $composite_track.txt
echo -e "\t\ttrack ${s}_alignments" >> $composite_track.txt
echo -e "\t\tparent $composite_track" >> $composite_track.txt
echo -e "\t\tbigDataUrl https://data:adenine&thymine@public_docs.crg.es/mbeato/public-docs/data/$data_type/samples/$s/$track_type/star/$version/$sequencing_type_long/${s}.Aligned.sortedByCoord.out.bam" >> $composite_track.txt
echo -e "\t\tshortLabel $sample_name" >> $composite_track.txt
echo -e "\t\tlongLabel $sample_name ($s) alignments BAM" >> $composite_track.txt
echo -e "\t\ttype bam" >> $composite_track.txt
if [[ $project != "4DGenome" ]]; then
echo -e "\t\tsubGroups cell_line=$cell_line_new antibody=${target_protein_new,,} treatment_time=$treatment_time_new treatment=${treatment,,} user=$user_new" >> $composite_track.txt
else
echo -e "\t\tsubGroups cell_line=$cell_line_new treatment_time=$treatment_time_new treatment=${treatment,,} user=$user_new" >> $composite_track.txt
fi
echo
#==================================================================================================
# ATAC-seq
#==================================================================================================
elif [[ $data_type == "atacseq" ]]; then
# read per per million profiles
echo "... preparing read per million profiles"
# define paths
SHARED_PATH=data/$data_type/samples/$s/profiles/$version/$sequencing_type_long
ifile=/users/mbeato/projects/$SHARED_PATH/${s}*rpm.bw
fname=`basename $ifile`
ODIR=/users/mbeato/public-docs/$SHARED_PATH
mkdir -p $ODIR
obw=$ODIR/$fname
# copy data to the `file_transfer` directory
cp $ifile $obw
# print track hub definitions
track_type=profiles
composite_track=${data_type}_$track_type
echo -e >> $composite_track.txt
echo -e "\t\ttrack ${s}_profile" >> $composite_track.txt
echo -e "\t\tparent $composite_track" >> $composite_track.txt
echo -e "\t\tbigDataUrl https://data:adenine&thymine@public_docs.crg.es/mbeato/public-docs/data/$data_type/samples/$s/$track_type/$version/$sequencing_type_long/$s.rpm.bw" >> $composite_track.txt
echo -e "\t\tshortLabel $sample_name" >> $composite_track.txt
echo -e "\t\tlongLabel $sample_name ($s) RPM profile" >> $composite_track.txt
echo -e "\t\ttype bigWig" >> $composite_track.txt
if [[ $project != "4DGenome" ]]; then
echo -e "\t\tsubGroups cell_line=$cell_line_new antibody=${target_protein_new,,} treatment_time=$treatment_time_new treatment=${treatment,,} user=$user_new" >> $composite_track.txt
else
echo -e "\t\tsubGroups cell_line=$cell_line_new treatment_time=$treatment_time_new treatment=${treatment,,} user=$user_new" >> $composite_track.txt
fi
#==================================================================================================
# DNAse-seq
#==================================================================================================
elif [[ $data_type == "dnaseseq" ]]; then
# read per per million profiles
echo "... preparing read per million profiles"
# define paths
SHARED_PATH=data/$data_type/samples/$s/profiles/$version/$sequencing_type_long
ifile=/users/mbeato/projects/$SHARED_PATH/${s}*rpm.bw
fname=`basename $ifile`
ODIR=/users/mbeato/public-docs/$SHARED_PATH
mkdir -p $ODIR
obw=$ODIR/$fname
# copy data to the `file_transfer` directory
cp $ifile $obw
# print track hub definitions
track_type=profiles
composite_track=${data_type}_$track_type
echo -e >> $composite_track.txt
echo -e "\t\ttrack ${s}_profile" >> $composite_track.txt
echo -e "\t\tparent $composite_track" >> $composite_track.txt
echo -e "\t\tbigDataUrl https://data:adenine&thymine@public_docs.crg.es/mbeato/public-docs/data/$data_type/samples/$s/$track_type/$version/$sequencing_type_long/$s.rpm.bw" >> $composite_track.txt
echo -e "\t\tshortLabel $sample_name" >> $composite_track.txt
echo -e "\t\tlongLabel $sample_name ($s) RPM profile" >> $composite_track.txt
echo -e "\t\ttype bigWig" >> $composite_track.txt
if [[ $project != "4DGenome" ]]; then
echo -e "\t\tsubGroups cell_line=$cell_line_new antibody=${target_protein_new,,} treatment_time=$treatment_time_new treatment=${treatment,,} user=$user_new" >> $composite_track.txt
else
echo -e "\t\tsubGroups cell_line=$cell_line_new treatment_time=$treatment_time_new treatment=${treatment,,} user=$user_new" >> $composite_track.txt
fi
fi
done