Examples of Cigar


Examples of net.sf.samtools.Cigar

    Assert.assertEquals(cigar2.toString(), "99M100I100M");
  }
 
  @Test (groups = "unit")
  public void testSubsetCigar_spanAll4() {
    Cigar cigar = getCigar("100M100I100M");
    Cigar cigar2 = SAMRecordUtils.subset(cigar, 1, 298);
    Assert.assertEquals(cigar2.toString(), "99M100I99M");
  }
View Full Code Here

Examples of net.sf.samtools.Cigar

    Assert.assertEquals(cigar2.toString(), "99M100I99M");
  }
 
  @Test (groups = "unit")
  public void testSubsetCigar_long() {
    Cigar cigar = getCigar("100M100I100M100I100M");
    Cigar cigar2 = SAMRecordUtils.subset(cigar, 1, 498);
    Assert.assertEquals(cigar2.toString(), "99M100I100M100I99M");
  }
View Full Code Here

Examples of net.sf.samtools.Cigar

    Assert.assertEquals(cigar2.toString(), "99M100I100M100I99M");
  }
 
  @Test (groups = "unit")
  public void testSubsetCigar_deletion() {
    Cigar cigar = getCigar("100M100D100M");
    Cigar cigar2 = SAMRecordUtils.subset(cigar, 1, 198);
    Assert.assertEquals(cigar2.toString(), "99M100D99M");
  }
View Full Code Here

Examples of net.sf.samtools.Cigar

 
  private IndelShifter indelShifter = new IndelShifter();

  @Test (groups = "unit" )
  public void testShiftCigarLeft_basic() {
    Cigar cigar = new Cigar();
   
    cigar.add(new CigarElement(10, CigarOperator.M));
    cigar.add(new CigarElement(3, CigarOperator.D));
    cigar.add(new CigarElement(40, CigarOperator.M));
   
    Cigar newCigar;

    newCigar = indelShifter.shiftCigarLeft(cigar, 10);
    Assert.assertEquals(newCigar.toString(), "3D50M");
   
    newCigar = indelShifter.shiftCigarLeft(cigar, 9);
    Assert.assertEquals(newCigar.toString(), "1M3D49M");
   
    newCigar = indelShifter.shiftCigarLeft(cigar, 8);
    Assert.assertEquals(newCigar.toString(), "2M3D48M");
   
    newCigar = indelShifter.shiftCigarLeft(cigar, 4);
    Assert.assertEquals(newCigar.toString(), "6M3D44M");

    newCigar = indelShifter.shiftCigarLeft(cigar, 2);
    Assert.assertEquals(newCigar.toString(), "8M3D42M");
   
    newCigar = indelShifter.shiftCigarLeft(cigar, 1);
    Assert.assertEquals(newCigar.toString(), "9M3D41M");
  }
View Full Code Here

Examples of net.sf.samtools.Cigar

    Assert.assertEquals(newCigar.toString(), "9M3D41M");
  }
 
  @Test (groups = "unit" )
  public void testShiftCigarLeft_softClipping() {
    Cigar cigar = new Cigar();
   
    cigar.add(new CigarElement(2, CigarOperator.S));
    cigar.add(new CigarElement(6, CigarOperator.M));
    cigar.add(new CigarElement(2, CigarOperator.I));
    cigar.add(new CigarElement(30, CigarOperator.M));
    cigar.add(new CigarElement(10, CigarOperator.S));
   
    Cigar newCigar;

    newCigar = indelShifter.shiftCigarLeft(cigar, 6);
    Assert.assertEquals(newCigar.toString(), "2S2I36M10S");
   
    newCigar = indelShifter.shiftCigarLeft(cigar, 5);
    Assert.assertEquals(newCigar.toString(), "2S1M2I35M10S");
   
    newCigar = indelShifter.shiftCigarLeft(cigar, 4);
    Assert.assertEquals(newCigar.toString(), "2S2M2I34M10S");
   
    newCigar = indelShifter.shiftCigarLeft(cigar, 3);
    Assert.assertEquals(newCigar.toString(), "2S3M2I33M10S");
   
    newCigar = indelShifter.shiftCigarLeft(cigar, 2);
    Assert.assertEquals(newCigar.toString(), "2S4M2I32M10S");
   
    newCigar = indelShifter.shiftCigarLeft(cigar, 1);
    Assert.assertEquals(newCigar.toString(), "2S5M2I31M10S");
  }
