Fixes:
- Don't know how I got the wiggle header so utterly wrong. Fixed. - Q-values now have a static maximum of 2000 so IGV averaging won't make everything look spikey and ugly. - Changing windows to size 100 for (hopefully) better resolution. git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@5406 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
1b310401fe
commit
31a2575c7b
|
|
@ -22,9 +22,14 @@ import org.broadinstitute.sting.utils.collections.Pair;
|
|||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
public class AssociationTestRunner {
|
||||
final static int MAX_Q_VALUE = 2000;
|
||||
// todo -- this was written when ACs could implement interfaces, now that they extend, there's no multiple inheritance
|
||||
static Normal standardNormal = new Normal(0.0,1.0,null);
|
||||
|
||||
private static int pToQ(double p) {
|
||||
return Math.min((int) Math.floor(QualityUtils.phredScaleErrorRate(p)),MAX_Q_VALUE);
|
||||
}
|
||||
|
||||
public static String runTests(AssociationContext context) {
|
||||
List<String> results = new ArrayList<String>();
|
||||
if ( context instanceof TStatistic) {
|
||||
|
|
@ -58,15 +63,15 @@ public class AssociationTestRunner {
|
|||
*/
|
||||
public static int getQValue(AssociationContext context) {
|
||||
if ( context instanceof TStatistic ) {
|
||||
return (int) Math.floor(QualityUtils.phredScaleErrorRate(testStudentT((TStatistic) context).second));
|
||||
return pToQ(testStudentT((TStatistic) context).second);
|
||||
}
|
||||
|
||||
if ( context instanceof ZStatistic ) {
|
||||
return (int) Math.floor(QualityUtils.phredScaleErrorRate(testZ((ZStatistic) context).second));
|
||||
return pToQ(testZ((ZStatistic) context).second);
|
||||
}
|
||||
|
||||
if ( context instanceof UStatistic ) {
|
||||
return (int) Math.floor(QualityUtils.phredScaleErrorRate(mannWhitneyUTest((UStatistic) context).second));
|
||||
return pToQ(mannWhitneyUTest((UStatistic) context).second);
|
||||
}
|
||||
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ public class RegionalAssociationWalker extends LocusWalker<MapHolder, RegionalAs
|
|||
public void writeWiggleHeaders(Set<AssociationContext> cons) {
|
||||
for ( AssociationContext con : cons ) {
|
||||
GenomeLoc first = getToolkit().getIntervals().iterator().next();
|
||||
String header = String.format("fixedStep\tchrom=%s,start=%d,step=%d,span=%d",first.getContig(),first.getStart(),con.slideByValue(),con.getWindowSize());
|
||||
String header = String.format("fixedStep chrom=%s start=%d step=%d span=%d",first.getContig(),first.getStart(),con.slideByValue(),con.getWindowSize());
|
||||
out.get(con.getClass()).printf("%s%n",header);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public class BaseQualityScore extends TStatistic {
|
|||
return (Collection) baseQuals;
|
||||
}
|
||||
|
||||
public int getWindowSize() { return 200; }
|
||||
public int slideByValue() { return 25; }
|
||||
public int getWindowSize() { return 100; }
|
||||
public int slideByValue() { return 10; }
|
||||
public boolean usePreviouslySeenReads() { return true; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,8 +13,8 @@ import java.util.List;
|
|||
* @author chartl
|
||||
*/
|
||||
public class InsertSizeDistribution extends TStatistic {
|
||||
public int getWindowSize() { return 200; }
|
||||
public int slideByValue() { return 25; }
|
||||
public int getWindowSize() { return 100; }
|
||||
public int slideByValue() { return 10; }
|
||||
public boolean usePreviouslySeenReads() { return false; }
|
||||
|
||||
public Collection<Number> map(ReadBackedPileup pileup) {
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ public class MappingQuality0 extends ZStatistic {
|
|||
return new Pair<Number,Number>(mq0,total);
|
||||
}
|
||||
|
||||
public int getWindowSize() { return 200; }
|
||||
public int slideByValue() { return 25; }
|
||||
public int getWindowSize() { return 100; }
|
||||
public int slideByValue() { return 10; }
|
||||
public boolean usePreviouslySeenReads() { return false; }
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public class MateMappingQuality extends UStatistic {
|
|||
return (Collection) mateMapQ;
|
||||
}
|
||||
|
||||
public int getWindowSize() { return 200; }
|
||||
public int slideByValue() { return 25; }
|
||||
public int getWindowSize() { return 100; }
|
||||
public int slideByValue() { return 10; }
|
||||
public boolean usePreviouslySeenReads() { return false; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ import org.broadinstitute.sting.utils.pileup.ReadBackedPileup;
|
|||
*/
|
||||
public class MateOtherContig extends ZStatistic {
|
||||
|
||||
public int getWindowSize() { return 200; }
|
||||
public int slideByValue() { return 25; }
|
||||
public int getWindowSize() { return 100; }
|
||||
public int slideByValue() { return 10; }
|
||||
public boolean usePreviouslySeenReads() { return false; }
|
||||
|
||||
public Pair<Number,Number> map(ReadBackedPileup pileup) {
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public class MateSameStrand extends ZStatistic {
|
|||
return new Pair<Number,Number>(mateSameStrand,numPairs);
|
||||
}
|
||||
|
||||
public int getWindowSize() { return 200; }
|
||||
public int slideByValue() { return 25; }
|
||||
public int getWindowSize() { return 100; }
|
||||
public int slideByValue() { return 10; }
|
||||
public boolean usePreviouslySeenReads() { return false; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public class MateUnmapped extends ZStatistic {
|
|||
return new Pair<Number,Number>(numPairUnmapped,numMatedReads);
|
||||
}
|
||||
|
||||
public int getWindowSize() { return 200; }
|
||||
public int slideByValue() { return 25; }
|
||||
public int getWindowSize() { return 100; }
|
||||
public int slideByValue() { return 10; }
|
||||
public boolean usePreviouslySeenReads() { return false; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public class ProperPairs extends ZStatistic {
|
|||
return new Pair<Number,Number>(numPropPair,numReads);
|
||||
}
|
||||
|
||||
public int getWindowSize() { return 200; }
|
||||
public int slideByValue() { return 25; }
|
||||
public int getWindowSize() { return 100; }
|
||||
public int slideByValue() { return 10; }
|
||||
public boolean usePreviouslySeenReads() { return false; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ public class ReadClipping extends TStatistic {
|
|||
return (Collection) clipping;
|
||||
}
|
||||
|
||||
public int getWindowSize() { return 200; }
|
||||
public int slideByValue() { return 25; }
|
||||
public int getWindowSize() { return 100; }
|
||||
public int slideByValue() { return 10; }
|
||||
public boolean usePreviouslySeenReads() { return false; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ import java.util.Collection;
|
|||
* Time: 1:54 PM
|
||||
* To change this template use File | Settings | File Templates.
|
||||
*/
|
||||
public class ReadIndels extends TStatistic {
|
||||
public class ReadIndels extends UStatistic {
|
||||
|
||||
public Collection<Number> map(ReadBackedPileup rbp) {
|
||||
ArrayList<Integer> indelElements = new ArrayList<Integer>(rbp.size());
|
||||
|
|
@ -33,7 +33,7 @@ public class ReadIndels extends TStatistic {
|
|||
return (Collection) indelElements;
|
||||
}
|
||||
|
||||
public int getWindowSize() { return 200; }
|
||||
public int slideByValue() { return 25; }
|
||||
public int getWindowSize() { return 100; }
|
||||
public int slideByValue() { return 10; }
|
||||
public boolean usePreviouslySeenReads() { return false; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ public class ReadMappingQuality extends TStatistic {
|
|||
return (Collection) mapQuals;
|
||||
}
|
||||
|
||||
public int getWindowSize() { return 200; }
|
||||
public int slideByValue() { return 25; }
|
||||
public int getWindowSize() { return 100; }
|
||||
public int slideByValue() { return 10; }
|
||||
public boolean usePreviouslySeenReads() { return false; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -75,8 +75,8 @@ public class SampleDepth extends UStatistic {
|
|||
// note: this is to satisfy the interface, and is never called due to override
|
||||
public Collection<Number> map(ReadBackedPileup pileup) { return null; }
|
||||
|
||||
public int getWindowSize() { return 200; }
|
||||
public int slideByValue() { return 25; }
|
||||
public int getWindowSize() { return 100; }
|
||||
public int slideByValue() { return 10; }
|
||||
public boolean usePreviouslySeenReads() { return true; }
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue