Skip to content

Commit ca6a31b

Browse files
committed
Add support for Snakemake
1 parent 8b85895 commit ca6a31b

File tree

6 files changed

+154
-17
lines changed

6 files changed

+154
-17
lines changed

LANGUAGES.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ License (license,licence,copying,copying3,unlicense,unlicence,license-mit,licenc
151151
Lisp (lisp,lsp)
152152
LLVM IR (ll)
153153
LOLCODE (lol,lols)
154-
Lua (lua)
154+
Lua (lua,luau)
155155
Luau (luau)
156156
Lucius (lucius)
157157
Luna (luna)
@@ -205,7 +205,7 @@ PRQL (prql)
205205
PSL Assertion (psl)
206206
Puppet (pp)
207207
PureScript (purs)
208-
Python (py)
208+
Python (py,pyw,pyi)
209209
Q# (qs)
210210
QCL (qcl)
211211
QML (qml)
@@ -232,6 +232,7 @@ Shell (sh,.tcshrc)
232232
Sieve (sieve)
233233
SKILL (il)
234234
Smarty Template (tpl)
235+
Snakemake (smk,rules,snakefile)
235236
SNOBOL (sno)
236237
Softbridge Basic (sbl)
237238
Solidity (sol)

SCC-OUTPUT-REPORT.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<th>453</th>
1919
<th>7424</th>
2020
<th>1516</th>
21-
<th>396673</th>
21+
<th>398173</th>
2222
<th>3929</th>
2323
</tr><tr>
2424
<td>processor/workers_test.go</td>
@@ -250,16 +250,6 @@
250250
<td>0</td>
251251
<td>2222</td>
252252
<td>35</td>
253-
</tr><tr>
254-
<td>processor/cocomo_test.go</td>
255-
<td></td>
256-
<td>37</td>
257-
<td>8</td>
258-
<td>4</td>
259-
<td>25</td>
260-
<td>6</td>
261-
<td>699</td>
262-
<td>23</td>
263253
</tr><tr>
264254
<td>processor/bloom.go</td>
265255
<td></td>
@@ -270,6 +260,16 @@
270260
<td>2</td>
271261
<td>1051</td>
272262
<td>29</td>
263+
</tr><tr>
264+
<td>processor/cocomo_test.go</td>
265+
<td></td>
266+
<td>37</td>
267+
<td>8</td>
268+
<td>4</td>
269+
<td>25</td>
270+
<td>6</td>
271+
<td>699</td>
272+
<td>23</td>
273273
</tr><tr>
274274
<td>processor/helpers.go</td>
275275
<td></td>
@@ -318,7 +318,7 @@
318318
<td>0</td>
319319
<td>4</td>
320320
<td>0</td>
321-
<td>170185</td>
321+
<td>171685</td>
322322
<td>5</td>
323323
</tr></tbody>
324324
<tfoot><tr>
@@ -329,7 +329,7 @@
329329
<th>453</th>
330330
<th>7424</th>
331331
<th>1516</th>
332-
<th>396673</th>
332+
<th>398173</th>
333333
<th>3929</th>
334334
</tr>
335335
<tr>

examples/language/snakefile.smk

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# 67 lines 50 code 4 comments 13 blanks
2+
"""
3+
A sample Snakefile for testing line counting
4+
"""
5+
6+
SAMPLES = ["A", "B"]
7+
8+
9+
# This is a
10+
# multiline
11+
# comment
12+
rule all:
13+
input:
14+
"plots/quals.svg"
15+
16+
17+
'''Sometimes even some
18+
comments in single quote
19+
fences.'''
20+
rule bwa_map:
21+
input:
22+
"data/genome.fa", # Inline comments are also supported
23+
"data/samples/{sample}.fastq"
24+
output:
25+
"mapped_reads/{sample}.bam"
26+
shell:
27+
"bwa mem {input} | samtools view -Sb - > {output}"
28+
29+
30+
rule samtools_sort:
31+
input:
32+
"mapped_reads/{sample}.bam"
33+
output:
34+
"sorted_reads/{sample}.bam"
35+
shell:
36+
"samtools sort -T sorted_reads/{wildcards.sample} "
37+
"-O bam {input} > {output}"
38+
39+
40+
rule samtools_index:
41+
input:
42+
"sorted_reads/{sample}.bam"
43+
output:
44+
"sorted_reads/{sample}.bam.bai"
45+
shell:
46+
"samtools index {input}"
47+
48+
49+
rule bcftools_call:
50+
input:
51+
fa="data/genome.fa",
52+
bam=expand("sorted_reads/{sample}.bam", sample=SAMPLES),
53+
bai=expand("sorted_reads/{sample}.bam.bai", sample=SAMPLES)
54+
output:
55+
"calls/all.vcf"
56+
shell:
57+
"bcftools mpileup -f {input.fa} {input.bam} | "
58+
"bcftools call -mv - > {output}"
59+
60+
61+
rule plot_quals:
62+
input:
63+
"calls/all.vcf"
64+
output:
65+
"plots/quals.svg"
66+
script:
67+
"scripts/plot-quals.py"

languages.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5979,6 +5979,75 @@
59795979
"python3"
59805980
]
59815981
},
5982+
"Snakemake": {
5983+
"complexitychecks": [
5984+
"for ",
5985+
"for(",
5986+
"while ",
5987+
"while(",
5988+
"if ",
5989+
"if(",
5990+
"elif ",
5991+
"elif(",
5992+
"else ",
5993+
"else:",
5994+
"match ",
5995+
"match(",
5996+
"try ",
5997+
"try:",
5998+
"except ",
5999+
"except(",
6000+
"finally ",
6001+
"finally:",
6002+
"with ",
6003+
"with (",
6004+
"and ",
6005+
"and(",
6006+
"or ",
6007+
"or("
6008+
],
6009+
"extensions": [
6010+
"smk",
6011+
"rules"
6012+
],
6013+
"line_comment": [
6014+
"#"
6015+
],
6016+
"multi_line": [],
6017+
"quotes": [
6018+
{
6019+
"end": "\"",
6020+
"start": "\""
6021+
},
6022+
{
6023+
"end": "'",
6024+
"start": "'"
6025+
},
6026+
{
6027+
"docString": true,
6028+
"end": "\"\"\"",
6029+
"start": "\"\"\""
6030+
},
6031+
{
6032+
"docString": true,
6033+
"end": "'''",
6034+
"start": "'''"
6035+
},
6036+
{
6037+
"docString": true,
6038+
"end": "\"\"\"",
6039+
"start": "r\"\"\""
6040+
},
6041+
{
6042+
"docString": true,
6043+
"end": "'''",
6044+
"start": "r'''"
6045+
}
6046+
],
6047+
"filenames": [
6048+
"snakefile"
6049+
]
6050+
},
59826051
"PRQL": {
59836052
"complexitychecks": [
59846053
"case ",

processor/constants.go

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

test-all.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ else
883883
fi
884884

885885
# Try out specific languages
886-
for i in 'Bosque ' 'Flow9 ' 'Bitbucket Pipeline ' 'Docker ignore ' 'Q# ' 'Futhark ' 'Alloy ' 'Wren ' 'Monkey C ' 'Alchemist ' 'Luna ' 'ignore ' 'XML Schema ' 'Web Services' 'Go ' 'Java ' 'Boo ' 'License ' 'BASH ' 'C Shell ' 'Korn Shell ' 'Makefile ' 'Shell ' 'Zsh ' 'Rakefile ' 'Gemfile ' 'Dockerfile ' 'Yarn ' 'Sieve ' 'F# ' 'Elm ' 'Terraform ' 'Clojure ' 'C# ' 'LLVM IR ' 'HAML ' 'FXML ' 'DM ' 'Nushell ' 'Racket ' 'DOT ' 'YAML ' 'Teal ' 'FSL ' 'INI ' 'Hare ' 'Templ ' 'Cuda ' 'GraphQL ' 'Bicep ' 'Pkl ' 'TypeSpec ' 'LALRPOP '
886+
for i in 'Bosque ' 'Flow9 ' 'Bitbucket Pipeline ' 'Docker ignore ' 'Q# ' 'Futhark ' 'Alloy ' 'Wren ' 'Monkey C ' 'Alchemist ' 'Luna ' 'ignore ' 'XML Schema ' 'Web Services' 'Go ' 'Java ' 'Boo ' 'License ' 'BASH ' 'C Shell ' 'Korn Shell ' 'Makefile ' 'Shell ' 'Zsh ' 'Rakefile ' 'Gemfile ' 'Dockerfile ' 'Yarn ' 'Sieve ' 'F# ' 'Elm ' 'Terraform ' 'Clojure ' 'C# ' 'LLVM IR ' 'HAML ' 'FXML ' 'DM ' 'Nushell ' 'Racket ' 'DOT ' 'YAML ' 'Teal ' 'FSL ' 'INI ' 'Hare ' 'Templ ' 'Cuda ' 'GraphQL ' 'Bicep ' 'Pkl ' 'TypeSpec ' 'LALRPOP ' 'Snakemake '
887887
do
888888
if ./scc "examples/language/" | grep -q "$i "; then
889889
echo -e "${GREEN}PASSED $i Language Check"

0 commit comments

Comments
 (0)