Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Workaround for issue #2 #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
37 changes: 29 additions & 8 deletions jqc/src/main/java/jqc/SampleReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,40 @@ public SampleReport(String name, int index) {
*/
public void addVariant(VariantContext vc, VariantAnnotations va) {
Genotype gt = vc.getGenotype(this.idx);

if (gt.isNoCall()) { // ./. => skip statistics and count missing value.
this.n_missing++;
return;
} else if (gt.isHomRef()) // 0/0 => skip statistics. Ref genotype. Computation Ti/TV etc. is not needed.
return;

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check 1


// 1/1, 2/2, 0/1 and 1/2 we have to check if it is the same VarantAnnotation.
// But 1/2 we have to count twice. So the easiest way will be to check if one alternative allele of gt is va.getAlt;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to put this upwards

boolean foundAltAllele = false;
for (Allele allele : gt.getAlleles()) {
if (allele.isReference())
continue;
if (allele.getBaseString().equals(va.getAlt())) {
foundAltAllele = true;
break;
}
}
//skip
if (!foundAltAllele)
return;

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check 2

Annotation anno = va.getHighestImpactAnnotation(); // only highest-impact one
if (anno == null) {
System.err.println("[WARNING] No annotation found for variant " + vc);
return; // no annotation
}

if (gt.isNoCall()) {
this.n_missing++;
return;
}
if (gt.isHomVar())
this.n_homozygous++;
else if (gt.isHet()) // 0/1, 1/2,...
this.n_heterozygous++;

// To get the allelic depth
// gt.getAF getAD
//public abstract int[] getAD()
Expand All @@ -113,10 +137,7 @@ public void addVariant(VariantContext vc, VariantAnnotations va) {
}
}

if (gt.isHomVar())
this.n_homozygous++;
else if (gt.isHet())
this.n_heterozygous++;



String ref=va.getRef();
Expand Down