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
ff0c3a5e
Commit
ff0c3a5e
authored
9 years ago
by
Peter van 't Hof
Browse files
Options
Downloads
Patches
Plain Diff
Added some errors when there is a field conflict
parent
2c3cf84b
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
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VCFWithVCF.scala
+7
-1
7 additions, 1 deletion
...src/main/scala/nl/lumc/sasc/biopet/tools/VCFWithVCF.scala
with
7 additions
and
1 deletion
public/biopet-framework/src/main/scala/nl/lumc/sasc/biopet/tools/VCFWithVCF.scala
+
7
−
1
View file @
ff0c3a5e
...
@@ -53,6 +53,11 @@ object VCFWithVCF extends ToolCommand {
...
@@ -53,6 +53,11 @@ object VCFWithVCF extends ToolCommand {
val
secondHeader
=
secondaryReader
.
getFileHeader
val
secondHeader
=
secondaryReader
.
getFileHeader
for
(
x
<-
commandArgs
.
fields
)
{
for
(
x
<-
commandArgs
.
fields
)
{
if
(
header
.
hasInfoLine
(
x
.
outputField
))
throw
new
IllegalArgumentException
(
"Field '"
+
x
.
outputField
+
"' already exist in input vcf"
)
if
(!
secondHeader
.
hasInfoLine
(
x
.
inputField
))
throw
new
IllegalArgumentException
(
"Field '"
+
x
.
inputField
+
"' does not exist in secondary vcf"
)
val
oldHeaderLine
=
secondHeader
.
getInfoHeaderLine
(
x
.
inputField
)
val
oldHeaderLine
=
secondHeader
.
getInfoHeaderLine
(
x
.
inputField
)
val
newHeaderLine
=
new
VCFInfoHeaderLine
(
x
.
outputField
,
VCFHeaderLineCount
.
UNBOUNDED
,
val
newHeaderLine
=
new
VCFInfoHeaderLine
(
x
.
outputField
,
VCFHeaderLineCount
.
UNBOUNDED
,
...
@@ -65,7 +70,7 @@ object VCFWithVCF extends ToolCommand {
...
@@ -65,7 +70,7 @@ object VCFWithVCF extends ToolCommand {
writer
.
writeHeader
(
header
)
writer
.
writeHeader
(
header
)
var
idx
=
0
var
idx
=
0
for
(
record
:
VariantContext
<-
reader.iterator
()
)
{
for
(
record
<-
reader
)
{
val
secondaryRecords
=
if
(
commandArgs
.
matchAllele
)
{
val
secondaryRecords
=
if
(
commandArgs
.
matchAllele
)
{
secondaryReader
.
query
(
record
.
getChr
,
record
.
getStart
,
record
.
getEnd
).
toList
.
secondaryReader
.
query
(
record
.
getChr
,
record
.
getStart
,
record
.
getEnd
).
toList
.
filter
(
x
=>
record
.
getAlternateAlleles
.
exists
(
x
.
hasAlternateAllele
(
_
)))
filter
(
x
=>
record
.
getAlternateAlleles
.
exists
(
x
.
hasAlternateAllele
(
_
)))
...
@@ -97,6 +102,7 @@ object VCFWithVCF extends ToolCommand {
...
@@ -97,6 +102,7 @@ object VCFWithVCF extends ToolCommand {
logger
.
info
(
s
"""Processed $idx records"""
)
logger
.
info
(
s
"""Processed $idx records"""
)
}
}
}
}
logger
.
info
(
s
"""Processed $idx records"""
)
logger
.
debug
(
"Closing readers"
)
logger
.
debug
(
"Closing readers"
)
writer
.
close
()
writer
.
close
()
...
...
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