Examples of numCigarElements()


Examples of htsjdk.samtools.Cigar.numCigarElements()

    int getNumClippedBasesAtEnd(SAMRecord read) {
        // compute total number of clipped bases (soft or hard clipped)
        // check for hard clips (never consider these bases):
        final Cigar c = read.getCigar();
        CigarElement last = c.getCigarElement(c.numCigarElements() - 1);

        int numEndClippedBases = 0;
        if (last.getOperator() == CigarOperator.H) {
            numEndClippedBases = last.getLength();
        }
View Full Code Here

Examples of htsjdk.samtools.Cigar.numCigarElements()

    int getNumClippedBasesAtEnd(SAMRecord read) {
        // compute total number of clipped bases (soft or hard clipped)
        // check for hard clips (never consider these bases):
        final Cigar c = read.getCigar();
        CigarElement last = c.getCigarElement(c.numCigarElements() - 1);

        int numEndClippedBases = 0;
        if (last.getOperator() == CigarOperator.H) {
            numEndClippedBases = last.getLength();
        }
View Full Code Here

Examples of htsjdk.samtools.Cigar.numCigarElements()

    int getNumClippedBasesAtEnd(SAMRecord read) {
        // compute total number of clipped bases (soft or hard clipped)
        // check for hard clips (never consider these bases):
        final Cigar c = read.getCigar();
        CigarElement last = c.getCigarElement(c.numCigarElements() - 1);

        int numEndClippedBases = 0;
        if (last.getOperator() == CigarOperator.H) {
            numEndClippedBases = last.getLength();
        }
View Full Code Here

Examples of htsjdk.samtools.Cigar.numCigarElements()

        // left align the CIGAR
        Cigar newCigar = AlignmentUtils.leftAlignIndel(originalCigar, refSeq, originalIndel, 0, 0, true);

        // update if necessary and write
        if ( !newCigar.equals(originalCigar) && newCigar.numCigarElements() > 1 ) {
            int difference = originalIndex - newCigar.getCigarElement(0).getLength();
            VariantContext newVC = new VariantContextBuilder(vc).start(vc.getStart()-difference).stop(vc.getEnd()-difference).make();
            //System.out.println("Moving record from " + vc.getChr()+":"+vc.getStart() + " to " + vc.getChr()+":"+(vc.getStart()-difference));

            final int indelIndex = originalIndex-difference;
View Full Code Here

Examples of htsjdk.samtools.Cigar.numCigarElements()

    private int getNumClippedBasesAtEnd(final GATKSAMRecord read) {
        // compute total number of clipped bases (soft or hard clipped)
        // check for hard clips (never consider these bases):
        final Cigar c = read.getCigar();
        CigarElement last = c.getCigarElement(c.numCigarElements() - 1);

        int numEndClippedBases = 0;
        if (last.getOperator() == CigarOperator.H) {
            numEndClippedBases = last.getLength();
        }
View Full Code Here

Examples of htsjdk.samtools.Cigar.numCigarElements()

        final List<VariantContext> proposedEvents = new ArrayList<>();

        int alignmentPos = 0;

        for( int cigarIndex = 0; cigarIndex < cigar.numCigarElements(); cigarIndex++ ) {
            final CigarElement ce = cigar.getCigarElement(cigarIndex);
            final int elementLength = ce.getLength();
            switch( ce.getOperator() ) {
                case I:
                {
View Full Code Here

Examples of htsjdk.samtools.Cigar.numCigarElements()

        // left align the CIGAR
        Cigar newCigar = AlignmentUtils.leftAlignIndel(originalCigar, refSeq, originalIndel, 0, 0, true);

        // update if necessary and write
        if ( !newCigar.equals(originalCigar) && newCigar.numCigarElements() > 1 ) {
            int difference = originalIndex - newCigar.getCigarElement(0).getLength();
            VariantContext newVC = new VariantContextBuilder(vc).start(vc.getStart()-difference).stop(vc.getEnd()-difference).make();
            //System.out.println("Moving record from " + vc.getChr()+":"+vc.getStart() + " to " + vc.getChr()+":"+(vc.getStart()-difference));

            final int indelIndex = originalIndex-difference;
View Full Code Here

Examples of net.sf.samtools.Cigar.numCigarElements()

  public static void replaceHardClips(SAMRecord read) {
    Cigar cigar = read.getCigar();
   
    if (cigar.getCigarElements().size() > 0) {
      CigarElement firstElement = cigar.getCigarElement(0);
      CigarElement lastElement  = cigar.getCigarElement(cigar.numCigarElements()-1);
     
      if ((firstElement.getOperator() == CigarOperator.H) ||
        (lastElement.getOperator() == CigarOperator.H)) {
       
        Cigar newCigar = new Cigar();
View Full Code Here

Examples of net.sf.samtools.Cigar.numCigarElements()

  public static void removeSoftClips(SAMRecord read) {
   
    Cigar cigar = read.getCigar();
   
    CigarElement firstElement = cigar.getCigarElement(0);
    CigarElement lastElement  = cigar.getCigarElement(cigar.numCigarElements()-1);
   
    if ((firstElement.getOperator() == CigarOperator.S) ||
      (lastElement.getOperator() == CigarOperator.S)) {
   
      Cigar newCigar = new Cigar();
View Full Code Here

Examples of net.sf.samtools.Cigar.numCigarElements()

      for (int i=0; i<left.getCigar().numCigarElements()-1; i++) {
        leftElements.add(leftCigar.getCigarElement(i));
      }

      // Drop leading S on right side
      for (int i=1; i<rightCigar.numCigarElements(); i++) {
        rightElements.add(rightCigar.getCigarElement(i));
      }
     
      // Encountered in dream test data at: chr20  22137016.  Not clear how to interpret.
      if (rightElements.get(0).getOperator() == CigarOperator.INSERTION) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.