Ejemplo n.º 1
0
    //getResNum for the UV.
    public int getResidueNum(Vector2 uv)
    {
        int result;

        Debug.Log("Splitting.cs: getResidueNum(uv): " + uv);
        if (DNA_Panel == null)
        {
            DNA_Panel = DNAPanelController.Instance.DNA_Panel;
        }
        if (DNA_Panel.GetComponent <Renderer>().enabled)
        {
            if (seqModel == null)
            {
                seqModel = new SequenceModel();
            }

            int    DNASeqNum = DNAPanelController.Instance.getSeqPos(uv);
            string nuc       = DNAPanelController.Instance.getNucAcidForUV(uv);
            Debug.Log("Pos: " + DNASeqNum + ", DNA: " + nuc + ", seqModel: " + seqModel);
            string nucStr = nuc.Split(':')[0];

            //string niceName, int pos, Nuc n, Seq type
            int pos = seqModel.getPeptidePos("Rattus norvegicus", DNASeqNum, Nucleotide.StrToNuc(nucStr), Seq.DNA);
            // residueSeq[x].name;
            return(pos);
        }
        else
        {
            //do it
            Debug.Log("RNA panel");
        }

        return(0);
    }
Ejemplo n.º 2
0
    public void getResidueForUV(Vector2 uv)
    {
        Debug.Log("Splitting.cs: getResidueForUV(uv): " + uv);

        if (DNAPanelController.Instance.DNA_Panel == null)
        {
            //do it
            Debug.Log("RNA panel");
            if (seqModel == null)
            {
                seqModel = new SequenceModel();
            }

            int    RNASeqNum = RNAPanelController.Instance.getSeqPos(uv);
            string nuc       = RNAPanelController.Instance.getNucAcidForUV(uv);
            Debug.Log("Pos: " + RNASeqNum + ", RNA: " + nuc + ", seqModel: " + seqModel);
            string nucStr = nuc.Split(':')[0];

            //string niceName, int pos, Nuc n, Seq type
            int num = seqModel.getPeptidePos("Rattus norvegicus", RNASeqNum, Nucleotide.StrToNuc(nucStr), Seq.RNA);
            Debug.Log("peptidePos: " + num);

            if (ProteinFocus != null)
            {
                GameObject.Destroy(ProteinFocus);
            }
            updateSplit(num);

            Residue r       = residueSeq[num];
            string  resName = r.name;
            RNAPanelController.Instance.setSeqPos(resName);
        }
        else
        {
            if (DNAPanelController.Instance.DNA_Panel.GetComponent <Renderer>().enabled)
            {
                if (seqModel == null)
                {
                    seqModel = new SequenceModel();
                }

                int    DNASeqNum = DNAPanelController.Instance.getSeqPos(uv);
                string nuc       = DNAPanelController.Instance.getNucAcidForUV(uv);
                Debug.Log("Pos: " + DNASeqNum + ", DNA: " + nuc + ", seqModel: " + seqModel);
                string nucStr = nuc.Split(':')[0];

                //string niceName, int pos, Nuc n, Seq type
                int num = seqModel.getPeptidePos("Rattus norvegicus", DNASeqNum, Nucleotide.StrToNuc(nucStr), Seq.DNA);

                Debug.Log("peptidePos: " + num);
            }
        }
    }