Package org.moltools.apps.probemaker.seq

Examples of org.moltools.apps.probemaker.seq.Polymorphism


    if (targetPoly == 0) { //No poly
      template = new SimpleSubSequenceTemplate(this, "Template for 3' arm", getType(), //$NON-NLS-1$
                             getTargetPosition(), length(), getID());
    }
    else { //Target is Poly
      Polymorphism poly = getPolys()[targetPoly - 1];
      if (poly instanceof SNP) {

        Nucleotide n = (Nucleotide) poly.getVariants()[variantIndex];
        if (n == null) {
          throw new UnsupportedOperationException("No target nucleotide found"); //$NON-NLS-1$
        }

        String seq = subsequence(getTargetPosition()+1, length());
        String nt = String.valueOf(n.getChar());
        String full = nt + seq;
       
        template = new SimpleSubSequenceTemplate(tempID, full, getType(),
                               getTargetPosition(), length(), getID());
      }
      else if (poly instanceof InDel) {
        switch (variantIndex) {
          case InDel.INS:
            template = new SimpleSubSequenceTemplate(this, tempID, getType(),
                                   getTargetPosition(), length(), getID());
            break;
          case InDel.DEL:
            template = new SimpleSubSequenceTemplate(this,tempID, getType(),
                                   getTargetPosition() + poly.length(), length(), getID());
            break;
          default:
            throw new UnsupportedOperationException(
                "Invalid InDel mode specified"); //$NON-NLS-1$
        }
      }
      else {
        throw new UnsupportedOperationException(
            "Unsupported Polymorphism type: " + poly.getClass()); //$NON-NLS-1$
      }
    }
    pat3 = template;
  }
