Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mirrors
biopet.biopet
Commits
04ba5a27
Commit
04ba5a27
authored
May 14, 2016
by
Peter van 't Hof
Browse files
Added a precheck when using bedfiles with wrong contig in there
parent
43253296
Changes
2
Hide whitespace changes
Inline
Side-by-side
bammetrics/src/main/scala/nl/lumc/sasc/biopet/pipelines/bammetrics/BamMetrics.scala
View file @
04ba5a27
...
...
@@ -17,15 +17,16 @@ package nl.lumc.sasc.biopet.pipelines.bammetrics
import
java.io.File
import
nl.lumc.sasc.biopet.core.annotations.
{
RibosomalRefFlat
,
Annotation
RefFlat
}
import
nl.lumc.sasc.biopet.core.annotations.
{
AnnotationRefFlat
,
Ribosomal
RefFlat
}
import
nl.lumc.sasc.biopet.utils.config.Configurable
import
nl.lumc.sasc.biopet.core.summary.SummaryQScript
import
nl.lumc.sasc.biopet.core.
{
Reference
,
BiopetFifoPipe
,
PipelineCommand
,
SampleLibraryTag
}
import
nl.lumc.sasc.biopet.extensions.bedtools.
{
BedtoolsCoverage
,
BedtoolsIntersect
}
import
nl.lumc.sasc.biopet.core.
{
BiopetFifoPipe
,
PipelineCommand
,
Reference
,
SampleLibraryTag
}
import
nl.lumc.sasc.biopet.extensions.bedtools.
{
BedtoolsCoverage
,
BedtoolsIntersect
}
import
nl.lumc.sasc.biopet.extensions.picard._
import
nl.lumc.sasc.biopet.extensions.samtools.SamtoolsFlagstat
import
nl.lumc.sasc.biopet.pipelines.bammetrics.scripts.CoverageStats
import
nl.lumc.sasc.biopet.extensions.tools.BiopetFlagstat
import
nl.lumc.sasc.biopet.utils.intervals.BedCheck
import
org.broadinstitute.gatk.queue.QScript
class
BamMetrics
(
val
root
:
Configurable
)
extends
QScript
...
...
@@ -72,6 +73,8 @@ class BamMetrics(val root: Configurable) extends QScript
/** executed before script */
def
init
()
:
Unit
=
{
inputFiles
:+=
new
InputFile
(
inputBam
)
ampliconBedFile
.
foreach
(
BedCheck
.
checkBedFileToReference
(
_
,
referenceFasta
()))
roiBedFiles
.
foreach
(
BedCheck
.
checkBedFileToReference
(
_
,
referenceFasta
()))
}
/** Script to add jobs */
...
...
biopet-utils/src/main/scala/nl/lumc/sasc/biopet/utils/intervals/BedCheck.scala
0 → 100644
View file @
04ba5a27
package
nl.lumc.sasc.biopet.utils.intervals
import
java.io.File
import
scala.collection.mutable.Set
import
nl.lumc.sasc.biopet.utils.Logging
/**
* Created by pjvanthof on 14/05/16.
*/
object
BedCheck
{
private
val
cache
:
Set
[(
File
,
File
)]
=
Set
()
def
checkBedFileToReference
(
bedFile
:
File
,
reference
:
File
,
biopetError
:
Boolean
=
false
,
ignoreCache
:
Boolean
=
false
)
:
Unit
=
{
if
(
ignoreCache
||
!
cache
.
contains
((
bedFile
,
reference
)))
{
cache
.
add
((
bedFile
,
reference
))
val
bedrecords
=
BedRecordList
.
fromFile
(
bedFile
)
if
(
biopetError
)
{
try
{
bedrecords
.
validateContigs
(
reference
)
}
catch
{
case
e
:
IllegalArgumentException
=>
Logging
.
addError
(
e
.
getMessage
)
}
}
else
bedrecords
.
validateContigs
(
reference
)
}
}
}
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment