-
Notifications
You must be signed in to change notification settings - Fork 14
Yf contaminate and estimate bid #384
base: main
Are you sure you want to change the base?
Yf contaminate and estimate bid #384
Conversation
/* | ||
* The MIT License | ||
* | ||
* Copyright (c) 2016 Fulcrum Genomics LLC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Copyright (c) 2016 Fulcrum Genomics LLC | |
* Copyright (c) 2020 Fulcrum Genomics LLC |
* and run VBID with different number of target snps to evaluate | ||
* dependance of VBID on contamination & depth & number of target snps | ||
*/ | ||
@clp(description = "Example FASTQ to BAM pipeline.", group = classOf[Pipelines]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Longer description? Also, not a FASTQ to BAM pipeline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the output files it creates?
val tmpBam = out.resolve(prefix + ".tmp.bam") | ||
val metricsPrefix: Some[DirPath] = Some(out.resolve(prefix)) | ||
Files.createDirectories(out) | ||
val bamYield = new mutable.HashMap[PathToBam, Int] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this thread safe?
bams.map(bam => { | ||
val metricPath: Path = out.resolve(prefix + bam.getFileName + ".qualityYieldMetrics") | ||
val hsMetrics = new CollectHsMetrics(in = bam, ref = ref, targets = targets, prefix = Some(out.resolve(prefix))) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra newline?
val pairsOfBam = for (x <- bams; y <- bams) yield (x, y) | ||
|
||
pairsOfBam.foreach { case (x, y) => { | ||
contaminations.foreach(c => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contaminations.foreach(c => { | |
contaminations.foreach { c => |
val bamYield = new mutable.HashMap[PathToBam, Int] | ||
|
||
bams.map(bam => { | ||
val metricPath: Path = out.resolve(prefix + bam.getFileName + ".qualityYieldMetrics") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the suffix be the same one that CollectMultipleMetrics would produce? Then MultiQC can be used too!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this qualityYieldMetrics
when the output is presumably from HsMetrics?
val xyContaminatedBam = out.resolve(prefix + "__" + x.getFileName + "__" + y.getFileName + | ||
"__" + c + ".bam") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why double underscores? also, use string interpolation.
val xyContaminatedBam = out.resolve(prefix + "__" + x.getFileName + "__" + y.getFileName + | |
"__" + c + ".bam") | |
val xyContaminatedBam = out.resolve(f"${prefix}__${x.getFileName}__${y.getFileName}__${c}.bam") |
|
||
root ==> downsample ==> mergedownsampled | ||
|
||
depths filter (d => d <= resultantDepth) foreach { d => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
depths filter (d => d <= resultantDepth) foreach { d => { | |
depths.filter(_ <= resultantDepth).foreach { d => |
|
||
depths filter (d => d <= resultantDepth) foreach { d => { | ||
val outDownsampled = out.resolve(prefix + "__" + x.getFileName + "__" + y.getFileName + | ||
"__" + c + "__target__" + d + ".bam") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto, double underscore
/* | ||
* The MIT License | ||
* | ||
* Copyright (c) 2015 Fulcrum Genomics LLC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
license
… appropriately downsample it using the targets.
… parts: -- simulate and generate bams -- downsample bam and contaminate bams -- downsample markers and estimate contamination
90e526b
to
f48ab5c
Compare
just a quick draft to get comments on my first attempt at using dagr.
@tfenne