Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
biopet.biopet
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirrors
biopet.biopet
Commits
e0c54cc7
Commit
e0c54cc7
authored
8 years ago
by
Sander Bollen
Browse files
Options
Downloads
Plain Diff
Merge branch 'develop' into toucan-groups
parents
2064a3a4
ff0d656a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/Grep.scala
+50
-0
50 additions, 0 deletions
.../src/main/scala/nl/lumc/sasc/biopet/extensions/Grep.scala
with
50 additions
and
0 deletions
biopet-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/Grep.scala
0 → 100644
+
50
−
0
View file @
e0c54cc7
package
nl.lumc.sasc.biopet.extensions
import
java.io.File
import
nl.lumc.sasc.biopet.core.BiopetCommandLineFunction
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
org.broadinstitute.gatk.utils.commandline.
{
Input
,
Output
}
/**
* Created by pjvanthof on 30/03/16.
*/
class
Grep
(
val
root
:
Configurable
)
extends
BiopetCommandLineFunction
{
@Input
(
doc
=
"Input file"
,
required
=
true
)
var
input
:
File
=
_
@Output
(
doc
=
"Output file"
,
required
=
true
)
var
output
:
File
=
_
executable
=
config
(
"exe"
,
default
=
"grep"
)
var
grepFor
:
String
=
null
var
invertMatch
:
Boolean
=
false
var
regex
:
Boolean
=
false
var
perlRegexp
:
Boolean
=
false
/** return commandline to execute */
def
cmdLine
=
required
(
executable
)
+
conditional
(
invertMatch
,
"-v"
)
+
conditional
(
regex
,
"-e"
)
+
conditional
(
perlRegexp
,
"-P"
)
+
required
(
grepFor
)
+
(
if
(
inputAsStdin
)
""
else
required
(
input
))
+
(
if
(
outputAsStsout
)
""
else
" > "
+
required
(
output
))
}
object
Grep
{
def
apply
(
root
:
Configurable
,
grepFor
:
String
,
regex
:
Boolean
=
false
,
invertMatch
:
Boolean
=
false
,
perlRegexp
:
Boolean
=
false
)
:
Grep
=
{
val
grep
=
new
Grep
(
root
)
grep
.
grepFor
=
grepFor
grep
.
regex
=
regex
grep
.
perlRegexp
=
perlRegexp
grep
.
invertMatch
=
invertMatch
grep
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment