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
7570f55a
Commit
7570f55a
authored
8 years ago
by
Peter van 't Hof
Browse files
Options
Downloads
Patches
Plain Diff
Remove copy class
parent
7bc8a4cc
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
protected/biopet-gatk-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/gatk/broad/gather/BQSRGather.scala
+0
-67
0 additions, 67 deletions
...sasc/biopet/extensions/gatk/broad/gather/BQSRGather.scala
with
0 additions
and
67 deletions
protected/biopet-gatk-extensions/src/main/scala/nl/lumc/sasc/biopet/extensions/gatk/broad/gather/BQSRGather.scala
deleted
100644 → 0
+
0
−
67
View file @
7bc8a4cc
package
nl.lumc.sasc.biopet.extensions.gatk.broad.gather
import
java.io.
{
File
,
FileNotFoundException
,
PrintStream
}
import
java.util
import
org.apache.commons.collections.CollectionUtils
import
org.apache.log4j.Logger
import
org.broadinstitute.gatk.engine.recalibration.RecalibrationReport
import
org.broadinstitute.gatk.utils.commandline.Gatherer
import
org.broadinstitute.gatk.utils.exceptions.
{
ReviewedGATKException
,
UserException
}
import
org.broadinstitute.gatk.utils.report.GATKReport
import
scala.collection.JavaConversions._
/**
* Created by pjvanthof on 26/04/16.
*/
class
BQSRGatherer
extends
Gatherer
{
private
val
logger
:
Logger
=
Logger
.
getLogger
(
classOf
[
BQSRGatherer
])
private
val
EMPTY_INPUT_LIST
:
String
=
"list of inputs files is empty or there is no usable data in any input file"
private
val
MISSING_OUTPUT_FILE
:
String
=
"missing output file name"
private
val
MISSING_READ_GROUPS
:
String
=
"Missing read group(s)"
def
gather
(
inputs
:
util.List
[
File
],
output
:
File
)
{
val
outputFile
:
PrintStream
=
try
{
new
PrintStream
(
output
)
}
catch
{
case
e
:
FileNotFoundException
=>
{
throw
new
UserException
.
MissingArgument
(
"output"
,
MISSING_OUTPUT_FILE
)
}
}
val
report
:
GATKReport
=
gatherReport
(
inputs
)
report
.
print
(
outputFile
)
}
def
gatherReport
(
inputs
:
util.List
[
File
])
:
GATKReport
=
{
val
allReadGroups
:
util.SortedSet
[
String
]
=
new
util
.
TreeSet
[
String
]
val
inputReadGroups
:
util.LinkedHashMap
[
File
,
util.Set
[
String
]]
=
new
util
.
LinkedHashMap
[
File
,
util.Set
[
String
]]
for
(
input
<-
inputs
)
{
val
readGroups
:
util.Set
[
String
]
=
RecalibrationReport
.
getReadGroups
(
input
)
inputReadGroups
.
put
(
input
,
readGroups
)
allReadGroups
.
addAll
(
readGroups
)
}
import
scala.collection.JavaConversions._
for
(
entry
<-
inputReadGroups
.
entrySet
)
{
val
input
:
File
=
entry
.
getKey
val
readGroups
:
util.Set
[
String
]
=
entry
.
getValue
if
(
allReadGroups
.
size
!=
readGroups
.
size
)
{
logger
.
info
(
MISSING_READ_GROUPS
+
": "
+
input
.
getAbsolutePath
)
import
scala.collection.JavaConversions._
for
(
readGroup
<-
CollectionUtils
.
subtract
(
allReadGroups
,
readGroups
))
{
logger
.
info
(
" "
+
readGroup
)
}
}
}
var
generalReport
:
RecalibrationReport
=
null
import
scala.collection.JavaConversions._
for
(
input
<-
inputs
if
!
new
RecalibrationReport
(
input
,
allReadGroups
).
isEmpty
)
{
val
inputReport
:
RecalibrationReport
=
new
RecalibrationReport
(
input
,
allReadGroups
)
if
(
generalReport
==
null
)
generalReport
=
inputReport
else
generalReport
.
combine
(
inputReport
)
}
if
(
generalReport
==
null
)
throw
new
ReviewedGATKException
(
EMPTY_INPUT_LIST
)
generalReport
.
calculateQuantizedQualities
return
generalReport
.
createGATKReport
}
}
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