View Full Code Here

Examples of net.sf.samtools.Cigar

    Assert.assertEquals(newCigar.toString(), "2S5M2I31M10S");
  }
 
  @Test (groups = "unit" )
  public void testShiftCigarLeft_insertAtTail() {
    Cigar cigar = new Cigar();
   
    cigar.add(new CigarElement(40, CigarOperator.M));
    cigar.add(new CigarElement(10, CigarOperator.I));
   
    Cigar newCigar;

    newCigar = indelShifter.shiftCigarLeft(cigar, 40);
    Assert.assertEquals(newCigar.toString(), "10I40M");
   
    newCigar = indelShifter.shiftCigarLeft(cigar, 39);
    Assert.assertEquals(newCigar.toString(), "1M10I39M");

    newCigar = indelShifter.shiftCigarLeft(cigar, 30);
    Assert.assertEquals(newCigar.toString(), "10M10I30M");
   
    newCigar = indelShifter.shiftCigarLeft(cigar, 1);
    Assert.assertEquals(newCigar.toString(), "39M10I1M");
  }
View Full Code Here

Examples of net.sf.samtools.Cigar

    Assert.assertEquals(newCigar.toString(), "39M10I1M");
  }
 
  @Test (groups = "unit" )
  public void testShiftCigarLeft_multipleIndels() {
    Cigar cigar = new Cigar();
   
    cigar.add(new CigarElement(20, CigarOperator.M));
    cigar.add(new CigarElement(1, CigarOperator.I));
    cigar.add(new CigarElement(5, CigarOperator.M));
    cigar.add(new CigarElement(3, CigarOperator.D));
    cigar.add(new CigarElement(24, CigarOperator.M));
   
    Cigar newCigar;
   
    newCigar = indelShifter.shiftCigarLeft(cigar, 20);
    Assert.assertEquals(newCigar.toString(), "1I5M3D44M");
   
    newCigar = indelShifter.shiftCigarLeft(cigar, 10);
    Assert.assertEquals(newCigar.toString(), "10M1I5M3D34M");

    newCigar = indelShifter.shiftCigarLeft(cigar, 1);
    Assert.assertEquals(newCigar.toString(), "19M1I5M3D25M");
  }
View Full Code Here

Examples of net.sf.samtools.Cigar

  }
 
  @Test (groups = "unit" )
  public void testShiftCigarLeft_complex() {
    //3S69M1I18M1D9M
    Cigar cigar = new Cigar();
   
    cigar.add(new CigarElement(3, CigarOperator.S));
    cigar.add(new CigarElement(69, CigarOperator.M));
    cigar.add(new CigarElement(1, CigarOperator.I));
    cigar.add(new CigarElement(18, CigarOperator.M));
    cigar.add(new CigarElement(1, CigarOperator.D));
    cigar.add(new CigarElement(9, CigarOperator.M));
   
    Cigar newCigar;
   
    newCigar = indelShifter.shiftCigarLeft(cigar, 1);
    Assert.assertEquals(newCigar.toString(), "3S68M1I18M1D10M");
  }
View Full Code Here

Examples of net.sf.samtools.Cigar

    record.setReadBases(newBases);

    byte[] newScores = new byte[newLength];
    System.arraycopy(record.getBaseQualities(), 0, newScores, 0, newLength);

    record.setCigar(new Cigar(newCigarElements));
  }
View Full Code Here

Examples of net.sf.samtools.Cigar

  public static void calculateMdAndNmTags(SAMRecord record, byte[] ref,
      boolean calcMD, boolean calcNM) {
    if (!calcMD && !calcNM)
      return;

    Cigar cigar = record.getCigar();
    List<CigarElement> cigarElements = cigar.getCigarElements();
    byte[] seq = record.getReadBases();
    int start = record.getAlignmentStart() - 1;
    int i, x, y, u = 0;
    int nm = 0;
    StringBuffer str = new StringBuffer();
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.