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

Update CombineGenotypingArrayVcfs to ignore differences in the refSNP field of INFO #1739

Merged
merged 1 commit into from
Oct 26, 2021
Merged
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
9 changes: 5 additions & 4 deletions src/main/java/picard/arrays/CombineGenotypingArrayVcfs.java
Original file line number Diff line number Diff line change
Expand Up @@ -228,19 +228,20 @@ public static VariantContext merge(final List<VariantContext> variantContexts) {
depth += vc.getAttributeAsInt(VCFConstants.DEPTH_KEY, 0);

// Go through all attributes - Ignore differences in AC, AF and AN as we recal later.
// Ignore differences in dev[XY]_AB and SOURCE as there are minor allowable changes
// Ignore differences in dev[XY]_AB and SOURCE/refSNP as there are minor allowable changes
for (final Map.Entry<String, Object> p : vc.getAttributes().entrySet()) {
final String key = p.getKey();
if ((!key.equals("AC")) && (!key.equals("AF")) && (!key.equals("AN")) &&
(!key.equals("devX_AB")) && (!key.equals("devY_AB")) && (!key.equals("SOURCE"))) {
(!key.equals("devX_AB")) && (!key.equals("devY_AB")) &&
(!key.equals("SOURCE")) && (!key.equals("refSNP"))) {
final Object value = p.getValue();
final Object extantValue = firstAttributes.get(key);
if (extantValue == null) {
// attribute in one VCF but not another. Die!
// attribute in one VCF but not another.
throw new PicardException("Attribute '" + key + "' not found in all VCFs");
}
else if (!extantValue.equals(value)) {
// Attribute disagrees in value between one VCF Die! (if not AC, AF, nor AN, skipped above)
// Attribute disagrees in value between one VCF and the other
throw new PicardException("Values for attribute '" + key + "' disagrees among input VCFs");
}
}
Expand Down