Spurious associations can develop from including ambiguous reads in these tests. Perhaps MQ0 reads shouldn't be used for anything except MQ0, but the best way to do that is to restructure the code, so for now I'll put it off.
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5656 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
49ea07acce
commit
e28fc21642
|
|
@ -11,13 +11,16 @@ import java.util.List;
|
|||
* @author chartl
|
||||
*/
|
||||
public class InsertSizeDistribution extends ValueTest {
|
||||
private final int MAPQ_THRESHOLD = 5;
|
||||
|
||||
public boolean usePreviouslySeenReads() { return false; }
|
||||
|
||||
public Collection<Number> map(ReadBackedPileup pileup) {
|
||||
List<Integer> insertSizes = new ArrayList<Integer>(pileup.size());
|
||||
for ( PileupElement e : pileup ) {
|
||||
insertSizes.add(Math.abs(e.getRead().getInferredInsertSize()));
|
||||
if ( e.getMappingQual() >= MAPQ_THRESHOLD ) {
|
||||
insertSizes.add(Math.abs(e.getRead().getInferredInsertSize()));
|
||||
}
|
||||
}
|
||||
|
||||
return (Collection) insertSizes;
|
||||
|
|
|
|||
|
|
@ -13,13 +13,15 @@ import org.broadinstitute.sting.utils.pileup.ReadBackedPileup;
|
|||
*/
|
||||
public class MateOtherContig extends ProportionTest {
|
||||
|
||||
private final int MAPQ_THRESHOLD = 5;
|
||||
|
||||
public boolean usePreviouslySeenReads() { return false; }
|
||||
|
||||
public Pair<Number,Number> map(ReadBackedPileup pileup) {
|
||||
int tot = 0;
|
||||
int otherCon = 0;
|
||||
for ( PileupElement e : pileup ) {
|
||||
if ( e.getRead().getReadPairedFlag() ) {
|
||||
if ( e.getRead().getReadPairedFlag() && e.getRead().getMappingQuality() >= MAPQ_THRESHOLD ) {
|
||||
++tot;
|
||||
if ( ! e.getRead().getMateReferenceIndex().equals(e.getRead().getReferenceIndex()) ) {
|
||||
++otherCon;
|
||||
|
|
|
|||
|
|
@ -12,12 +12,13 @@ import org.broadinstitute.sting.utils.pileup.ReadBackedPileup;
|
|||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
public class MateSameStrand extends ProportionTest {
|
||||
private final int MAPQ_THRESHOLD = 5;
|
||||
|
||||
public Pair<Number,Number> map(ReadBackedPileup rbp) {
|
||||
int numPairs = 0;
|
||||
int mateSameStrand = 0;
|
||||
for (PileupElement e : rbp ) {
|
||||
if ( e.getRead().getReadPairedFlag() ) {
|
||||
if ( e.getRead().getReadPairedFlag() && e.getMappingQual() >= MAPQ_THRESHOLD) {
|
||||
++numPairs;
|
||||
if ( e.getRead().getMateNegativeStrandFlag() == e.getRead().getReadNegativeStrandFlag() ) {
|
||||
++mateSameStrand;
|
||||
|
|
|
|||
|
|
@ -12,12 +12,13 @@ import org.broadinstitute.sting.utils.pileup.ReadBackedPileup;
|
|||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
public class MateUnmapped extends ProportionTest {
|
||||
private final int MAPQ_THRESHOLD = 5;
|
||||
|
||||
public Pair<Number,Number> map(ReadBackedPileup pileup) {
|
||||
int numMatedReads = 0;
|
||||
int numPairUnmapped = 0;
|
||||
for (PileupElement e : pileup ) {
|
||||
if (e.getRead().getReadPairedFlag() ) {
|
||||
if (e.getRead().getReadPairedFlag() && e.getMappingQual() >= MAPQ_THRESHOLD ) {
|
||||
++numMatedReads;
|
||||
if ( e.getRead().getMateUnmappedFlag() ) {
|
||||
++numPairUnmapped;
|
||||
|
|
|
|||
|
|
@ -12,14 +12,17 @@ import org.broadinstitute.sting.utils.pileup.ReadBackedPileup;
|
|||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
public class ProperPairs extends ProportionTest {
|
||||
private final int MAPQ_THRESHOLD = 5;
|
||||
|
||||
public Pair<Number,Number> map(ReadBackedPileup rbp) {
|
||||
int numReads = 0;
|
||||
int numPropPair = 0;
|
||||
for (PileupElement e : rbp ) {
|
||||
++numReads;
|
||||
if ( e.getRead().getReadPairedFlag() && e.getRead().getProperPairFlag() ) {
|
||||
++numPropPair;
|
||||
if ( e.getRead().getReadPairedFlag() && e.getMappingQual() >= MAPQ_THRESHOLD ) {
|
||||
++numReads;
|
||||
if ( e.getRead().getReadPairedFlag() && e.getRead().getProperPairFlag() ) {
|
||||
++numPropPair;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package org.broadinstitute.sting.oneoffprojects.walkers.association.modules.casecontrol;
|
||||
|
||||
import net.sf.samtools.CigarElement;
|
||||
import net.sf.samtools.CigarOperator;
|
||||
import org.broadinstitute.sting.utils.collections.Pair;
|
||||
import org.broadinstitute.sting.utils.pileup.PileupElement;
|
||||
|
|
@ -19,8 +20,11 @@ public class ReadsWithIndels extends ProportionTest {
|
|||
int numWithIndels = 0;
|
||||
for ( PileupElement e : pileup ) {
|
||||
++numReads;
|
||||
if ( e.getRead().getCigar().getCigarElements().contains(CigarOperator.DELETION) || e.getRead().getCigar().getCigarElements().contains(CigarOperator.INSERTION)) {
|
||||
++numWithIndels;
|
||||
for ( CigarElement element : e.getRead().getCigar().getCigarElements() ) {
|
||||
if ( element.getOperator().equals(CigarOperator.DELETION) || element.getOperator().equals(CigarOperator.INSERTION) ) {
|
||||
++numWithIndels;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue