Skip to content

Commit 4930f5f

Browse files
committed
Expand BAM header
1 parent e50b12c commit 4930f5f

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

singlecell/src/org/labkey/singlecell/run/NimbleBulkAlignmentStep.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,22 @@ public AlignmentOutput performAlignment(Readset rs, List<File> inputFastqs1, @Nu
8080
while (bamIdx < inputFastqs1.size())
8181
{
8282
File outputBam = new File(getPipelineCtx().getWorkingDirectory(), FileUtil.makeLegalName(rs.getName()) + ".unmapped." + bamIdx + ".bam");
83-
List<String> args = new ArrayList<>(Arrays.asList(st.getSamtoolsPath().getPath(), "import", "-o", outputBam.getPath(), "-r", "ID:" + readGroupId));
83+
List<String> args = new ArrayList<>(Arrays.asList(st.getSamtoolsPath().getPath(), "import", "-o", outputBam.getPath()));
84+
args.add("-r");
85+
args.add("ID:" + readGroupId);
86+
87+
args.add("-r");
88+
args.add("LB:" + rs.getReadsetId().toString());
89+
90+
args.add("-r");
91+
args.add("PL:" + (rs.getPlatform() == null ? "ILLUMINA" : rs.getPlatform()));
92+
93+
args.add("-r");
94+
args.add("PU:" + (platformUnit == null ? rs.getReadsetId().toString() : platformUnit));
95+
96+
args.add("-r");
97+
args.add("SM:" + rs.getName().replaceAll(" ", "_"));
98+
8499
if (inputFastqs2 == null || inputFastqs2.isEmpty())
85100
{
86101
args.add("-O");

0 commit comments

Comments
 (0)