Package com.affymetrix.genometryImpl.symmetry

Examples of com.affymetrix.genometryImpl.symmetry.TypeContainerAnnot


            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>();
        for (int i = 0; i < children.getLength(); i++) {
            Node child = children.item(i);
            String nodename = child.getNodeName();
            if (nodename != null) {
                if (nodename.equalsIgnoreCase(EXONSTR)) {
                    SymWithProps exSym = processExon(genomic, (Element) child);
                    exSym.setProperty(TYPESTR, EXONSTR);
                    exon_list.add(exSym);
                } else if (nodename.equalsIgnoreCase("exon_insert")) {
                    exon_insert_list.add(child);
                }
            }
        }

        // need to sort exon inserts...
        //    5' to 3' along transcript.  Otherwise, trying to insert a 5'
        //    after a 3' has been inserted ill mess up coordinates of 3'.
        // assuming for now that exon inserts are ordered in the XML

        // sorting exons, so that later position calculations are accurate

        Collections.sort(exon_list, new SeqSymStartComparator( genomic, forward));
        for (SeqSymmetry esym : exon_list) {
            m2gSym.addChild(esym);
        }

    BioSeq mrna = addSpans(m2gSym, genomic, exon_insert_list, start);
   
    String protein_id = determineProteinID(children);

    String amino_acid = getAminoAcid(m2gSym);
    processCDS(children, genomic, m2gSym, mrna, protein_id, amino_acid);

        m2gSym.setID("");
        genomic.addAnnotation(m2gSym);
        mrna.addAnnotation(m2gSym);
    }
View Full Code Here


    if(mend_point == null) {
      throw new NullPointerException("Conflict with start and end in processCDS.");
    }

        TypeContainerAnnot m2pSym = new TypeContainerAnnot(elem.getAttribute(METHODSTR));

        SeqSpan mspan = new SimpleSeqSpan(mstart_point.getStart(), mend_point.getEnd(), mrna);
        BioSeq protein = new BioSeq(protein_id, null, mspan.getLength());
    protein.setResidues(processAminoAcid(amino_acid));
    protein.setBounds(mspan.getMin(), mspan.getMin() + mspan.getLength());

        prot_hash.put(protein_id, protein);
        SeqSpan pspan = new SimpleSeqSpan(protein.getMin(), protein.getMax(), protein);
        if (DEBUG) {
            System.err.println("protein: length = " + pspan.getLength());
        }
        m2pSym.addSpan(mspan);
        m2pSym.addSpan(pspan);

        m2pSym.setID("");
        protein.addAnnotation(m2pSym);
        mrna.addAnnotation(m2pSym);

        // Use genometry manipulations to map cds start/end on genome to cds start/end on transcript
        //    (so that cds becomes mrna2protein symmetry on mrna (and on protein...)
View Full Code Here

     * @see     com.affymetrix.genometryImpl.symmetry.TypeContainerAnnot
     * @see     com.affymetrix.genometryImpl.util.SeqUtils
     */
    private static void processSimHit(BioSeq query_seq, Element elem, String method) {
        // method can never be null -- if it is, the XML is wrong
        TypeContainerAnnot hitSym = new TypeContainerAnnot(method);
        addDescriptors(elem, hitSym);

        String hit_name = elem.getAttribute(NAMESTR);
        String hit_descr = elem.getAttribute("desc");

        if (hit_name != null && hit_name.length() > 0) {
            hitSym.setProperty(NAMESTR, hit_name);
        }
        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());
          int end = Integer.valueOf(((SymWithProps)spanSym).getProperty(AA_END).toString());
          aa_start = Math.min(aa_start, start);
          aa_end = Math.max(aa_end, end);
                    num_spans++;
                }
            }
        }
        String prop =  (Integer.valueOf(num_spans)).toString();
        hitSym.setProperty("num_spans", prop);
        hitSym.setProperty(TYPESTR, "simHit");
    hitSym.setProperty(AA_START, String.valueOf(aa_start));
    hitSym.setProperty(AA_END, String.valueOf(aa_end));
    hitSym.setProperty(AA_LENGTH, String.valueOf(aa_end - aa_start));
        hitSym.addSpan(hitSpan);
        hitSym.setID("");
        query_seq.addAnnotation(hitSym);
    }
View Full Code Here

TOP

Related Classes of com.affymetrix.genometryImpl.symmetry.TypeContainerAnnot

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.