Skip to content

Commit

Permalink
Linx:
Browse files Browse the repository at this point in the history
- filter out any SV filter except PASS, INFERRED or empty
  • Loading branch information
charlesshale committed Sep 13, 2019
1 parent 565358e commit 1de2538
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class StructuralVariantFactory {
public final static String RECOVERED = "RECOVERED";
public final static String RECOVERY_METHOD = "RECOVERY_METHOD";
public final static String RECOVERY_FILTER = "RECOVERY_FILTER";
public static final String PASS = "PASS";
public static final String INFERRED = "INFERRED";
public final static String CIPOS = "CIPOS";
public final static String SVTYPE = "SVTYPE";
Expand Down Expand Up @@ -449,10 +450,10 @@ private static String filters(@NotNull VariantContext context, @Nullable Variant
}
if (filters.size() > 1) {
// Doesn't pass if a filter is applied to either of the two records
filters.remove("PASS");
filters.remove(PASS);
}
if (filters.size() == 0) {
filters.add("PASS");
filters.add(PASS);
}
return filters.stream().sorted().collect(Collectors.joining(";"));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.hartwig.hmftools.linx;

import static com.hartwig.hmftools.common.variant.structural.StructuralVariantFactory.INFERRED;
import static com.hartwig.hmftools.common.variant.structural.StructuralVariantFactory.PASS;
import static com.hartwig.hmftools.common.variant.structural.StructuralVariantFactory.PON_FILTER_PON;
import static com.hartwig.hmftools.linx.LinxConfig.DB_PASS;
import static com.hartwig.hmftools.linx.LinxConfig.DB_URL;
Expand Down Expand Up @@ -259,13 +261,12 @@ private static List<SvVarData> createSvData(List<StructuralVariantData> svRecord
{
List<SvVarData> svVarDataItems = Lists.newArrayList();

for (final StructuralVariantData svRecord : svRecords) {

if(svRecord.filter().equals(PON_FILTER_PON))
continue;

// all others (currently PASS or blank) are accepted
svVarDataItems.add(new SvVarData(svRecord));
for (final StructuralVariantData svRecord : svRecords)
{
if(svRecord.filter().isEmpty() || svRecord.filter().equals(PASS) || svRecord.filter().equals(INFERRED))
{
svVarDataItems.add(new SvVarData(svRecord));
}
}

return svVarDataItems;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.hartwig.hmftools.linx.utils;

import static com.hartwig.hmftools.common.variant.structural.StructuralVariantFactory.PASS;
import static com.hartwig.hmftools.common.variant.structural.StructuralVariantType.BND;
import static com.hartwig.hmftools.common.variant.structural.StructuralVariantType.DEL;
import static com.hartwig.hmftools.common.variant.structural.StructuralVariantType.DUP;
Expand Down Expand Up @@ -85,7 +86,7 @@ public static SvVarData createTestSv(final int varId, final String chrStart, fin
long posStart, long posEnd, int orientStart, int orientEnd, StructuralVariantType type,
double cnStart, double cnEnd, double cnChgStart, double cnChgEnd, double ploidy, final String insertSeq)
{
return createTestSv(varId, chrStart, chrEnd, posStart, posEnd, orientStart, orientEnd, type, cnStart, cnEnd, cnChgStart, cnChgEnd, ploidy, insertSeq, "PASS");
return createTestSv(varId, chrStart, chrEnd, posStart, posEnd, orientStart, orientEnd, type, cnStart, cnEnd, cnChgStart, cnChgEnd, ploidy, insertSeq, PASS);
}

public static SvVarData createTestSv(final int varId, final String chrStart, final String chrEnd,
Expand Down

0 comments on commit 1de2538

Please sign in to comment.