-
Notifications
You must be signed in to change notification settings - Fork 124
/
Copy pathmore_examples.sh
66 lines (42 loc) · 1.28 KB
/
more_examples.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
kscript - test2.fastq <<"EOF"
java.io.File(args[0]).useLines {
it.map {
if (!it.startsWith(">")) it else "huhu" + it
}.forEach { println(it) }
}
EOF
kscript - <<"EOF"
println("getting started")
generateSequence() { readLine() }.map {
if (!it.startsWith(">")) it else
"huhu" + it
}.forEach { println(it) }
EOF
head -n 1000 test.fastq > test2.fastq
## how use stdin but still use heredoc for cod
kscript - test2.fastq <(echo <<"EOF"
println("getting started")
//generateSequence() { readLine() }.map {
File(args[0]).readLines().map {
if (!it.startsWith(">")) it else
"huhu" + it
}.forEach { println(it) }
EOF
)
## todo provide picard tools examples
http://mvnrepository.com/artifact/com.github.broadinstitute/picard/2.5.0
potentially like
https://www.biostars.org/p/52698/
## simplified line streaming
kscript -s '
//DEPS de.mpicbg.scicomp:kutils:0.2-SNAPSHOT
kutils.KscriptHelpers.processStdin { "huhu" + it }
'
## todo streamline further by using simple code wrapper for (see https://github.com/holgerbrandl/kscript/issues/9)
kscript -st '"huhu" + it'
## REPL test: Filter-Join fasta files by ID
kotlinc -classpath $(resdeps.kts de.mpicbg.scicomp:kutils:0.2)
<<"EOF"
import de.mpicbg.scicomp.kscript.*
"house\nasdf".processLines { "huhu" + it }
EOF