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

Commit

Permalink
Fix problem when annotating Delly2 VCF files (#88)
Browse files Browse the repository at this point in the history
Closes: #88
Related-Issue: #88
Projected-Results-Impact: none
  • Loading branch information
holtgrewe committed Dec 30, 2022
1 parent f226257 commit 6d37581
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -628,18 +628,18 @@ private void annotateSvVcf(
// Get list of filter values to skip.
final ImmutableSet skipFilters = ImmutableSet.copyOf(args.getSkipFilters().split(","));

final String defaultSvMethod;
final String svMethod;
if (callerSupport.getSvCaller() == SvCaller.GENERIC && !args.getDefaultSvMethod().equals(".")) {
defaultSvMethod = args.getDefaultSvMethod();
svMethod = args.getDefaultSvMethod();
} else {
defaultSvMethod = callerSupport.getSvMethod(reader);
svMethod = callerSupport.getSvMethod(reader);
}

// Helpers for building record for `.gts.tsv` and `.feature-effects.tsv` records.
final GtRecordBuilder gtRecordBuilder =
new GtRecordBuilder(
args.getRelease(),
defaultSvMethod,
svMethod,
args.getOptOutFeatures(),
args.getCaseId(),
args.getSetId(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class GtRecordBuilder {
public static final String FEATURE_CALLERS_ARRAY = "callers-array";

private final String release;
private final String defaultSvMethod;
private final String svMethod;
private final String optOutFeatures;
private final String caseId;
private final String setId;
Expand All @@ -28,14 +28,14 @@ public class GtRecordBuilder {

public GtRecordBuilder(
String release,
String defaultSvMethod,
String svMethod,
String optOutFeatures,
String caseId,
String setId,
Pedigree pedigree,
CallerSupport callerSupport) {
this.release = release;
this.defaultSvMethod = defaultSvMethod;
this.svMethod = svMethod;
this.optOutFeatures = optOutFeatures;
this.caseId = caseId;
this.setId = setId;
Expand Down Expand Up @@ -88,10 +88,6 @@ public GenotypeRecord buildRecord(
builder.setSetId(setId);
builder.setSvUuid(variantId.toString());

String svMethod = ctx.getCommonInfo().getAttributeAsString("SVMETHOD", null);
if (svMethod == null) {
svMethod = defaultSvMethod == null ? "." : defaultSvMethod;
}
builder.setCaller(svMethod);
if (!".".equals(svMethod)) {
builder.setCallers(ImmutableList.of(svMethod));
Expand Down

0 comments on commit 6d37581

Please sign in to comment.