Package com.affymetrix.genometryImpl

Examples of com.affymetrix.genometryImpl.SeqSpan


   */
  private GlyphI glyphifyExons(
      SeqSymmetry mrna2genome, MutableSeqSymmetry annot2genome, int childcount) {
    GlyphI tGlyph = new LineContainerGlyph();
    seqmap.setDataModel(tGlyph, mrna2genome);
    SeqSpan tSpan = annot2genome.getSpan(vseq);
    tGlyph.setCoords(tSpan.getMin(), 0, tSpan.getLength(), 20);
    tGlyph.setColor(col_ts);
    for (int i = 0; i < childcount; i++) {
      SeqSymmetry exon2genome = annot2genome.getChild(i);
      SeqSpan gSpan = exon2genome.getSpan(vseq);
      GlyphI cglyph = new OutlineRectGlyph();
      seqmap.setDataModel(cglyph, exon2genome);
      // can't give this a type and therefore signal
      // to the selection logic that this is first class selectable
      // object
      // so let's put it in a list
      exonList.add(exon2genome);
      cglyph.setColor(col_ts);
      cglyph.setCoords(gSpan.getMin(), 0, gSpan.getLength(), 20);
      exonGlyphs.add(cglyph);
      tGlyph.addChild(cglyph);
      //  testing display of "exon segments" for transcripts that have
      //     base inserts relative to the genomic sequence
      //  haven't dealt with display of base deletions in transcript relative to genomic yet
      //  if exon is segmented by inserts, then it will have children
      //     that specify this segmentation
      for (int seg_index = 0; seg_index < exon2genome.getChildCount(); seg_index++) {
        SeqSymmetry eseg2genome = exon2genome.getChild(seg_index);
        SeqSpan seg_gspan = eseg2genome.getSpan(vseq);
        if (seg_gspan.getLength() == 0) {
          // only mark the inserts (those whose genomic extent is zero
          GlyphI segGlyph = new OutlineRectGlyph();
          segGlyph.setColor(col_bg);
          segGlyph.setCoords(seg_gspan.getMin(), 0, seg_gspan.getLength(), 25);
          tGlyph.addChild(segGlyph);
        }
      }
    }
    return tGlyph;
View Full Code Here


            SeqSymmetry annot2mrna, SeqSymmetry[] path2view,
            MapTierGlyph tier, GlyphI trans_parent) {
        if (DEBUG_TRANSCRIPT_ANNOTS) {
            SeqUtils.printSymmetry(annot2mrna);
        }
        SeqSpan mrna_span = annot2mrna.getSpan(mrna);
        MutableSeqSymmetry annot2genome = new SimpleMutableSeqSymmetry();
        copyToMutable(annot2mrna, annot2genome);

        SeqUtils.transformSymmetry(annot2genome, path2view);
        if (DEBUG_TRANSCRIPT_ANNOTS) {
            SeqUtils.printSymmetry(annot2genome);
        }

        SeqSpan pSpan = SeqUtils.getOtherSpan(annot2mrna, mrna_span);
        BioSeq protein = pSpan.getBioSeq();
    String amino_acid = null;

    try{
      amino_acid = protein.getResidues(0, protein.getLength());
    }catch(Exception ex){
      System.out.println("*** Warning: No amino acid found ");
    }

        GlyphI aGlyph = new LineContainerGlyph();
        SeqSpan aSpan = annot2genome.getSpan(vseq);
        aGlyph.setCoords(aSpan.getMin(), 0, aSpan.getLength(), 20);
        aGlyph.setColor(col_ts);
        seqmap.setDataModel(aGlyph, annot2mrna);
    glyphifyCDSs(annot2genome, protein, aGlyph, amino_acid, vseq);
        trans_parent.addChild(aGlyph);
    displayAssociatedmRNAforProtein(protein, path2view, annot2mrna, tier);
View Full Code Here

    int cdsCount = annot2genome.getChildCount();
    int prev_amino_end = 0;
    int prev_add = 0;
    for (int j = 0; j < cdsCount; j++) {
      SeqSymmetry cds2genome = annot2genome.getChild(j);
      SeqSpan gSpan = cds2genome.getSpan(vseq);
      GlyphI cglyph = new FillRectGlyph();
      //SeqSpan protSpan = cds2genome.getSpan(protein);
      // coloring based on frame
      colorByFrame(cglyph, gSpan.getMin() + prev_add);
      prev_add += 3 - (gSpan.getLength() % 3)//Keep a track of no of complete amino acid added.
      cglyph.setCoords(gSpan.getMin(), 0, gSpan.getLength(), 20);
      aGlyph.addChild(cglyph);
      if (amino_acid != null) {
        SequenceGlyph sg = new ColoredResiduesGlyph(false);
        int start = prev_amino_end;
        int end = start + gSpan.getLength();
        String sub_amino_acid = amino_acid.substring(start, end);
        prev_amino_end += gSpan.getLength();
        sg.setResidues(sub_amino_acid);
        sg.setCoords(gSpan.getMin(), 0, gSpan.getLength(), 20);
        sg.setForegroundColor(col_amino_acid);
        sg.setBackgroundColor(cglyph.getBackgroundColor());
        aGlyph.addChild(sg);
      }
    }
View Full Code Here

        }

        GlyphI aGlyph = new LineContainerGlyph();
        seqmap.setDataModel(aGlyph, annot2protein);

        SeqSpan aSpan = annot2genome.getSpan(vseq);
        aGlyph.setCoords(aSpan.getMin(), 0, aSpan.getLength(), 20);
        // will return a color from the prefs for the protein annotation
        // span -- or else the default - col_domain
        Color color = pick_color_for_domain(aSpan, prefs_hash);
        aGlyph.setColor(color);

        // for now, need to descend two levels because that is depth of path --
        //    eventually will use some sort of flattening method (probably
        //    first set up as part of SeqUtils)
        int count1 = annot2genome.getChildCount();
        for (int i = 0; i < count1; i++) {

            SeqSymmetry child = annot2genome.getChild(i);
            int count2 = child.getChildCount();

            // reach "back" and get actual symmetry (rather than transformed symmetry)
            //   really need some sort of tracking in transform mechanism to associate calculated
            //   symmetries with original symmetries that they map back to...
            SymWithProps original_child = (SymWithProps) annot2protein.getChild(i);

            for (int j = 0; j < count2; j++) {
                SeqSymmetry grandchild = child.getChild(j);
                SeqSpan gSpan = grandchild.getSpan(vseq);
                LabelledRectGlyph cglyph = new LabelledRectGlyph();
        if(i%2 == 0) {
          cglyph.setColor(color);
        }
        else {
          cglyph.setColor(color.darker());
        }

        String spanno = "Span " + String.valueOf(i+1) + " of ";
        String interpro = (String) ((SymWithProps)annot2protein).getProperty("InterPro Name");
        if(interpro != null){
          spanno += interpro;
        }
        cglyph.setText(spanno);
                cglyph.setCoords(gSpan.getMin(), 0, gSpan.getLength(), 20);
                aGlyph.addChild(cglyph);
                seqmap.setDataModel(cglyph, original_child);
                original_child.setProperty("type", "protspan");
            }
        }
