Switch theme
docs / data_structures / read_group / inner_read_group_to_string

  • Search icon

Task

inner_read_group_to_string

Converts a ReadGroup struct to a String without any validation.
WDL Version
1.3
data_structures/read_group.wdl
RUN WITH

sprocket run --target inner_read_group_to_string data_structures/read_group.wdldata_structures\read_group.wdl [INPUTS]...

Inputs

Required Inputs

Name
Type
Description
read_group
ReadGroup struct to stringify
ReadGroup struct to stringify

Other Inputs

Name
Type
Default
Description
format_as_sam_record
Boolean
false
Format the ReadGroup as a SAM record?
Format the ReadGroup as a SAM record?
false
If true, the read group string will be prefixed with @RG and tab escape sequence (\t) delimiters will be used instead of space delimiters.
split_on_field
Boolean
false
Split the ReadGroup into separate lines for each field. Behavior is undefined if format_as_sam_record == true.
Split the ReadGroup into separate lines for each field. Behavior is undefined if format_as_sam_record == true.
false

Outputs

Name
Type
Expression
Description
stringified_read_group
String?
if split_on_field then None else read_string("out.txt")
Input ReadGroup as a string. Undefined if split_on_field == true.
Input ReadGroup as a string. Undefined if split_on_field == true.
if split_on_field then None else read_string("out.txt")
read_group_array
Array[String]?
if split_on_field then read_lines("out.txt") else None
Input ReadGroup as an Array[String]. Undefined if split_on_field == false.
Input ReadGroup as an Array[String]. Undefined if split_on_field == false.
if split_on_field then read_lines("out.txt") else None

Command

set -euo pipefail if ~{format_as_sam_record}; then echo -n "@RG~{delimiter}" > out.txt fi { echo -n "~{"ID:" + read_group.ID}" # required field. All others optional echo -n "~{delimiter + "BC:" + read_group.BC}" echo -n "~{delimiter + "CN:" + read_group.CN}" echo -n "~{delimiter + "DS:" + read_group.DS}" echo -n "~{delimiter + "DT:" + read_group.DT}" echo -n "~{delimiter + "FO:" + read_group.FO}" echo -n "~{delimiter + "KS:" + read_group.KS}" echo -n "~{delimiter + "LB:" + read_group.LB}" echo -n "~{delimiter + "PG:" + read_group.PG}" echo -n "~{delimiter + "PI:" + read_group.PI}" echo -n "~{delimiter + "PL:" + read_group.PL}" echo -n "~{delimiter + "PM:" + read_group.PM}" echo -n "~{delimiter + "PU:" + read_group.PU}" echo "~{delimiter + "SM:" + read_group.SM}" } >> out.txt