-
-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New: added Barcode qualities keeping in FastqToBam #932
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -92,6 +92,7 @@ class FastqToBam | |||||
@arg(flag='s', doc="If true, queryname sort the BAM file, otherwise preserve input order.") val sort: Boolean = false, | ||||||
@arg(flag='u', doc="Tag in which to store molecular barcodes/UMIs.") val umiTag: String = ConsensusTags.UmiBases, | ||||||
@arg(flag='q', doc="Tag in which to store molecular barcode/UMI qualities.") val umiQualTag: Option[String] = None, | ||||||
@arg(flag='b', doc="Tag in which to store sample barcode qualities.") val smpQualTag: Option[String] = None, | ||||||
@arg(flag='n', doc="Extract UMI(s) from read names and prepend to UMIs from reads.") val extractUmisFromReadNames: Boolean = false, | ||||||
@arg( doc="Read group ID to use in the file header.") val readGroupId: String = "A", | ||||||
@arg( doc="The name of the sequenced sample.") val sample: String, | ||||||
|
@@ -157,6 +158,7 @@ class FastqToBam | |||||
try { | ||||||
val subs = fqs.iterator.zip(structures.iterator).flatMap { case(fq, rs) => rs.extract(fq.bases, fq.quals) }.toIndexedSeq | ||||||
val sampleBarcode = subs.iterator.filter(_.kind == SampleBarcode).map(_.bases).mkString("-") | ||||||
val smpQual = subs.iterator.filter(_.kind == SampleBarcode).map(_.quals).mkString(" ") | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
val umi = subs.iterator.filter(_.kind == MolecularBarcode).map(_.bases).mkString("-") | ||||||
val umiQual = subs.iterator.filter(_.kind == MolecularBarcode).map(_.quals).mkString(" ") | ||||||
val templates = subs.iterator.filter(_.kind == Template).toList | ||||||
|
@@ -181,6 +183,7 @@ class FastqToBam | |||||
} | ||||||
|
||||||
if (sampleBarcode.nonEmpty) rec("BC") = sampleBarcode | ||||||
if (smpQual.nonEmpty) smpQualTag.foreach(rec(_) = smpQual) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd hard code to |
||||||
|
||||||
// Set the UMI on the read depending on whether we got UMIs from the read names, reads or both | ||||||
(umi, umiFromReadName) match { | ||||||
|
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.
since we have a short flag, it's not the worst to have a fully qualified long name
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 do you thin about just making this a
boolean
value, and then hard codeQT
below (like we do forBC
) since thats the recommended tag from the SAM spec?