Skip to content

Commit

Permalink
Item #3 -- "Address my maintenance concerns about
Browse files Browse the repository at this point in the history
AnnotationUtils.isAlleleSpecific()"
  • Loading branch information
ldgauthier committed Aug 5, 2019
1 parent 1a290ae commit beb11af
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,7 @@ public static String encodeAnyASList( final List<?> somethingList) {
* @return true if the annotation is expected to have values per-allele
*/
public static boolean isAlleleSpecific(final InfoFieldAnnotation annotation) {
if (annotation instanceof AS_RankSumTest) {
return true;
}
if (annotation instanceof AS_StrandBiasTest) {
return true;
}
if (annotation instanceof AS_RMSMappingQuality) {
return true;
}
if (annotation instanceof AS_StandardAnnotation) {
if (annotation instanceof AlleleSpecificAnnotation) {
return true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
*/
//TODO: this can't extend InbreedingCoeff because that one is Standard and it would force this to be output all the time; should fix code duplication nonetheless
@DocumentedFeature(groupName=HelpConstants.DOC_CAT_ANNOTATORS, groupSummary=HelpConstants.DOC_CAT_ANNOTATORS_SUMMARY, summary="Allele-specific likelihood-based test for the consanguinity among samples (AS_InbreedingCoeff)")
public final class AS_InbreedingCoeff extends InfoFieldAnnotation implements AS_StandardAnnotation {
public final class AS_InbreedingCoeff extends InfoFieldAnnotation implements AS_StandardAnnotation, AlleleSpecificAnnotation {

public static final int MIN_SAMPLES = 10;
private Set<String> founderIds; //TODO: either use this or enter a bug report
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
* </ul>
*/
@DocumentedFeature(groupName=HelpConstants.DOC_CAT_ANNOTATORS, groupSummary=HelpConstants.DOC_CAT_ANNOTATORS_SUMMARY, summary="Allele-specific call confidence normalized by depth of sample reads supporting the allele (AS_QD)")
public class AS_QualByDepth extends InfoFieldAnnotation implements ReducibleAnnotation, AS_StandardAnnotation {
public class AS_QualByDepth extends InfoFieldAnnotation implements ReducibleAnnotation, AS_StandardAnnotation, AlleleSpecificAnnotation {

@Override
public List<String> getKeyNames() { return Arrays.asList(GATKVCFConstants.AS_QUAL_BY_DEPTH_KEY); }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* </ul>
*/
@DocumentedFeature(groupName=HelpConstants.DOC_CAT_ANNOTATORS, groupSummary=HelpConstants.DOC_CAT_ANNOTATORS_SUMMARY, summary="Allele-specific root-mean-square of the mapping quality of reads across all samples (AS_MQ)")
public final class AS_RMSMappingQuality extends InfoFieldAnnotation implements AS_StandardAnnotation, ReducibleAnnotation {
public final class AS_RMSMappingQuality extends InfoFieldAnnotation implements AS_StandardAnnotation, ReducibleAnnotation, AlleleSpecificAnnotation {

private final String printFormat = "%.2f";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/**
* Allele-specific implementation of rank sum test annotations
*/
public abstract class AS_RankSumTest extends RankSumTest implements ReducibleAnnotation {
public abstract class AS_RankSumTest extends RankSumTest implements ReducibleAnnotation, AlleleSpecificAnnotation {
private static final Logger logger = LogManager.getLogger(AS_RankSumTest.class);
public static final String RAW_DELIM = ",";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
/**
* Allele-specific implementation of strand bias annotations
*/
public abstract class AS_StrandBiasTest extends StrandBiasTest implements ReducibleAnnotation {
public abstract class AS_StrandBiasTest extends StrandBiasTest implements ReducibleAnnotation, AlleleSpecificAnnotation {
private final static Logger logger = LogManager.getLogger(AS_StrandBiasTest.class);
public static final String SPLIT_DELIM = "\\|"; //String.split takes a regex, so we need to escape the pipe
public static final String PRINT_DELIM = "|";
Expand Down

0 comments on commit beb11af

Please sign in to comment.