View Full Code Here

     */
    private static void copyToMutable(SeqSymmetry sym, MutableSeqSymmetry mut) {
        mut.clear();
        int spanCount = sym.getSpanCount();
        for (int i = 0; i < spanCount; i++) {
            SeqSpan span = sym.getSpan(i);
            SeqSpan newspan = new SimpleMutableSeqSpan(span);
            mut.addSpan(newspan);
        }
        int childCount = sym.getChildCount();
        for (int i = 0; i < childCount; i++) {
            SeqSymmetry child = sym.getChild(i);
View Full Code Here

        }
        if (hit_descr != null && hit_descr.length() > 0) {
            hitSym.setProperty("descr", hit_descr);
        }

        SeqSpan hitSpan = null;
        NodeList children = elem.getChildNodes();
        int num_spans = 0, aa_start = Integer.MAX_VALUE, aa_end = Integer.MIN_VALUE;
        for (int i = 0; i < children.getLength(); i++) {
            Node child = children.item(i);
            String name = child.getNodeName();
            if (child instanceof Element) {
                Element chelem = (Element) child;
                if (name.equalsIgnoreCase("simspan")) {
                    SeqSymmetry spanSym = processSimSpan(query_seq, chelem);
                    ((SymWithProps) spanSym).setProperty(METHODSTR, method);
                    hitSym.addChild(spanSym);
                    SeqSpan spanSpan = spanSym.getSpan(query_seq);
                    if (hitSpan == null) {
                        hitSpan = new SimpleMutableSeqSpan(spanSpan.getMin(), spanSpan.getMax(), query_seq);
                    } else {
                        SeqUtils.encompass(hitSpan, spanSpan, (MutableSeqSpan) hitSpan);
                    }
                    //hitSym.setProperty(TYPESTR, "hitspan");
          int start = Integer.valueOf(((SymWithProps)spanSym).getProperty(AA_START).toString());
View Full Code Here

        prop = (Integer.valueOf(end)).toString();
        spanSym.setProperty(AA_END, prop);
        prop = (Integer.valueOf(end - start)).toString();
        spanSym.setProperty(AA_LENGTH, prop);
    //Multiplying start and end by 3. Because three letters forms one amino acid.
        SeqSpan qspan = new SimpleSeqSpan((start*3)+query_seq.getMin(), (end*3)+query_seq.getMin(), query_seq);
        spanSym.addSpan(qspan);
        return spanSym;
    }
View Full Code Here

        if (DEBUG) {
            System.err.println("mrna:  start = " + start + "  end = " + end);
        }
        NodeList children = elem.getChildNodes();
        SeqSpan span = new SimpleSeqSpan(start, end, genomic);

        TypeContainerAnnot m2gSym = new TypeContainerAnnot(elem.getAttribute("method"));
        m2gSym.addSpan(span);
        addDescriptors(elem, m2gSym);
        m2gSym.setProperty(TYPESTR, "mRNA");
        boolean forward = (span.isForward());


    transCheckExons = new ArrayList<int[]>();
        List<SeqSymmetry> exon_list = new ArrayList<SeqSymmetry>();
        List<Node> exon_insert_list = new ArrayList<Node>();
View Full Code Here

    int end = 0;
    String mrna_id = MRNASTR;
    BioSeq mrna = new BioSeq(mrna_id, null, mrnalength);
    mrna.setBounds(start, start+mrnalength);
    mrna_hash.put(mrna_id, mrna);
    SeqSpan mrna_span = new SimpleSeqSpan(mrna.getMin(), mrna.getMax(), mrna);
    m2gSym.addSpan(mrna_span);
    for (int i = 0; i < exoncount; i++) {
      SimpleSymWithProps esym = (SimpleSymWithProps) m2gSym.getChild(i);
      SeqSpan gspan = esym.getSpan(genomic);
      end = start + gspan.getLength();
      List<Element> hit_inserts = new ArrayList<Element>();
      end = determineOverlappingExons(exon_insert_list, gspan, hit_inserts, end);
      SeqSpan tspan = new SimpleSeqSpan(start, end, mrna);
      esym.addSpan(tspan);
      if (!hit_inserts.isEmpty()) {
        processExonInsert((MutableSeqSymmetry) esym, hit_inserts, genomic, mrna);
      }
      start = end;
View Full Code Here

  private static int determinemRNALength(int exoncount, TypeContainerAnnot m2gSym, BioSeq genomic, List exon_insert_list) throws NumberFormatException {
    int mrnalength = 0;
    for (int i = 0; i < exoncount; i++) {
      SeqSymmetry esym = m2gSym.getChild(i);
      SeqSpan gspan = esym.getSpan(genomic);
      mrnalength += gspan.getLength();
    }
    for (int i = 0; i < exon_insert_list.size(); i++) {
      Element iel = (Element) exon_insert_list.get(i);
      int ilength = Integer.parseInt(iel.getAttribute("insert_length"));
      mrnalength += ilength;
View Full Code Here

TOP

Related Classes of com.affymetrix.genometryImpl.SeqSpan

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.