mirrored from https://gitlab.com/LPCDRP/motif-variants
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
82 lines (75 loc) · 1.93 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
.ONESHELL:
check: \
gerrymander-check \
motif_len-check \
;
gerrymander-check: SHELL=python
gerrymander-check: example.vcf
import pysam
from motif_variants import gerrymander
infile = pysam.VariantFile('$<', 'r')
districts = gerrymander(infile, 6)
for district in districts:
print("-"*10)
for block in district:
print(block.pos)
regex2iupac-check: SHELL=python
regex2iupac-check:
@from __future__ import print_function
import sys
from motif_variants import regex2iupac
status=0
motifs = {
"CTGGAG":"CTGGAG",
"C[AC]AA[AC]TCA[AGCT]":"CMAAMTCAN",
"[ACT][GT][GT]":"HKK",
}
for motif in motifs.keys():
expected = motifs[motif]
actual = regex2iupac(motif, 'dna')
if expected != actual:
print("FAIL: Expected IUPAC {} for regex {}. Got {}.".format(expected,motif,actual))
status=1
if status == 0:
print("PASS: regex2iupac")
sys.exit(status)
motif_revcomp-check: SHELL=python
motif_revcomp-check:
@from __future__ import print_function
import sys
from motif_variants import motif_revcomp
status=0
motifs = {
"CTGGAG":"CTCCAG",
"C[AC]AA[AC]TCA[AGCT]":9,
"[ACT][GT][GT]":3,
}
for motif in motifs.keys():
expected = motifs[motif]
actual = motif_len(motif)
if expected != actual:
print("FAIL: Expected length {} for motif {}. Got {}.".format(expected,motif,actual))
status=1
if status == 0:
print("PASS: motif_len")
sys.exit(status)
motif_len-check: SHELL=python
motif_len-check:
@from __future__ import print_function
import sys
from motif_variants import motif_len
status=0
motifs = {
"CTGGAG":6,
"C[AC]AA[AC]TCA[AGCT]":9,
"[ACT][GT][GT]":3,
}
for motif in motifs.keys():
expected = motifs[motif]
actual = motif_len(motif)
if expected != actual:
print("FAIL: Expected length {} for motif {}. Got {}.".format(expected,motif,actual))
status=1
if status == 0:
print("PASS: motif_len")
sys.exit(status)