Package net.sf.cram.encoding.read_features

Examples of net.sf.cram.encoding.read_features.BaseQualityScore


    BitCodec<BaseQualityScore> codec = new BitCodec<BaseQualityScore>() {

      @Override
      public BaseQualityScore read(BitInputStream bis) throws IOException {
        BaseQualityScore bqs = new BaseQualityScore(-1,
            qualityScoreCodec.read(bis));
        return bqs;
      }

      @Override
      public long write(BitOutputStream bos, BaseQualityScore bqs)
          throws IOException {
        return qualityScoreCodec.write(bos, bqs.getQualityScore());
      }

      @Override
      public long numberOfBits(BaseQualityScore bqs) {
        return qualityScoreCodec.numberOfBits(bqs.getQualityScore());
      }
    };

    DefaultMutableTreeNode node = buildNode(codec, "Base QS codec");
    parent.add(node);
View Full Code Here


      boolean qualityMasked = (scores[i] < uncategorisedQualityScoreCutoff);
      if (captureInsertScores || qualityMasked) {
        byte score = (byte) (QS_asciiOffset + scores[zeroBasedPositionInRead
            + i]);
        // if (score >= QS_asciiOffset) {
        features.add(new BaseQualityScore(zeroBasedPositionInRead + 1
            + i, score));
        landedTotalScores++;
        // }
      }
    }
View Full Code Here

          continue;

        if (captureSubtitutionScores) {
          byte score = (byte) (QS_asciiOffset + qualityScore[i
              + fromPosInRead]);
          features.add(new BaseQualityScore(oneBasedPositionInRead,
              score));
          qualityAdded = true;
        }
      }

      if (noQS)
        continue;

      if (!qualityAdded && refSNPs != null) {
        byte snpOrNot = refSNPs[refCoord];
        if (snpOrNot != 0) {
          byte score = (byte) (QS_asciiOffset + qualityScore[i
              + fromPosInRead]);
          features.add(new BaseQualityScore(oneBasedPositionInRead,
              score));
          qualityAdded = true;
          landedRefMaskScores++;
        }
      }

      if (!qualityAdded && refPile != null) {
        if (refPile.shouldStore(refCoord, refBase)) {
          byte score = (byte) (QS_asciiOffset + qualityScore[i
              + fromPosInRead]);
          features.add(new BaseQualityScore(oneBasedPositionInRead,
              score));
          qualityAdded = true;
          landedPiledScores++;
        }
      }

      qualityMasked = (qualityScore[i + fromPosInRead] < uncategorisedQualityScoreCutoff);
      if (!qualityAdded && qualityMasked) {
        byte score = (byte) (QS_asciiOffset + qualityScore[i
            + fromPosInRead]);
        features.add(new BaseQualityScore(oneBasedPositionInRead, score));
        qualityAdded = true;
      }

      if (qualityAdded)
        landedTotalScores++;
View Full Code Here

    if (!r.forcePreserveQualityScores) {
      for (int i = 0; i < scores.length; i++) {
        if (scores[i] > -1) {
          if (r.getReadFeatures() == null) r.setReadFeatures(new LinkedList<ReadFeature>()) ;
          r.getReadFeatures().add(
              new BaseQualityScore(i + 1, scores[i]));
        }
      }
      if (r.getReadFeatures() != null)
        Collections.sort(r.getReadFeatures(),
            readFeaturePositionComparator);
View Full Code Here

          case InsertBase.operator:
            InsertBase ib = new InsertBase(pos, bc.readData());
            rf.add(ib);
            break;
          case BaseQualityScore.operator:
            BaseQualityScore bqs = new BaseQualityScore(pos,
                qc.readData());
            rf.add(bqs);
            break;
          default:
            throw new RuntimeException(
View Full Code Here

        case InsertBase.operator:
          InsertBase ib = (InsertBase) f;
          bc.writeData(ib.getBase());
          break;
        case BaseQualityScore.operator:
          BaseQualityScore bqs = (BaseQualityScore) f;
          qc.writeData(bqs.getQualityScore());
          break;
        default:
          throw new RuntimeException(
              "Unknown read feature operator: "
                  + (char) f.getOperator());
View Full Code Here

                "ACGT".getBytes()[random.nextInt(4)],
                (byte) (33 + random.nextInt(40)));
            record.getReadFeatures().add(rb);
            break;
          case BaseQualityScore.operator:
            BaseQualityScore qs = new BaseQualityScore(newPos,
                (byte) (33 + random.nextInt(40)));
            record.getReadFeatures().add(qs);
            break;
          case InsertBase.operator:
            InsertBase ib = new InsertBase();
View Full Code Here

TOP

Related Classes of net.sf.cram.encoding.read_features.BaseQualityScore

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.