Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
Merge aa74b9b into 4e2d799
Browse files Browse the repository at this point in the history
  • Loading branch information
holtgrewe committed Nov 24, 2022
2 parents 4e2d799 + aa74b9b commit fa5ef15
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## v0.28 (work in progress)

- Suppress BND records that point to non-allow-listed contigs (#85).
This is required for processing Manta and Delly2 results, for example.

## v0.27

**IMPORTANT COMPATIBILITY NOTE:**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,26 @@ private boolean skipRecord(
return true;
}

if ("BND".equals(ctx.getCommonInfo().getAttributeAsString("SVTYPE", ""))) {
final Pattern BND_PATTERN =
Pattern.compile(
"^(?<leadingBases>\\w*)(?<firstBracket>[\\[\\]])(?<targetContig>[^:]+):(?<targetPos>\\w+)"
+ "(?<secondBracket>[\\[\\]])(?<trailingBases>\\w*)$");
final String altStr = ctx.getAlternateAllele(0).toString();
final Matcher matcher = BND_PATTERN.matcher(altStr);
if (!matcher.matches()) {
System.err.println(altStr);
}
final String targetContig = matcher.group("targetContig");
if (skippedContigs.contains(targetContig)) {
return true; // skip silently
} else if (!targetContig.matches(args.getContigRegex())) {
System.err.println("Skipping targetContig " + targetContig);
skippedContigs.add(targetContig);
return true;
}
}

return false;
}

Expand Down

0 comments on commit fa5ef15

Please sign in to comment.