Skip to content

Commit

Permalink
tweak bwa to allow gappier alignments in local assemblies
Browse files Browse the repository at this point in the history
  • Loading branch information
tedsharpe committed Apr 25, 2018
1 parent 949c69b commit 4abfb80
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ public static class FindBreakpointEvidenceSparkArgumentCollection implements Ser
@Argument(doc = "Traverse assembly graph and produce contigs for all paths.", fullName = "expand-assembly-graph")
public boolean expandAssemblyGraph = true;

@Advanced @Argument(doc = "ZDropoff (see Bwa mem manual) for contig alignment.", fullName = "z-dropoff")
public int zDropoff = 20;

// --------- locations ----------

@Argument(doc = "bwa-mem index image file", fullName = "aligner-index-image")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,20 @@ public final class FermiLiteAssemblyHandler implements FindBreakpointEvidenceSpa
private final boolean popVariantBubbles;
private final boolean removeShadowedContigs;
private final boolean expandAssemblyGraph;
private final int zDropoff;

public FermiLiteAssemblyHandler( final String alignerIndexFile, final int maxFastqSize,
final String fastqDir, final boolean writeGFAs,
final boolean popVariantBubbles, final boolean removeShadowedContigs,
final boolean expandAssemblyGraph ) {
final boolean expandAssemblyGraph, final int zDropoff ) {
this.alignerIndexFile = alignerIndexFile;
this.maxFastqSize = maxFastqSize;
this.fastqDir = fastqDir;
this.writeGFAs = writeGFAs;
this.popVariantBubbles = popVariantBubbles;
this.removeShadowedContigs = removeShadowedContigs;
this.expandAssemblyGraph = expandAssemblyGraph;
this.zDropoff = zDropoff;
}

/** This method creates an assembly with FermiLite, and uses the graph information returned by that
Expand Down Expand Up @@ -99,6 +101,7 @@ public AlignedAssemblyOrExcuse apply( final Tuple2<Integer, List<SVFastqUtils.Fa
// align the assembled contigs to the genomic reference
try ( final BwaMemAligner aligner = new BwaMemAligner(BwaMemIndexCache.getInstance(alignerIndexFile)) ) {
aligner.setIntraCtgOptions();
aligner.setZDropOption(zDropoff);
final List<byte[]> sequences =
assembly.getContigs().stream()
.map(Contig::getSequence)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public static AssembledEvidenceResults gatherEvidenceAndWriteContigSamFile(
new FermiLiteAssemblyHandler(params.alignerIndexImageFile, params.maxFASTQSize,
params.fastqDir, params.writeGFAs,
params.popVariantBubbles, params.removeShadowedContigs,
params.expandAssemblyGraph);
params.expandAssemblyGraph, params.zDropoff);
alignedAssemblyOrExcuseList.addAll(
handleAssemblies(ctx, qNamesMultiMap, unfilteredReads, filter, intervals.size(),
params.includeMappingLocation, fermiLiteAssemblyHandler));
Expand Down

0 comments on commit 4abfb80

Please sign in to comment.