-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
adds a barcode option to FastqToBam #936
Conversation
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.
Let’s leave out the change for platform unit as I don’t think it’s wrong to have the sample barcode as part of the platform unit, and in some cases is useful (we did this at my time at Broad, often)
This reverts commit b960886. GATK seems to want a sample-barcode in there too >PU = Platform Unit >The PU holds three types of information, the {FLOWCELL_BARCODE}.{LANE}.{SAMPLE_BARCODE}. The {FLOWCELL_BARCODE} refers to the unique identifier for a particular flow cell. The {LANE} indicates the lane of the flow cell and the {SAMPLE_BARCODE} is a sample/library-specific identifier. Although the PU is not required by GATK but takes precedence over ID for base recalibration if it is present. In the example shown earlier, two read group fields, ID and PU, appropriately differentiate flow cell lane, marked by .2, a factor that contributes to batch effects. >(https://gatk.broadinstitute.org/hc/en-us/articles/360035890671-Read-groups)
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.
One more question, thanks for your patience!
@@ -96,6 +96,7 @@ class FastqToBam | |||
@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, | |||
@arg( doc="The name/ID of the sequenced library.") val library: String, | |||
@arg( doc="Library or Sample barcode sequence.") val barcode: Option[String] = None, |
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.
Thinking about this further, how would you feel about making this a Seq[String]
with default Seq.empty
, then joining them with a hyphen? That way folks don't have to do so themselves?
@arg( doc="Library or Sample barcode sequence.") val barcode: Option[String] = None, | |
@arg( doc="Library or Sample barcode sequence.", minElements=0) val barcode: Seq[String] = Seq.empty, |
@@ -135,6 +136,7 @@ class FastqToBam | |||
val rg = new SAMReadGroupRecord(this.readGroupId) | |||
rg.setSample(sample) | |||
rg.setLibrary(library) | |||
this.barcode.foreach(bc => rg.setBarcodes(util.Arrays.asList(bc))) |
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.
not in an idea, but this could work:
this.barcode.foreach(bc => rg.setBarcodes(util.Arrays.asList(bc)))
if (this.barcode.nonEmpty) rg.setBarcodes(...)
I tried this but i was surprised to see that ... I've done like you asked but it's a bit too much magic for my taste... |
@bwlang want to revert to the pre- |
It doesn't really matter which way we pass the barcodes in. |
Thank-you for your patience @bwlang ! Making sure unit tests pass here, then I'll merge. |
No description provided.