View Full Code Here


    else {
      throw new IllegalArgumentException("Invalid variant type"); //$NON-NLS-1$
    }
    if (targetPoly > 0) {
      //Get the target position
      Polymorphism poly = getPolys()[targetPoly - 1];
      int pos = getPolyPosition(targetPoly);
      int length = poly.length();
      String f = seqString().substring(0, pos - 1);
      String t = seqString().substring(pos + length - 1);
      String p = ""; //$NON-NLS-1$
      if (poly instanceof SNP) {
        p = String.valueOf( ( (Nucleotide) ( (SNP) poly).getVariants()[
View Full Code Here

    else {
      l.add(this);
    }
    if (polyIndex >= 0) {
      Variant[] varGroup = this.getVariant().getVariantGroup();
      Polymorphism poly = polys[polyIndex];
      for (int varno = 0; varno < varGroup.length; varno++) {
        AlleleSpecificPadlockTarget vt = new AlleleSpecificPadlockTarget(this);
        vt.setVariant(varGroup[varno]);
        Object var = poly.getVariants()[varno];
        String appendage =  var instanceof Symbol ? String.valueOf(((Symbol) var).getChar()) : var.toString();
        vt.setID(getID() + "|" + appendage); //$NON-NLS-1$
        vt.setName((getName() == null ? getID() : getName()) + "|"  + appendage); //$NON-NLS-1$
        l.add(vt);
      }
View Full Code Here

    if (targetPoly == 0) { //no poly
      super.setTemplateForThreePrimeArm();
      return;
    }
    //target is Poly
    Polymorphism poly = getPolys()[targetPoly - 1];
    if (poly instanceof SNP) {
      pat3 = new SimpleSubSequenceTemplate(this, "Template for 3' arm", getType(), //$NON-NLS-1$
          getTargetPosition() + 1,
          length(), getID());
      Nucleotide n = (Nucleotide) poly.getVariants()[variantIndex];
      if (n == null) {
        throw new UnsupportedOperationException("No target nucleotide found"); //$NON-NLS-1$
      }
    }
    else if (poly instanceof InDel) {
      super.setTemplateForThreePrimeArm();
      return;
    }
    else {
      throw new UnsupportedOperationException(
          "Unsupported Polymorphism type: " + poly.getClass()); //$NON-NLS-1$
    }
  }
View Full Code Here

    if (targetPoly == 0) { //No poly
      template = new SimpleSubSequenceTemplate(this, tempID, getType(),
                             getTargetPosition(), length(), getID());
    }
    else { //Target is Poly
      Polymorphism poly = getPolys()[targetPoly - 1];
      if (poly instanceof SNP) {
       
        Nucleotide n = (Nucleotide) poly.getVariants()[variantIndex];
        if (n == null) {
          throw new UnsupportedOperationException("No target nucleotide found"); //$NON-NLS-1$
        }
       
        String full = n.getChar() + subsequence(getTargetPosition(),length());
       
        template = new SimpleSubSequenceTemplate(tempID,full, getType(),
                               getTargetPosition(), length(), getID());
       
      }
      else if (poly instanceof InDel) {
        switch (variantIndex) {
          case InDel.INS:
            template = new SimpleSubSequenceTemplate(this,tempID, getType(),
                                    getTargetPosition(), length(), getID());
            break;
          case InDel.DEL:
            template = new SimpleSubSequenceTemplate(this,tempID, getType(),
                                    getTargetPosition() + poly.length(), length(), getID());
            break;
          default:
            throw new UnsupportedOperationException(
                "Invalid InDel mode specified"); //$NON-NLS-1$
        }
      }
      else {
        throw new UnsupportedOperationException(
            "Unsupported Polymorphism type: " + poly.getClass()); //$NON-NLS-1$
      }
    }
    pat5 = template;
  }
View Full Code Here

    else {
      throw new IllegalArgumentException("Invalid variant type"); //$NON-NLS-1$
    }
    if (targetPoly > 0) {
      //Get the target position
      Polymorphism poly = getPolys()[targetPoly - 1];
      int pos = getPolyPosition(targetPoly);
      int length = poly.length();
      String f = seqString().substring(0, pos - 1);
      String t = seqString().substring(pos + length - 1);
      String p = ""; //$NON-NLS-1$
      if (poly instanceof SNP) {
        p = String.valueOf( ( (Nucleotide) ( (SNP) poly).getVariants()[
View Full Code Here

    else {
      l.add(this);
    }
    if (polyIndex >= 0) {
      Variant[] varGroup = this.getVariant().getVariantGroup();
      Polymorphism poly = polys[polyIndex];
      for (int varno = 0; varno < varGroup.length; varno++) {
        OLATarget vt = new OLATarget(this);
        vt.setVariant(varGroup[varno]);
        Object var = poly.getVariants()[varno];
        String appendage =  var instanceof Symbol ? String.valueOf(((Symbol) var).getChar()) : var.toString();
        vt.setID(getID() + "|" + appendage); //$NON-NLS-1$
        vt.setName((getName() == null ? getID() : getName()) + "|"  + appendage); //$NON-NLS-1$
        l.add(vt);
      }
View Full Code Here

    Polymorphism[] polys = getPolys();
    List<Variant> v = new ArrayList<Variant>();
   
    //Add each variant for each Polymorphism
    for (int polyno = 0; polyno < polys.length; polyno++) {
      Polymorphism poly = polys[polyno];
     
      if (poly instanceof SNP) {
        Variant[] group = MinisequencingTargetVariant.getGroup(polyno);
        v.add(group[0]);
        v.add(group[1]);     
View Full Code Here

  @Override
  protected void setTemplateForThreePrimeArm() {
    SimpleSubSequenceTemplate temp = null;
    Polymorphism[] polys = getPolys();
    if (targetPoly >= 0 && targetPoly < polys.length) { //target is Poly
      Polymorphism poly = polys[targetPoly];
      if (poly instanceof SNP) {
        if (variantIndex == 1) {
          temp = new SimpleSubSequenceTemplate(this, "Template for primer +", getType(), //$NON-NLS-1$
              getTargetPosition() + 1,
              length(), getID())
        }
        else {
          temp = new SimpleSubSequenceTemplate(this, "Template for primer -", getType(), //$NON-NLS-1$
              getTargetPosition() + 1,
              length(), getID());
        }
      }
      else {
        throw new UnsupportedOperationException(
            "Unsupported Polymorphism type: " + poly.getClass()); //$NON-NLS-1$
      }
    }
    pat3 = temp;
  }
View Full Code Here

TOP

Related Classes of org.moltools.apps.probemaker.seq.Polymorphism

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.