Skip to content
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

tweak bwa to allow gappier alignments in local assemblies #4708

Merged
merged 1 commit into from
Apr 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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