forked from melissacline/TCGA-GAF-source
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
701 lines (562 loc) · 37.2 KB
/
makefile
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
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
gaf21File = /hive/users/cline/TCGA/GAF2.1/TCGA.hg19.June2011.with_dbSNP.gaf.gz
inputDir = data/hg19-init
scratchDir = data/scratch
gafDir = data/gaf
outputBedDir = data/hg19-final
testDir = data/test
testInput = ${testDir}/input
testOutput = ${testDir}/output
transcriptTestFields = 2-5,8-9,11-13
geneTestFields = 2-5,7,9-10,12-17
#
# Genes, transcripts, exons, junctions
geneSetGaf = ${gafDir}/gene.genome.gaf ${gafDir}/transcript.genome.gaf \
${gafDir}/transcript.gene.gaf \
${gafDir}/compositeExon.genome.gaf ${gafDir}/compositeExon.gene.gaf \
${gafDir}/compositeExon.transcript.gaf \
${gafDir}/componentExon.genome.gaf ${gafDir}/componentExon.gene.gaf \
${gafDir}/componentExon.transcript.gaf \
${gafDir}/junction.genome.gaf ${gafDir}/junction.gene.gaf \
${gafDir}/junction.transcript.gaf
geneSetDiff = ${testOutput}/gene.genome.diff ${testOutput}/transcript.genome.diff \
${testOutput}/compositeExon.transcript.diff ${testOutput}/componentExon.transcript.diff \
${testOutput}/junction.transcript.diff
geneSetBB = ${outputBedDir}/gene.genome.bb ${outputBedDir}/transcript.genome.bb \
${outputBedDir}/compositeExon.genome.bb ${outputBedDir}/componentExon.genome.bb \
${outputBedDir}/junction.genome.bb
geneSet = ${geneSetGaf} ${geneSetDiff} ${geneSetBB}
#
# Pre-miRNAs, miRNAs
miRnaSetGaf = ${gafDir}/pre-miRNA.genome.gaf ${gafDir}/miRNA.genome.gaf \
${gafDir}/miRNA.pre-miRNA.gaf
miRnaSetDiff = ${testOutput}/pre-miRNA.genome.diff ${testOutput}/miRNA.genome.diff \
${testOutput}/miRNA.pre-miRNA.diff
miRnaSetBB = ${outputBedDir}/pre-miRNA.genome.bb ${outputBedDir}/miRNA.genome.bb
miRnaSet = ${miRnaSetGaf} ${miRnaSetDiff} ${miRnaSetBB}
#
# Probe sets
probeSetGaf = ${gafDir}/MAprobe.genome.gaf ${gafDir}/MAprobe.transcript.gaf \
${gafDir}/MAprobe.pre-miRNA.gaf ${gafDir}/MAprobe.miRNA.gaf ${gafDir}/AffySNP.genome.gaf
probeSetDiff = ${testOutput}/MAprobe.genome.diff ${testOutput}/MAprobe.transcript.diff \
${testOutput}/MAprobe.pre-miRNA.diff ${testOutput}/MAprobe.miRNA.diff \
${testOutput}/AffySNP.genome.diff
probeSetBB = ${outputBedDir}/MAprobe.genome.bb ${outputBedDir}/AffySNP.genome.bb
probeSet = ${probeSetGaf} ${probeSetDiff} ${probeSetBB}
snpSetGaf = ${gafDir}/dbSNP.genome.gaf
snpSetDiff = ${testOutput}/dbSNP.genome.diff
snpSetBB = ${testOutput}/dbSNP.genome.bb
supersetGaf = ${gafDir}/geneSet.gaf ${gafDir}/miRnaSet.gaf ${gafDir}/probeSet.gaf \
${gafDir}/dbSNP.genome.gaf
all: ${geneSet} ${miRnaSet} ${probeSet} ${snpSet} ${gafDir}/superset.gaf
${gafDir}/superset.gaf: ${supersetGaf}
cat ${supersetGaf} | cut -f2- |perl -pe '$$_ = "$$.\t$$_"' > $@
${gafDir}/geneSet.gaf: ${geneSetGaf}
cat ${geneSetGaf} | cut -f2- |perl -pe '$$_ = "$$.\t$$_"' > $@
${testOutput}/gene.genome.diff: ${testInput}/gene.genome.2.1.gaf ${testInput}/gene.genome.3.0.gaf
cat ${testInput}/gene.genome.2.1.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$5, $$6, $$7, $$9, $$10, $$12, $$13, $$14, $$15, $$16, $$17 }' \
> ${scratchDir}/gene.genome.2.1.subset
cat ${testInput}/gene.genome.3.0.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$5, $$6, $$7, $$9, $$10, $$12, $$13, $$14, $$15, $$16, $$17 }' \
> ${scratchDir}/gene.genome.3.0.subset
diff ${scratchDir}/gene.genome.2.1.subset ${scratchDir}/gene.genome.3.0.subset > $@
${testInput}/gene.genome.3.0.gaf: ${gafDir}/gene.genome.gaf ${testDir}/testGenes.txt
cat ${testDir}/testGenes.txt \
| awk '{ print "grep \"" $$1 "|" $$2 "\" ${gafDir}/gene.genome.gaf"}' |bash \
> $@
${testInput}/gene.genome.2.1.gaf: ${scratchDir}/gene.genome.gaf21.gaf
cat ${testDir}/testGenes.txt \
| awk '{ print "grep \"" $$1 "|" $$2 "\" ${scratchDir}/gene.genome.gaf21.gaf"}' |bash > $@
${scratchDir}/gene.genome.gaf21.gaf: ${testDir}/testGenes.txt
zcat ${gaf21File} \
| awk -F'\t' '$$3 == "gene" && $$9 == "genome" { print }' \
> ${scratchDir}/gene.genome.gaf21.gaf
${gafDir}/gene.genome.gaf: ${inputDir}/gene.genome.bed
liftOver $< data/GRCh37-lite/hg19.GRCh37-lite.over.chain ${scratchDir}/gene.genome.preGaf.GRCh37-lite.bed /dev/null
hgsql hg19 < sql/gafGeneXref.sql
scripts/geneToGeneXref.py $< ${scratchDir}/gene.genome.preGaf.GRCh37-lite.bed
scripts/makeGeneSet.py ${scratchDir}/gene.genome.preGaf.GRCh37-lite.bed |sort -k2,2 > $@
${testOutput}/transcript.genome.diff: ${testInput}/transcript.genome.2.1.gaf ${testInput}/transcript.genome.3.0.gaf
cat ${testInput}/transcript.genome.2.1.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$5, $$9, $$10, $$12, $$13, $$14, $$15 }' \
> ${scratchDir}/transcript.genome.2.1.subset
cat ${testInput}/transcript.genome.3.0.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$5, $$9, $$10, $$12, $$13, $$14, $$15 }' \
> ${scratchDir}/transcript.genome.3.0.subset
diff ${scratchDir}/transcript.genome.2.1.subset ${scratchDir}/transcript.genome.3.0.subset > $@
${testInput}/transcript.genome.3.0.gaf: ${gafDir}/transcript.genome.gaf ${testDir}/testTranscripts.txt
cat ${testDir}/testTranscripts.txt \
| awk '{ print "grep", $$1, "${gafDir}/transcript.genome.gaf"}' |bash > $@
${testInput}/transcript.genome.2.1.gaf: ${testDir}/testTranscripts.txt ${scratchDir}/transcript.genome.gaf21.gaf
cat ${testDir}/testTranscripts.txt \
| awk '{ print "grep", $$1, "${scratchDir}/transcript.genome.gaf21.gaf"}' | bash > $@
${scratchDir}/transcript.genome.gaf21.gaf:
zcat ${gaf21File} \
| awk -F'\t' '$$3 == "transcript" && $$9 == "genome" { print }' > $@
${gafDir}/transcript.genome.gaf: ${inputDir}/transcript.genome.bed ${gafDir}/gene.genome.gaf
liftOver $< data/GRCh37-lite/hg19.GRCh37-lite.over.chain ${scratchDir}/transcript.genome.preGaf.GRCh37-lite.bed /dev/null
scripts/makeTranscriptSet.py ${scratchDir}/transcript.genome.preGaf.GRCh37-lite.bed |sort > $@
${testOutput}/transcript.gene.diff: ${testInput}/transcript.gene.2.1.gaf ${testInput}/transcript.gene.3.0.gaf
cat ${testInput}/transcript.gene.2.1.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$5, $$8, $$9, $$10, $$11, $$12, $$13, $$14, $$15, $$16, $$17, $$18 }' \
> ${testInput}/transcript.gene.2.1.subset
cat ${testInput}/transcript.gene.3.0.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$5, $$8, $$9, $$10, $$11, $$12, $$13, $$14, $$15, $$16, $$17, $$18 }' \
> ${testInput}/transcript.gene.3.0.subset
diff ${testInput}/transcript.gene.2.1.subset ${testInput}/transcript.gene.3.0.subset > $@
${testInput}/transcript.gene.3.0.gaf: ${testInput}/transcript.genome.3.0.gaf ${testInput}/gene.genome.3.0.gaf
scripts/featureToComposite.py ${testInput}/transcript.genome.3.0.gaf ${testInput}/gene.genome.3.0.gaf |sort -k2,2 > $@
${testInput}/transcript.gene.2.1.gaf: ${scratchDir}/transcript.gene.2.1.gaf ${testDir}/testTranscripts.txt
cat ${testDir}/testTranscripts.txt |awk '{print "grep", $$1, "${scratchDir}/transcript.gene.2.1.gaf"}' |bash > ${scratchDir}/transcript.gene.2.1.superset.gaf
cat ${testDir}/testGenes.txt |awk '{ print "grep -w \"" $$1 "|" $$2 "\" ${scratchDir}/transcript.gene.2.1.superset.gaf"}' |bash |sort -k2,2 > $@
rm ${scratchDir}/transcript.gene.2.1.superset.gaf
${scratchDir}/transcript.gene.2.1.gaf:
zcat ${gaf21File} \
| awk -F'\t' '$$3 == "transcript" && $$9 == "gene" { print }' > $@
${gafDir}/transcript.gene.gaf: ${gafDir}/transcript.genome.gaf ${gafDir}/gene.genome.gaf
scripts/featureToComposite.py ${gafDir}/transcript.genome.gaf ${gafDir}/gene.genome.gaf > $@
${testOutput}/componentExon.transcript.diff: ${testInput}/componentExon.transcript.2.1.gaf ${testInput}/componentExon.transcript.3.0.gaf
cat ${testInput}/componentExon.transcript.2.1.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$5, $$8, $$9, $$10, $$11, $$13, $$14, $$15, $$16, $$17, $$18 }' \
> ${testInput}/componentExon.transcript.2.1.subset
cat ${testInput}/componentExon.transcript.3.0.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$5, $$8, $$9, $$10, $$11, $$13, $$14, $$15, $$16, $$17, $$18 }' \
> ${testInput}/componentExon.transcript.3.0.subset
diff ${testInput}/componentExon.transcript.2.1.subset ${testInput}/componentExon.transcript.3.0.subset > $@
${testInput}/componentExon.transcript.3.0.gaf: ${testInput}/componentExon.genome.3.0.gaf ${testInput}/transcript.genome.3.0.gaf
scripts/featureToComposite.py ${testInput}/componentExon.genome.3.0.gaf ${testInput}/transcript.genome.3.0.gaf |sort -k2,2 |uniq > $@
${testInput}/componentExon.genome.3.0.gaf: ${gafDir}/componentExon.genome.gaf ${testDir}/testGenes.txt
cat ${testDir}/testGenes.txt \
| awk '{ print "grep", $$1, "${gafDir}/componentExon.genome.gaf"}' |bash |sort -k2,2 |uniq > $@
${testInput}/componentExon.transcript.2.1.gaf: ${scratchDir}/componentExon.transcript.2.1.gaf ${testDir}/testTranscripts.txt ${testDir}/testGenes.txt
cat ${testDir}/testTranscripts.txt \
|awk '{print "grep", $$1, "${scratchDir}/componentExon.transcript.2.1.gaf"}' \
|bash > ${scratchDir}/componentExon.transcript.2.1.superset.gaf
cat ${testDir}/testGenes.txt |awk '{ print "grep -w \"" $$1 "|" $$2 "\" ${scratchDir}/componentExon.transcript.2.1.superset.gaf"}' \
|bash |sort -k2,2 |uniq > $@
rm ${scratchDir}/componentExon.transcript.2.1.superset.gaf
${scratchDir}/componentExon.transcript.2.1.gaf:
zcat ${gaf21File} \
| awk -F'\t' '$$3 == "componentExon" && $$9 == "transcript" { print }' > $@
${gafDir}/componentExon.transcript.gaf: ${gafDir}/componentExon.genome.gaf ${gafDir}/transcript.genome.gaf
scripts/featureToComposite.py ${gafDir}/componentExon.genome.gaf ${gafDir}/transcript.genome.gaf > $@
${gafDir}/componentExon.gene.gaf: ${gafDir}/componentExon.genome.gaf ${gafDir}/gene.genome.gaf
scripts/featureToComposite.py ${gafDir}/componentExon.genome.gaf ${gafDir}/gene.genome.gaf > $@
${testOutput}/compositeExon.transcript.diff: ${testInput}/compositeExon.transcript.2.1.gaf ${testInput}/compositeExon.transcript.3.0.gaf
cat ${testInput}/compositeExon.transcript.2.1.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$5, $$8, $$9, $$10, $$11, $$13, $$14, $$15, $$16, $$17, $$18, $$19 }' \
> ${testInput}/compositeExon.transcript.2.1.subset
cat ${testInput}/compositeExon.transcript.3.0.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$5, $$8, $$9, $$10, $$11, $$13, $$14, $$15, $$16, $$17, $$18, $$19 }' \
> ${testInput}/compositeExon.transcript.3.0.subset
diff ${testInput}/compositeExon.transcript.2.1.subset ${testInput}/compositeExon.transcript.3.0.subset > $@
${testInput}/compositeExon.transcript.3.0.gaf: ${testInput}/compositeExon.genome.3.0.gaf ${testInput}/transcript.genome.3.0.gaf
scripts/featureToComposite.py ${testInput}/compositeExon.genome.3.0.gaf ${testInput}/transcript.genome.3.0.gaf |sort -k2,2 |uniq > $@
${gafDir}/compositeExon.gene.gaf: ${gafDir}/compositeExon.genome.gaf ${gafDir}/gene.genome.gaf
scripts/featureToComposite.py ${gafDir}/compositeExon.genome.gaf ${gafDir}/gene.genome.gaf > $@
${testInput}/compositeExon.genome.3.0.gaf: ${gafDir}/compositeExon.genome.gaf ${testDir}/testGenes.txt
cat ${testDir}/testGenes.txt \
| awk '{ print "grep", $$1, "${gafDir}/compositeExon.genome.gaf"}' \
| bash |sort -k2,2 |uniq > $@
${testInput}/compositeExon.transcript.2.1.gaf: ${scratchDir}/compositeExon.transcript.2.1.gaf ${testDir}/testTranscripts.txt ${testDir}/testGenes.txt
cat ${testDir}/testTranscripts.txt \
|awk '{print "grep", $$1, "${scratchDir}/compositeExon.transcript.2.1.gaf"}' \
|bash > ${scratchDir}/compositeExon.transcript.2.1.superset.gaf
cat ${testDir}/testGenes.txt |awk '{ print "grep -w \"" $$1 "|" $$2 "\" ${scratchDir}/compositeExon.transcript.2.1.superset.gaf"}' \
|bash |sort -k2,2 > $@
rm ${scratchDir}/compositeExon.transcript.2.1.superset.gaf
${scratchDir}/compositeExon.transcript.2.1.gaf:
zcat ${gaf21File} \
| awk -F'\t' '$$3 == "compositeExon" && $$9 == "transcript" { print }' > $@
${gafDir}/compositeExon.transcript.gaf: ${gafDir}/compositeExon.genome.gaf ${gafDir}/transcript.genome.gaf
scripts/featureToComposite.py ${gafDir}/compositeExon.genome.gaf ${gafDir}/transcript.genome.gaf > $@
${testOutput}/junction.transcript.diff: ${testInput}/junction.transcript.2.1.gaf ${testInput}/junction.transcript.3.0.gaf
cat ${testInput}/junction.transcript.2.1.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$5, $$8, $$9, $$10, $$11, $$13, $$14, $$15, $$16, $$17, $$18, $$19 }' \
|sort |uniq > ${testInput}/junction.transcript.2.1.subset
cat ${testInput}/junction.transcript.3.0.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$5, $$8, $$9, $$10, $$11, $$13, $$14, $$15, $$16, $$17, $$18, $$19 }' \
|sort |uniq > ${testInput}/junction.transcript.3.0.subset
diff ${testInput}/junction.transcript.2.1.subset ${testInput}/junction.transcript.3.0.subset > $@
${testInput}/junction.transcript.3.0.gaf: ${testInput}/junction.genome.3.0.gaf ${testInput}/transcript.genome.3.0.gaf
cat ${testDir}/testTranscripts.txt \
|awk '{print "grep", $$1, "${gafDir}/junction.transcript.gaf"}' \
|bash > ${scratchDir}/junction.transcript.3.0.superset.gaf
cat ${testDir}/testGenes.txt |awk '{ print "grep -w \"" $$1 "|" $$2 "\" ${scratchDir}/junction.transcript.3.0.superset.gaf"}' \
|bash |sort -k2,2 |uniq> $@
rm ${scratchDir}/junction.transcript.3.0.superset.gaf
${testInput}/junction.transcript.2.1.gaf: ${scratchDir}/junction.transcript.2.1.gaf ${testDir}/testTranscripts.txt
cat ${testDir}/testTranscripts.txt \
|awk '{print "grep", $$1, "${scratchDir}/junction.transcript.2.1.gaf"}' \
|bash > ${scratchDir}/junction.transcript.2.1.superset.gaf
cat ${testDir}/testGenes.txt |awk '{ print "grep -w \"" $$1 "|" $$2 "\" ${scratchDir}/junction.transcript.2.1.superset.gaf"}' \
|bash |sort -k2,2 |uniq > $@
rm ${scratchDir}/junction.transcript.2.1.superset.gaf
${scratchDir}/junction.transcript.2.1.gaf:
zcat ${gaf21File} \
| awk -F'\t' '$$3 == "junction" && $$9 == "transcript" { print }' > $@
${gafDir}/junction.transcript.gaf: ${gafDir}/junction.genome.gaf ${gafDir}/transcript.genome.gaf
scripts/junctionToTranscript.py ${gafDir}/junction.genome.gaf ${gafDir}/transcript.genome.gaf > $@
${gafDir}/junction.gene.gaf: ${gafDir}/junction.genome.gaf ${gafDir}/gene.genome.gaf
scripts/featureToComposite.py ${gafDir}/junction.genome.gaf ${gafDir}/gene.genome.gaf > $@
${testDir}/testGenes.txt ${testDir}/testTranscripts.txt: sql/geneTestSet.sql
rm ${testDir}/testGenes.txt ${testDir}/testTranscripts.txt
hgsql hg19 < sql/geneTestSet.sql
${outputBedDir}/%.bb: ${gafDir}/%.gaf
scripts/gafToBed.py $< |sort -k1,1 -k2,2n > ${scratchDir}/$*.postGaf.GRCh37-lite.bed
liftOver ${scratchDir}/$*.postGaf.GRCh37-lite.bed data/GRCh37-lite/GRCh37-lite.hg19.over.chain ${scratchDir}/$*.postGaf.hg19.bed /dev/null
-bedToBigBed ${scratchDir}/$*.postGaf.hg19.bed /hive/data/genomes/hg19/chrom.sizes $@
${gafDir}/componentExon.genome.gaf: ${inputDir}/componentExon.genome.bed ${gafDir}/gene.genome.gaf
liftOver $< data/GRCh37-lite/hg19.GRCh37-lite.over.chain ${scratchDir}/componentExon.genome.preGaf.GRCh37-lite.bed /dev/null
scripts/makeExonSet.py -t componentExon ${scratchDir}/componentExon.genome.preGaf.GRCh37-lite.bed |sort > $@
${gafDir}/compositeExon.genome.gaf: ${inputDir}/compositeExon.genome.bed ${gafDir}/gene.genome.gaf
liftOver $< data/GRCh37-lite/hg19.GRCh37-lite.over.chain ${scratchDir}/compositeExons.preGaf.GRCh37-lite.bed /dev/null
scripts/makeExonSet.py -t compositeExon ${scratchDir}/compositeExons.preGaf.GRCh37-lite.bed |sort > $@
${gafDir}/junction.genome.gaf: ${inputDir}/transcript.genome.bed ${gafDir}/gene.genome.gaf
liftOver ${inputDir}/transcript.genome.bed data/GRCh37-lite/hg19.GRCh37-lite.over.chain ${scratchDir}/transcripts.preGaf.GRCh37-lite.bed /dev/null
scripts/makeJunctionGenome.py ${scratchDir}/transcripts.preGaf.GRCh37-lite.bed |sort |uniq > $@
rm ${scratchDir}/transcripts.preGaf.GRCh37-lite.bed
${inputDir}/componentExon.genome.bed ${inputDir}/compositeExon.genome.bed ${inputDir}/transcript.genome.bed ${inputDir}/gene.genome.bed: src/transcriptsToGenesAndExons
src/transcriptsToGenesAndExons \
hg19 knownGene knownIsoformsClustersMerged \
${inputDir}/componentExon.genome.bed ${inputDir}/compositeExon.genome.bed \
${inputDir}/transcript.genome.bed ${inputDir}/gene.genome.bed
#
# miRNA data
#
${gafDir}/miRnaSet.gaf: ${miRnaSetGaf}
cat ${miRnaSetGaf} | cut -f2- |perl -pe '$$_ = "$$.\t$$_"' > $@
#
# When comparing the new pre-miRNA data to the old, don't look at the strand because
# miRBase has changed the strands for many miRNAs. The previous GAF used the
# accession (MI0022552) while the current GAF uses the ID
# (MI0022552_1), so adapt accordingly. Also don't look at the gene name
# or gene locus field, because no gene assignment was made in a lot of the old
# miRBase records.
${testOutput}/pre-miRNA.genome.diff: ${testInput}/pre-miRNA.genome.2.1.gaf ${testInput}/pre-miRNA.genome.3.0.gaf
cat ${testInput}/pre-miRNA.genome.2.1.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$9, $$10, $$12, $$13, $$14, $$15}' \
| sed 's/:+//' |sed 's/:-//' > ${scratchDir}/pre-miRNA.genome.2.1.subset
cat ${testInput}/pre-miRNA.genome.3.0.gaf \
| awk -F'\t' '{ split($$2, tokens, "_"); print tokens[1], $$3, $$4, $$9, $$10, $$12, $$13, $$14, $$15}' \
| sed 's/:+//' |sed 's/:-//' > ${scratchDir}/pre-miRNA.genome.3.0.subset
diff ${scratchDir}/pre-miRNA.genome.2.1.subset ${scratchDir}/pre-miRNA.genome.3.0.subset > $@
${testInput}/pre-miRNA.genome.2.1.gaf: ${testDir}/testPreMiRna.txt ${scratchDir}/pre-miRNA.genome.gaf21.gaf
cat ${testDir}/testPreMiRna.txt \
| awk '{ print "grep \"" $$1 "|\" ${scratchDir}/pre-miRNA.genome.gaf21.gaf"}' | bash > $@
${testInput}/pre-miRNA.genome.3.0.gaf: ${testDir}/testPreMiRna.txt ${gafDir}/pre-miRNA.genome.gaf
cat ${testDir}/testPreMiRna.txt \
| awk '{ print "grep \"" $$1 "|\" ${gafDir}/pre-miRNA.genome.gaf"}' | bash > $@
${scratchDir}/pre-miRNA.genome.gaf21.gaf:
zcat ${gaf21File} \
| awk -F'\t' '$$3 == "pre-miRNA" && $$9 == "genome" { print }' > $@
#
# After making the pre-miRNA GAF data, add the genes to the
${gafDir}/pre-miRNA.genome.gaf: ${inputDir}/pre-miRNA.genome.bed
liftOver ${inputDir}/pre-miRNA.genome.bed data/GRCh37-lite/hg19.GRCh37-lite.over.chain ${scratchDir}/pre-miRNA.genome.preGaf.GRCh37-lite.bed /dev/null
scripts/makePreMiRna.py ${scratchDir}/pre-miRNA.genome.preGaf.GRCh37-lite.bed data/miRNA.dat |sort -k2,2 > ${scratchDir}/pre-miRNA.genome.uncombined.gaf
scripts/combineFeatures.py < ${scratchDir}/pre-miRNA.genome.uncombined.gaf > $@
scripts/preMiRnaToGeneXref.py $< $@
${inputDir}/pre-miRNA.genome.bed: data/hsa.gff3
scripts/gffToBed.py -t miRNA_primary_transcript -n Name,ID $< \
| sed 's/,/|/g' > $@
#
# The list of test pre-miRNAs is created as follows:
#
# awk '{ split($2, tokens, "|"); print tokens[1]}' < ../gaf/pre-miRNA.genome.gaf \
# | sort > preMiRna.old.txt
# awk '{ split($2, tokens, "|"); print tokens[1]}' \
# < ../scratch/pre-miRNA.genome.gaf21.gaf |sort > preMiRna.new.txt
# join preMiRna.old.txt preMiRna.new.txt |wc
# 889 889 11492
# join preMiRna.old.txt preMiRna.new.txt |head -250 > testPreMiRna.txt
# When looking at the miRNA.genome records, don't look at the miRBase
# ID (the part that begins 'hsa'), or the strand, because those have
# been changed by miRBase in many cases. In the second half of the
# ID, beware that the old version used the miRBase accession
# (MIMAT0000062) while the new version uses the miRBase ID
# (MIMAT0000062_2). Adapt accordingly. Also don't look at cases
# where multiple miRNAs have been combined into a single entry,
# because there is nothing to ensure that the order of the entries is
# unchanged since the last GAF build.
${testOutput}/miRNA.genome.diff: ${testInput}/miRNA.genome.2.1.gaf ${testInput}/miRNA.genome.3.0.gaf
cat ${testInput}/miRNA.genome.2.1.gaf \
| awk -F'\t' '{ split($$2, tokens, "|"); print tokens[2], $$3, $$4, $$9, $$10, $$12, $$13, $$14, $$15, $$16, $$17}' \
|sed 's/:-//g' |sed s'/:+//g' |grep -v ";" |sort \
> ${scratchDir}/miRNA.genome.2.1.subset
cat ${testInput}/miRNA.genome.3.0.gaf \
| awk -F'\t' '{ split($$2, tokens, "|"); split(tokens[2], subtokens, "_"); print subtokens[1], $$3, $$4, $$9, $$10, $$12, $$13, $$14, $$15, $$16, $$17}' \
|sed 's/:-//g' |sed s'/:+//g' |grep -v ";" |sort \
> ${scratchDir}/miRNA.genome.3.0.subset
diff ${scratchDir}/miRNA.genome.2.1.subset ${scratchDir}/miRNA.genome.3.0.subset > $@
${testInput}/miRNA.genome.2.1.gaf: ${testDir}/testPreMiRna.txt ${scratchDir}/miRNA.genome.gaf21.gaf
cat ${testDir}/testPreMiRna.txt \
| awk '{ print "grep \"" $$1 "|\" ${scratchDir}/miRNA.genome.gaf21.gaf"}' | bash > $@
${testInput}/miRNA.genome.3.0.gaf: ${testDir}/testPreMiRna.txt ${gafDir}/miRNA.genome.gaf
cat ${testDir}/testPreMiRna.txt \
| awk '{ print "grep \"" $$1 "|\" ${gafDir}/miRNA.genome.gaf"}' | bash > $@
${scratchDir}/miRNA.genome.gaf21.gaf:
zcat ${gaf21File} \
| awk -F'\t' '$$3 == "miRNA" && $$9 == "genome" { print }' > $@
${gafDir}/miRNA.genome.gaf: ${inputDir}/miRNA.genome.bed data/hsa.gff3
liftOver ${inputDir}/miRNA.genome.bed data/GRCh37-lite/hg19.GRCh37-lite.over.chain ${scratchDir}/miRNA.genome.preGaf.GRCh37-lite.bed /dev/null
scripts/makeMiRna.py ${scratchDir}/miRNA.genome.preGaf.GRCh37-lite.bed data/hsa.gff3 |sed 's/|/ /' \
|sort -k3,13 |sed 's/ /|/' > ${scratchDir}/miRNA.genome.uncombined.gaf
scripts/combineMiRnas.py ${scratchDir}/miRNA.genome.uncombined.gaf > $@
${inputDir}/miRNA.genome.bed: data/hsa.gff3
scripts/gffToBed.py -t miRNA -n ID $< > $@
#
# When looking at the miRNA.genome records, don't look at the following things,
# that are known to have changed since the last release:
# - the strand. In this case, it appears in the locus string.
# - As consequence, the composite coordinates are often off. If a miRNA was
# at the 5' end of a pre-miRNA and the strand changed but the coordinates
# stayed the same, this miRNA is now at the 3' end of the pre-miRNA.
# - the miRBase name, the part that begins 'hsa'. These are recognizable from
# miRBase 15, but many have a new suffix (*-1, *-2) to distinguish paralogs
# - the old GAF file used miRNA accessions (MIMAT0000263, MI0000282) as part of
# the name. The new one uses miRNA IDs (MIMAT0000263_1, MI0000282_1).
# Adapt accordingly.
${testOutput}/miRNA.pre-miRNA.diff: ${testInput}/miRNA.pre-miRNA.2.1.gaf ${testInput}/miRNA.pre-miRNA.3.0.gaf
cat ${testInput}/miRNA.pre-miRNA.2.1.gaf \
| awk -F'\t' '{ split($$2, tokens, "|"); print tokens[2], $$3, $$4, $$8, $$9, $$10, $$13, $$14, $$16, $$17 }' \
|sed 's/:-//g' |sed s'/:+//g' |grep -v ";" |sort -k1,1 -k8,8 \
> ${scratchDir}/miRNA.pre-miRNA.2.1.subset
cat ${testInput}/miRNA.pre-miRNA.3.0.gaf \
| awk -F'\t' '{ split($$2, tokens, "|"); split(tokens[2], subtokens, "_"); split($$8, preMiRnaTokens, "_"); print subtokens[1], $$3, $$4, preMiRnaTokens[1], $$9, $$10, $$13, $$14, $$16, $$17}' \
|sed 's/:-//g' |sed s'/:+//g' |grep -v ";" |sort -k1,1 -k8,8 \
> ${scratchDir}/miRNA.pre-miRNA.3.0.subset
diff ${scratchDir}/miRNA.pre-miRNA.2.1.subset ${scratchDir}/miRNA.pre-miRNA.3.0.subset > $@
${testInput}/miRNA.pre-miRNA.2.1.gaf: ${testDir}/testPreMiRna.txt ${scratchDir}/miRNA.pre-miRNA.gaf21.gaf
cat ${testDir}/testPreMiRna.txt \
| awk '{ print "grep \"" $$1 "|\" ${scratchDir}/miRNA.pre-miRNA.gaf21.gaf"}' | bash > $@
${testInput}/miRNA.pre-miRNA.3.0.gaf: ${testDir}/testPreMiRna.txt ${gafDir}/miRNA.pre-miRNA.gaf
cat ${testDir}/testPreMiRna.txt \
| awk '{ print "grep \"" $$1 "|\" ${gafDir}/miRNA.pre-miRNA.gaf"}' | bash > $@
${scratchDir}/miRNA.pre-miRNA.gaf21.gaf:
zcat ${gaf21File} \
| awk -F'\t' '$$3 == "miRNA" && $$9 == "pre-miRNA" { print }' > $@
${gafDir}/miRNA.pre-miRNA.gaf: ${gafDir}/miRNA.genome.gaf ${gafDir}/pre-miRNA.genome.gaf
scripts/miRnasToPreMiRnas.py ${scratchDir}/miRNA.genome.uncombined.gaf ${gafDir}/pre-miRNA.genome.gaf > $@
#
# dbSNP
#
#
# When comparing SNPs
# - don't look at any SNPs with multiple alignments, since it cannot be
# guaranteed that the alignments appear in the same order in the
# old and new versions. To test this, look for a strand indicator
# followed immediately by a semicolon, i.e. :+; or :-;
# - for now, don't look at the gene or gene locus field. The reason: too many
# genes are changed between builds, and while we really should screen for
# SNPs with annotations of unchanged genes or no genes, we'll have to settle
# for not looking at fields 15 and 16.
${testOutput}/dbSNP.genome.diff: ${testInput}/dbSNP.genome.2.1.gaf ${testInput}/dbSNP.genome.3.0.gaf
-cat ${testInput}/dbSNP.genome.2.1.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$6, $$7, $$9, $$10, $$12, $$13, $$14, $$18, $$19}' \
| grep -v -e ":[+|-];" > ${scratchDir}/dbSNP.genome.2.1.subset
-cat ${testInput}/dbSNP.genome.3.0.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$6, $$7, $$9, $$10, $$12, $$13, $$14, $$18, $$19}' \
| grep -v ":[+|-];" > ${scratchDir}/dbSNP.genome.3.0.subset
diff ${scratchDir}/dbSNP.genome.2.1.subset ${scratchDir}/dbSNP.genome.3.0.subset > $@
${testInput}/dbSNP.genome.3.0.gaf: ${inputDir}/dbSNP-test.genome.bed
liftOver $< data/GRCh37-lite/hg19.GRCh37-lite.over.chain ${scratchDir}/dbSNP-test.genome.preGaf.GRCh37-lite.bed /dev/null
scripts/makeDbSnp.py ${scratchDir}/dbSNP-test.genome.preGaf.GRCh37-lite.bed $< > $@
#scripts/makeDbSnp.py ${scratchDir}/dbSNP-test.genome.preGaf.GRCh37-lite.bed $< > ${scratchDir}/dbSNP-test.genome.raw.gaf
#cat ${scratchDir}/dbSNP-test.genome.raw.gaf \
#|sort -k2,2 |scripts/combineSnps.py > $@
${inputDir}/dbSNP-test.genome.bed: ${testDir}/testDbSnp.txt
-cat $< \
| awk '{ print "grep -w \"" $$1 "\" ${inputDir}/dbSNP.genome.bed"}' \
| bash > $@
${testInput}/dbSNP.genome.2.1.gaf: ${testDir}/testDbSnp.txt ${scratchDir}/dbSNP.genome.gaf21.gaf
-cat ${testDir}/testDbSnp.txt \
| awk '{ print "grep -w \"" $$1 "\" ${scratchDir}/dbSNP.genome.gaf21.gaf"}' | bash > $@
${scratchDir}/dbSNP.genome.gaf21.gaf:
zcat ${gaf21File} \
| awk -F'\t' '$$3 == "dbSNP" && $$9 == "genome" { print }' > $@
#${testDir}/testDbSnp.txt:
# head -500 ${scratchDir}/dbSNP.genome.gaf21.gaf \
# | awk -F'\t' '$15 !~ ";" { print $2 }' > $@
${gafDir}/dbSNP.genome.gaf: ${inputDir}/dbSNP.genome.bed ${gafDir}/gene.genome.gaf
liftOver $< data/GRCh37-lite/hg19.GRCh37-lite.over.chain ${scratchDir}/dbSNP.genome.preGaf.GRCh37-lite.bed /dev/null
scripts/makeDbSnp.py ${scratchDir}/dbSNP.genome.preGaf.GRCh37-lite.bed $< > ${scratchDir}/dbSNP.raw.gaf
rm ${scratchDir}/dbSNP.genome.preGaf.GRCh37-lite.bed
cat ${scratchDir}/dbSNP.raw.gaf |sort -k2,2 | scripts/combineSnps.py > $@
#
# MAProbe
${gafDir}/probeSet.gaf: ${probeSetGaf}
cat ${probeSetGaf} | cut -f2- |perl -pe '$$_ = "$$.\t$$_"' > $@
data/MAprobe.hg19.bed: ${gafDir}/MAprobe.genome.gaf
scripts/gafToBed.py $< > ${scratchDir}/MAprobe.postGaf.GRCh37-lite.bed
liftOver ${scratchDir}/MAprobe.postGaf.GRCh37-lite.bed data/GRCh37-lite/GRCh37-lite.hg19.over.chain $@ /dev/null
hgLoadBed hg19 gafMaProbe $@
#
# When comparing old and new versions of the MAprobe genomic alignments, don't look at:
# - the gene and gene locus fields, because a large proportion have changed.
# - minus strand entries, because there is a bug in the old data such that some
# entries are given with backwards minus strand coordinates (i.e. coordinates not
# in increasing order w.r.t. the positive strand)
# - entries with multiple alignments, because there's no guarantee that we'll combine
# the composite strings in the same order as the old data.
# - don't look at the gene ($$16) or gene locus ($$17) fields, which didn't
# seem to be populated in the gaf2.1 data
#
${testOutput}/MAprobe.genome.diff: ${testInput}/MAprobe.genome.2.1.gaf ${testInput}/MAprobe.genome.3.0.gaf
cat ${testInput}/MAprobe.genome.2.1.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$5, $$6, $$7, $$9, $$10, $$12, $$13, $$14, $$15, $$18, $$19 }' \
| grep -v ";" |grep -v ":-" |sort > ${scratchDir}/MAprobe.genome.2.1.subset
cat ${testInput}/MAprobe.genome.3.0.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$5, $$6, $$7, $$9, $$10, $$12, $$13, $$14, $$15, $$18, $$19 }' \
|grep -v ";" |grep -v ":-" |sort > ${scratchDir}/MAprobe.genome.3.0.subset
diff ${scratchDir}/MAprobe.genome.2.1.subset ${scratchDir}/MAprobe.genome.3.0.subset > $@
${testInput}/MAprobe.genome.3.0.gaf: ${gafDir}/MAprobe.genome.gaf ${testDir}/testMaProbe.txt
cat ${testDir}/testMaProbe.txt \
| awk '{ print "grep -w", $$1, "${gafDir}/MAprobe.genome.gaf"}' \
| bash > $@
${gafDir}/MAprobe.genome.gaf: ${scratchDir}/MAprobe.genome.raw.gaf ${gafDir}/gene.genome.gaf
cat $< |sort -k2,2 | scripts/combineFeatures.py > $@
${scratchDir}/MAprobe.genome.raw.gaf: ${inputDir}/MAprobe.genome.bed
liftOver $< data/GRCh37-lite/hg19.GRCh37-lite.over.chain ${scratchDir}/MAprobe.genome.preGaf.GRCh37-lite.bed /dev/null
scripts/makeMaProbe.py ${scratchDir}/MAprobe.genome.preGaf.GRCh37-lite.bed > $@
${testInput}/MAprobe.genome.2.1.gaf: ${scratchDir}/MAprobe.genome.gaf21.gaf ${testDir}/testMaProbe.txt
cat ${testDir}/testMaProbe.txt \
| awk '{ print "grep -w", $$1, "${scratchDir}/MAprobe.genome.gaf21.gaf"}' \
| bash > $@
#${testDir}/testMaProbe.txt:
# hgsql goat -BNe "SELECT FeatureId FROM gaf2_1 WHERE featureType='MAprobe' AND compositeType = 'genome' ORDER BY rand() LIMIT 500" |sort > $@
${scratchDir}/MAprobe.genome.gaf21.gaf:
zcat ${gaf21File} \
| awk -F'\t' '$$3 == "MAprobe" && $$9 == "genome" { print }' > $@
#
# When comparing the MAprobes to pre-miRNAs, note that most of the composite
# coordinates WILL be different, because in many cases the pre-miRNA has been
# moved to the other strand by miRBase. So, omit that from comparison.
#
${testOutput}/MAprobe.pre-miRNA.diff: ${testInput}/MAprobe.pre-miRNA.2.1.gaf ${testInput}/MAprobe.pre-miRNA.3.0.gaf
cat ${testInput}/MAprobe.pre-miRNA.2.1.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$5, $$6, $$7, $$8, $$9, $$10, $$13, $$14 }' \
|sort |sed 's/:-//g' |sed 's/:+//g' \
> ${scratchDir}/MAprobe.pre-miRNA.2.1.subset
cat ${testInput}/MAprobe.pre-miRNA.3.0.gaf \
| awk -F'\t' '{ split($$8, tokens, "_"); print $$2, $$3, $$4, $$5, $$6, $$7, tokens[1], $$9, $$10, $$13, $$14 }' \
|sort |sed 's/:-//g' |sed 's/:+//g' \
> ${scratchDir}/MAprobe.pre-miRNA.3.0.subset
diff ${scratchDir}/MAprobe.pre-miRNA.2.1.subset ${scratchDir}/MAprobe.pre-miRNA.3.0.subset > $@
${testInput}/MAprobe.pre-miRNA.3.0.gaf: ${gafDir}/MAprobe.pre-miRNA.gaf ${scratchDir}/MAprobe.pre-miRNA.gaf21.gaf
- cat ${scratchDir}/MAprobe.pre-miRNA.gaf21.gaf \
| awk '{ print "grep", $$2, "${gafDir}/MAprobe.pre-miRNA.gaf"}' \
| bash > ${scratchDir}/MAprobe.pre-miRNA.3.0.superset.gaf
- cat ${scratchDir}/MAprobe.pre-miRNA.gaf21.gaf \
| awk -F'\t' '{ print "grep \"" $$8 "\" ${scratchDir}/MAprobe.pre-miRNA.3.0.superset.gaf"}' \
| bash |sort |uniq > $@
${testInput}/MAprobe.pre-miRNA.2.1.gaf: ${testInput}/MAprobe.pre-miRNA.3.0.gaf
- cat ${testInput}/MAprobe.pre-miRNA.3.0.gaf \
| awk '{ print "grep", $$2, "${scratchDir}/MAprobe.pre-miRNA.gaf21.gaf"}' \
| bash > ${scratchDir}/MAprobe.pre-miRNA.2.1.superset.gaf
- cat ${testInput}/MAprobe.pre-miRNA.3.0.gaf \
| awk -F'\t' '{ split($$8, tokens, "_"); print "grep \"" tokens[1] "\" ${scratchDir}/MAprobe.pre-miRNA.2.1.superset.gaf"}' \
| bash |sort |uniq > $@
${gafDir}/MAprobe.pre-miRNA.gaf: ${scratchDir}/MAprobe.genome.raw.gaf ${gafDir}/pre-miRNA.genome.gaf ${inputDir}/pre-miRNA.genome.bed
scripts/gafToBed.py ${gafDir}/pre-miRNA.genome.gaf \
> ${scratchDir}/pre-miRNA.genome.GRCh37-lite.bed
liftOver ${scratchDir}/pre-miRNA.genome.GRCh37-lite.bed \
data/GRCh37-lite/GRCh37-lite.hg19.over.chain \
${scratchDir}/pre-miRNA.genome.hg19.bed /dev/null
scripts/maProbeToComposite.py ${scratchDir}/MAprobe.genome.raw.gaf \
${gafDir}/pre-miRNA.genome.gaf > $@
${scratchDir}/MAprobe.pre-miRNA.gaf21.gaf:
zcat ${gaf21File} \
| awk -F'\t' '$$3 == "MAprobe" && $$9 == "pre-miRNA" { print }' > $@
#
# When comparing MAprobes to miRNAs, here are the things to NOT look at
# - the miRNA nmes now include miR instead of mir
# - the miRNA names also include suffices (-3p, -5p) where they didn't before.
# Don't even look at the miRNA name. The accession is good enough.
# - in any cases, the miRNA coordinates are now on a different strand. This has two
# consequences. First, in cases where the composite (miRNA) does not fully align to
# the probe, the set of aligned bases will be thrown off. Second, the composite
# coordinates will be in reverse order. So, don't look at the composite coordinates.
# That doesn't leave much...
#
${testOutput}/MAprobe.miRNA.diff: ${testInput}/MAprobe.miRNA.2.1.gaf ${testInput}/MAprobe.miRNA.3.0.gaf
cat ${testInput}/MAprobe.miRNA.2.1.gaf \
| awk -F'\t' '{ split($$8, tokens, "|"); $$8 = tokens[2]; print $$2, $$3, $$4, $$5, $$6, $$7, $$8, $$9, $$10, $$13, $$14, $$16 }' \
|sort |uniq > ${scratchDir}/MAprobe.miRNA.2.1.subset
cat ${testInput}/MAprobe.miRNA.3.0.gaf \
| awk -F'\t' '{ split($$8, tokens, "|"); split(tokens[2], subtokens, "_"); print $$2, $$3, $$4, $$5, $$6, $$7, subtokens[1], $$9, $$10, $$13, $$14, $$16 }' \
|sort |uniq > ${scratchDir}/MAprobe.miRNA.3.0.subset
diff -i ${scratchDir}/MAprobe.miRNA.2.1.subset ${scratchDir}/MAprobe.miRNA.3.0.subset > $@
${testInput}/MAprobe.miRNA.3.0.gaf: ${scratchDir}/MAprobe.miRNA.gaf21.gaf ${gafDir}/MAprobe.miRNA.gaf ${testDir}/MAprobe.miRNA.test.txt
cat ${testDir}/MAprobe.miRNA.test.txt \
| awk '{ print "grep", $$1 ".*" $$2, "${gafDir}/MAprobe.miRNA.gaf" }' |bash |sort |uniq > $@
${testInput}/MAprobe.miRNA.2.1.gaf: ${scratchDir}/MAprobe.miRNA.gaf21.gaf ${gafDir}/MAprobe.miRNA.gaf
cat ${testDir}/MAprobe.miRNA.test.txt \
| awk '{ print "grep", $$1 ".*" $$2, "${scratchDir}/MAprobe.miRNA.gaf21.gaf" }' |bash |sort |uniq > $@
${gafDir}/MAprobe.miRNA.gaf: ${scratchDir}/MAprobe.genome.raw.gaf ${gafDir}/miRNA.genome.gaf ${inputDir}/miRNA.genome.bed
scripts/gafToBed.py ${scratchDir}/miRNA.genome.uncombined.gaf \
> ${scratchDir}/miRNA.genome.GRCh37-lite.bed
liftOver ${scratchDir}/miRNA.genome.GRCh37-lite.bed \
data/GRCh37-lite/GRCh37-lite.hg19.over.chain \
${scratchDir}/miRNA.genome.hg19.bed /dev/null
scripts/maProbeToComposite.py ${scratchDir}/MAprobe.genome.raw.gaf ${scratchDir}/miRNA.genome.uncombined.gaf > $@
${scratchDir}/MAprobe.miRNA.gaf21.gaf:
zcat ${gaf21File} \
| awk -F'\t' '$$3 == "MAprobe" && $$9 == "miRNA" { print }' > $@
#
# When comparing the MAprobe and transcript mappings, look only at mappings on
# the same strand (this is implicit in the construction of the test set) and
# don't look at the gene locus, which has changed for many transcripts.
#
${testOutput}/MAprobe.transcript.diff: ${testInput}/MAprobe.transcript.2.1.gaf ${testInput}/MAprobe.transcript.3.0.gaf
cat ${testInput}/MAprobe.transcript.2.1.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$5, $$6, $$7, $$8, $$9, $$10, $$11, $$13, $$14, $$15 }' \
|sort |uniq > ${scratchDir}/MAprobe.transcript.2.1.subset
cat ${testInput}/MAprobe.transcript.3.0.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$5, $$6, $$7, $$8, $$9, $$10, $$11, $$13, $$14, $$15 }' \
|sort |uniq > ${scratchDir}/MAprobe.transcript.3.0.subset
diff ${scratchDir}/MAprobe.transcript.2.1.subset ${scratchDir}/MAprobe.transcript.3.0.subset > $@
${testInput}/MAprobe.transcript.3.0.gaf: ${testDir}/MAprobe.transcript.test.txt ${gafDir}/MAprobe.transcript.gaf
-cat ${testDir}/MAprobe.transcript.test.txt \
| awk '{ print "grep \"" $$1 ".*" $$2 "\" ${gafDir}/MAprobe.transcript.gaf"}' \
| bash > $@
${testInput}/MAprobe.transcript.2.1.gaf: ${testDir}/MAprobe.transcript.test.txt ${scratchDir}/MAprobe.transcript.gaf21.gaf
-cat ${testDir}/MAprobe.transcript.test.txt \
| awk '{ print "grep \"" $$1 ".*" $$2 "\" ${scratchDir}/MAprobe.transcript.gaf21.gaf"}' \
| bash > $@
#
# cat data/test/testMaProbe.txt # |awk '{ print "grep", $1, "data/scratch/MAprobe.transcript.gaf21.gaf"}' \
# |bash |awk -F'\t' '{ print $2, $8}' > data/test/MAprobe.transcript.test.txt
${gafDir}/MAprobe.transcript.gaf: ${scratchDir}/MAprobe.genome.raw.gaf ${gafDir}/transcript.genome.gaf ${inputDir}/transcript.genome.bed
scripts/maProbeToComposite.py ${scratchDir}/MAprobe.genome.raw.gaf ${gafDir}/transcript.genome.gaf > $@
${scratchDir}/MAprobe.transcript.gaf21.gaf:
zcat ${gaf21File} \
| awk -F'\t' '$$3 == "MAprobe" && $$9 == "transcript" { print }' > $@
#
# When looking at the SNPs, don't look at the gene and gene locus strings
# ($16 and $17) since many have changed.
#
${testOutput}/AffySNP.genome.diff: ${testInput}/AffySNP.genome.2.1.gaf ${testInput}/AffySNP.genome.3.0.gaf
cat ${testInput}/AffySNP.genome.2.1.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$5, $$6, $$7, $$9, $$10, $$12, $$13, $$14, $$15, $$18 }' \
|sort |uniq > ${scratchDir}/AffySNP.genome.2.1.subset
cat ${testInput}/AffySNP.genome.3.0.gaf \
| awk -F'\t' '{ print $$2, $$3, $$4, $$5, $$6, $$7, $$9, $$10, $$12, $$13, $$14, $$15, $$18 }' \
|sort |uniq > ${scratchDir}/AffySNP.genome.3.0.subset
diff ${scratchDir}/AffySNP.genome.2.1.subset ${scratchDir}/AffySNP.genome.3.0.subset > $@
${testInput}/AffySNP.genome.3.0.gaf: ${testDir}/testAffySNP.txt ${gafDir}/AffySNP.genome.gaf
cat ${testDir}/testAffySNP.txt \
| awk '{ print "grep -w \"" $$1 "\" ${gafDir}/AffySNP.genome.gaf"}' \
| bash > $@
${testInput}/AffySNP.genome.2.1.gaf: ${testDir}/testAffySNP.txt ${scratchDir}/AffySNP.genome.gaf21.gaf
cat ${testDir}/testAffySNP.txt \
| awk '{ print "grep -w \"" $$1 "\" ${scratchDir}/AffySNP.genome.gaf21.gaf"}' \
| bash > $@
${gafDir}/AffySNP.genome.gaf: ${inputDir}/AffySNP.genome.bed ${scratchDir}/AffySNP.genome.gaf21.gaf
liftOver $< data/GRCh37-lite/GRCh37-lite.hg19.over.chain \
${scratchDir}/AffySNP.genome.preGaf.GRCh37-lite.bed /dev/null
scripts/makeAffySnp.py ${scratchDir}/AffySNP.genome.preGaf.GRCh37-lite.bed \
${scratchDir}/AffySNP.genome.gaf21.gaf > $@
${scratchDir}/AffySNP.genome.gaf21.gaf:
zcat ${gaf21File} \
| awk -F'\t' '$$3 == "AffySNP" && $$9 == "genome" { print }' > $@