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
6ede8254
Commit
6ede8254
authored
9 years ago
by
Peter van 't Hof
Browse files
Options
Downloads
Patches
Plain Diff
Change name
parent
bfb88721
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/AnnotateVcfWithBed.scala
+9
-9
9 additions, 9 deletions
.../scala/nl/lumc/sasc/biopet/tools/AnnotateVcfWithBed.scala
with
9 additions
and
9 deletions
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/AnnotateVcfWithBed.scala
+
9
−
9
View file @
6ede8254
...
...
@@ -83,7 +83,7 @@ object AnnotateVcfWithBed extends ToolCommand {
logger
.
info
(
"Start"
)
val
argsParser
=
new
OptParser
val
c
omman
dArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
sys
.
exit
(
1
)
val
c
m
dArgs
:
Args
=
argsParser
.
parse
(
args
,
Args
())
getOrElse
sys
.
exit
(
1
)
val
bedRecords
:
mutable.Map
[
String
,
List
[(
Int
,
Int
,
String
)]]
=
mutable
.
Map
()
// Read bed file
...
...
@@ -95,7 +95,7 @@ object AnnotateVcfWithBed extends ToolCommand {
}
*/
val
fieldType
=
c
omman
dArgs
.
fieldType
match
{
val
fieldType
=
c
m
dArgs
.
fieldType
match
{
case
"Integer"
=>
VCFHeaderLineType
.
Integer
case
"Flag"
=>
VCFHeaderLineType
.
Flag
case
"Character"
=>
VCFHeaderLineType
.
Character
...
...
@@ -105,7 +105,7 @@ object AnnotateVcfWithBed extends ToolCommand {
logger
.
info
(
"Reading bed file"
)
for
(
line
<-
Source
.
fromFile
(
c
omman
dArgs
.
bedFile
).
getLines
())
{
for
(
line
<-
Source
.
fromFile
(
c
m
dArgs
.
bedFile
).
getLines
())
{
val
values
=
line
.
split
(
"\t"
)
if
(
values
.
size
>=
4
)
bedRecords
(
values
(
0
))
=
(
values
(
1
).
toInt
,
values
(
2
).
toInt
,
values
(
3
))
::
bedRecords
.
getOrElse
(
values
(
0
),
Nil
)
...
...
@@ -122,16 +122,16 @@ object AnnotateVcfWithBed extends ToolCommand {
logger
.
info
(
"Starting output file"
)
val
reader
=
new
VCFFileReader
(
c
omman
dArgs
.
inputFile
,
false
)
val
reader
=
new
VCFFileReader
(
c
m
dArgs
.
inputFile
,
false
)
val
header
=
reader
.
getFileHeader
val
writer
=
new
AsyncVariantContextWriter
(
new
VariantContextWriterBuilder
().
setOutputFile
(
c
omman
dArgs
.
outputFile
).
setOutputFile
(
c
m
dArgs
.
outputFile
).
setReferenceDictionary
(
header
.
getSequenceDictionary
).
build
)
header
.
addMetaDataLine
(
new
VCFInfoHeaderLine
(
c
omman
dArgs
.
fieldName
,
VCFHeaderLineCount
.
UNBOUNDED
,
fieldType
,
c
omman
dArgs
.
fieldDescription
))
header
.
addMetaDataLine
(
new
VCFInfoHeaderLine
(
c
m
dArgs
.
fieldName
,
VCFHeaderLineCount
.
UNBOUNDED
,
fieldType
,
c
m
dArgs
.
fieldDescription
))
writer
.
writeHeader
(
header
)
logger
.
info
(
"Start reading vcf records"
)
...
...
@@ -144,8 +144,8 @@ object AnnotateVcfWithBed extends ToolCommand {
writer
.
add
(
record
)
}
else
{
val
builder
=
new
VariantContextBuilder
(
record
)
if
(
fieldType
==
VCFHeaderLineType
.
Flag
)
builder
.
attribute
(
c
omman
dArgs
.
fieldName
,
true
)
else
builder
.
attribute
(
c
omman
dArgs
.
fieldName
,
overlaps
.
map
(
_
.
_3
).
mkString
(
","
))
if
(
fieldType
==
VCFHeaderLineType
.
Flag
)
builder
.
attribute
(
c
m
dArgs
.
fieldName
,
true
)
else
builder
.
attribute
(
c
m
dArgs
.
fieldName
,
overlaps
.
map
(
_
.
_3
).
mkString
(
","
))
writer
.
add
(
builder
.
make
)
}
}
...
...
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