示例#1
0
 String countsString() {
   return mReadGroup
       + "\t"
       + mTotalReference
       + "\t"
       + mLengthDist.count()
       + "\t"
       + Utils.realFormat(mLengthDist.sum())
       + "\t"
       + Utils.realFormat(mLengthDist.sumSq())
       + "\t"
       + mFragmentSizeDist.count()
       + "\t"
       + Utils.realFormat(mFragmentSizeDist.sum())
       + "\t"
       + Utils.realFormat(mFragmentSizeDist.sumSq())
       + "\t"
       + mGapSizeDist.count()
       + "\t"
       + Utils.realFormat(mGapSizeDist.sum())
       + "\t"
       + Utils.realFormat(mGapSizeDist.sumSq())
       + "\t"
       + mMaxAlignment
       + "\t"
       + mProper
       + "\t"
       + mDiscordant
       + "\t"
       + mUnmated;
 }
示例#2
0
 void add(ReadGroupStats stats) {
   mLengthDist.add(stats.mLengthDist);
   mFragmentSizeDist.add(stats.mFragmentSizeDist);
   mGapSizeDist.add(stats.mGapSizeDist);
   mMaxAlignment = Math.max(mMaxAlignment, stats.mMaxAlignment);
   mProper += stats.mProper;
   mDiscordant += stats.mDiscordant;
   mUnmated += stats.mUnmated;
   if (detectOverflow()) {
     throw new NoTalkbackSlimException(
         "Overflow detected in read group statistics calculation for read group: " + id());
   }
 }
示例#3
0
  void calculate() {
    if (mLengthDist != null) {
      mMeanLength = mLengthDist.count() > 1 ? mLengthDist.mean() : 0;
      mFragmentStdDev = mFragmentSizeDist.count() > 1 ? mFragmentSizeDist.stdDev() + TINY : 0;
      mFragmentMean = mFragmentSizeDist.count() > 1 ? mFragmentSizeDist.mean() : 0;
      mGapStdDev = mGapSizeDist.count() > 1 ? mGapSizeDist.stdDev() + TINY : 0;
      mGapMean = mGapSizeDist.count() > 1 ? mGapSizeDist.mean() : 0;
      mProperRate = (double) (mProper + 1) / mTotalReference / 2.0 + TINY;
      mDiscordantRate = (double) (mDiscordant + 1) / mTotalReference / 2.0 + TINY;
      mUnmatedRate = (double) (mUnmated + 1) / mTotalReference / 2.0 + TINY;

      mProperRandomRate = mDiscordantRate * mUnmatedRate;
      // TODO we think this should be better:
      // mProperRandomRate = mDiscordantRate * (2 * mGapStdDev / mTotalReference);
      mAlignmentStartIgnored = (int) (mMeanLength * mAlignmentStartIgnoredFraction / 100);
    }
  }
示例#4
0
 boolean detectOverflow() {
   return mProper < 0 || mDiscordant < 0 || mUnmatedRate < 0 || mLengthDist.count() < 0;
 }
示例#5
0
 void addGapSize(int value) {
   mGapSizeDist.add(value);
 }
示例#6
0
 void addFragmentSize(int value) {
   mFragmentSizeDist.add(value);
 }
示例#7
0
 void addLength(int readlen) {
   mLengthDist.add(readlen);
 }