Example #1
0
    IEnumerator InitScene(RequestPDB requestPDB)
    {
        string pdbID = MainMenu.pdbID;
        //StartCoroutine(requestPDB.LoadPDBWWW(UIData.server_url+"Scenes/1KX2/1KX2.pdb"));
        WWWForm form = new WWWForm();

        form.AddField("pdbID", pdbID);

        WWW www = new WWW(UIData.server_url + "FetchPDB.php", form);

        Debug.Log(www.url);
        while (!www.isDone)
        {
            fetch_progress = www.progress;
            yield return(new WaitForEndOfFrame());
        }
        Debug.Log(www.error);
        fetch_progress = 1.0f;

        StartCoroutine(requestPDB.LoadPDBWWW(UIData.server_url + "pdb_files/" + pdbID + ".pdb"));
        while (!RequestPDB.isDone)
        {
            pdb_progress = requestPDB.progress;
            yield return(new WaitForEndOfFrame());
        }
        Debug.Log(www.error);
        pdb_progress    = 1.0f;
        UIData.atomtype = UIData.AtomType.particleball;
        UIData.bondtype = UIData.BondType.nobond;
        GUIMoleculeController.showOpenMenu = false;
        GUIMoleculeController.showAtomMenu = true;
        SendMessage("Display", SendMessageOptions.DontRequireReceiver);
    }
Example #2
0
    IEnumerator InitScene(object[] stuff)
    {
        //http://www.shaman.ibpc.fr/umolweb/Scenes/1KX2/1KX2.pdb
        // StartCoroutine(requestPDB.LoadPDBWWW("http://www.shaman.ibpc.fr/umolweb/Scenes/1KX2/1KX2.pdb"));
        // StartCoroutine(requestPDB.LoadPDBWWW("http://imyjimmy.com/pdb-files/5l1b.pdb"));  //5l1b //1l2y
        Material   mat        = (Material)stuff[0];
        RequestPDB requestPDB = (RequestPDB)stuff[1];

        //5l1b_short
        // StartCoroutine(requestPDB.LoadPDBWWW("file:///C://Users/imyjimmy-vr/Documents/vr-projects/gria2-viewer/Assets/StreamingAssets/Gria2Data/5l1b_short.pdb"));  //5l1b //1l2y

        StartCoroutine(requestPDB.LoadPDBWWW("file:///C://Users/imyjimmy-vr/Documents/vr-projects/gria2-viewer/Assets/StreamingAssets/CACNB2Data/5v2p.pdb"));          //5l1b //1l2y

        while (!RequestPDB.isDone)
        {
            pdb_progress = requestPDB.progress;
            // Debug.Log(pdb_progress);
            yield return(new WaitForEndOfFrame());
        }
        pdb_progress = 1.0f;

        //requestPDB.LoadPDBResource("1KX2");
        // UIData.atomtype = UIData.AtomType.hyperball;
        // UIData.bondtype = UIData.BondType.hyperstick;
        UIData.atomtype        = UIData.AtomType.noatom;
        UIData.bondtype        = UIData.BondType.nobond;
        UIData.secondarystruct = true;

        //trying it out
        hlResMat = mat;
        ribbons  = new Ribbons();
        List <string> residueNames = Molecule.Model.MoleculeModel.atomsResnamelist;

        ribbons.CreateRibbons();
        // toggle_NA_HIDE = !toggle_NA_HIDE; //GUIMoleculeController.toggle_NA_HIDE

        LoadBox = GameObject.Find("LoadBox");
        GameObject[] objs = GameObject.FindGameObjectsWithTag("RibbonObj");

        GUIMoleculeController.showOpenMenu = false;
        GUIMoleculeController.showAtomMenu = false;
        GUIMoleculeController.globalRadius = 0.3f;
        GUIMoleculeController.shrink       = 0.00001f;  //100.00f; //0.000001f;
        GUIMoleculeController.linkScale    = 0.4f;

        foreach (GameObject o in objs)
        {
            o.transform.parent        = LoadBox.transform;
            o.transform.localScale    = LoadBox.transform.localScale;
            o.transform.localPosition = LoadBox.transform.localPosition;
        }

        SendMessage("Display", SendMessageOptions.DontRequireReceiver);
    }
    IEnumerator InitScene(RequestPDB requestPDB)
    {
        StartCoroutine(requestPDB.LoadXGMML(UIData.server_url + "Scenes/Network/galFiltered.sif.xgmml"));
        while (!RequestPDB.isDone)
        {
            xml_progress = requestPDB.progress;
            yield return(new WaitForEndOfFrame());
        }
        xml_progress = 1.0f;

        GUIDisplay.file_extension          = "xgmml";
        UIData.atomtype                    = UIData.AtomType.hyperball;
        UIData.bondtype                    = UIData.BondType.hyperstick;
        GUIMoleculeController.globalRadius = 0.7f;
        GUIMoleculeController.shrink       = 0.0001f;
        GUIMoleculeController.linkScale    = 0.3f;
        GUIMoleculeController.showOpenMenu = false;
        GUIMoleculeController.showAtomMenu = true;
        SendMessage("Display", SendMessageOptions.DontRequireReceiver);
    }
Example #4
0
    IEnumerator InitScene(RequestPDB requestPDB)
    {
        StartCoroutine(requestPDB.LoadPDBWWW(UIData.server_url + "Scenes/1KX2/1KX2.pdb"));
        while (!RequestPDB.isDone)
        {
            pdb_progress = requestPDB.progress;
            Debug.Log(pdb_progress);
            yield return(new WaitForEndOfFrame());
        }
        pdb_progress = 1.0f;

        //requestPDB.LoadPDBResource("1KX2");
        UIData.atomtype = UIData.AtomType.hyperball;
        UIData.bondtype = UIData.BondType.hyperstick;
        GUIMoleculeController.showOpenMenu = false;
        GUIMoleculeController.showAtomMenu = false;
        GUIMoleculeController.globalRadius = 0.3f;
        GUIMoleculeController.shrink       = 0.0001f;
        GUIMoleculeController.linkScale    = 0.4f;
        SendMessage("Display", SendMessageOptions.DontRequireReceiver);
    }
    IEnumerator InitScene(RequestPDB requestPDB)
    {
        //print(Application.dataPath);
        //StartCoroutine(requestPDB.LoadPDBWWW("file://"+Application.dataPath+"/../Scenes/RNA/17RA_gg.pdb"));
        StartCoroutine(requestPDB.LoadPDBWWW("file://" + Application.dataPath + "/../share/17RA_gg.pdb"));
        while (!RequestPDB.isDone)
        {
            pdb_progress = requestPDB.progress;
            Debug.Log(pdb_progress);
            yield return(new WaitForEndOfFrame());
        }
        pdb_progress = 1.0f;

        //requestPDB.LoadPDBResource("1KX2");
        UIData.ffType   = UIData.FFType.HiRERNA;
        UIData.atomtype = UIData.AtomType.hyperball;
        UIData.bondtype = UIData.BondType.hyperstick;
        GUIMoleculeController.shrink       = 0.8f;
        GUIMoleculeController.showOpenMenu = false;
        GUIMoleculeController.showAtomMenu = true;
        SendMessage("Display", SendMessageOptions.DontRequireReceiver);
    }
Example #6
0
        public static void CreateMolecule(TextReader sr)
        {
            List <float[]> alist  = new List <float[]>();
            List <float[]> calist = new List <float[]>();

            List <float> BFactorList = new List <float>();

            List <string> resnamelist   = new List <string>();
            List <string> atomsNameList = new List <string>();
            List <string> caChainlist   = new List <string>();

            List <AtomModel> typelist  = new List <AtomModel>();
            List <string>    chainlist = new List <string>();

            List <Color> colorList = new List <Color>();

            List <float[]> sshelixlist = new List <float[]> ();
            List <float[]> sssheetlist = new List <float[]> ();

            RequestPDB.ReadPDB(sr, alist, calist, BFactorList, resnamelist, atomsNameList, caChainlist, typelist, chainlist, colorList, sshelixlist, sssheetlist);

            BuildMoleculeComponents();
            CreateSplines();
            CreateResidues();
            CreateResiduesSugar2();

            if (UIData.loadHireRNA)
            {
                BuildHireRnaHydrogenBondsStructures();
            }

            if (GUIDisplay.pdbID == "3EI0")
            {
                UIData.isGLIC = true;
            }

            UIData.isParticlesInitialized = false;            // new file, new particle system needed
            MoleculeModel.networkLoaded   = false;            // protein loaded, network removed if present
        }
    IEnumerator InitScene(RequestPDB requestPDB)
    {
        StartCoroutine(requestPDB.LoadPDBWWW(UIData.server_url + "Scenes/fieldlines/fieldline.pdb"));
        while (!RequestPDB.isDone)
        {
            pdb_progress = requestPDB.progress;
            Debug.Log(pdb_progress);
            yield return(new WaitForEndOfFrame());
        }
        pdb_progress = 1.0f;

        UIData.atomtype = UIData.AtomType.particleball;
        UIData.bondtype = UIData.BondType.nobond;
        GUIMoleculeController.showOpenMenu = false;
        GUIMoleculeController.showAtomMenu = true;
        SendMessage("Display", SendMessageOptions.DontRequireReceiver);

        StartCoroutine(requestPDB.LoadJsonWWW(UIData.server_url + "Scenes/fieldlines/fieldline.json", MoleculeModel.Offset));
        while (!RequestPDB.isDone)
        {
            json_progress = requestPDB.progress;
            yield return(new WaitForEndOfFrame());
        }
        json_progress = 1.0f;
        MoleculeModel.fieldLineFileExists    = true;
        GUIMoleculeController.showFieldLines = true;
        FieldLineStyle.DisplayFieldLine();

        StartCoroutine(requestPDB.LoadOBJWWW(UIData.server_url + "Scenes/fieldlines/fieldline.obj"));
        while (!RequestPDB.isDone)
        {
            obj_progress = requestPDB.progress;
            yield return(new WaitForEndOfFrame());
        }
        obj_progress = 1.0f;
        MoleculeModel.surfaceFileExists = true;
        GUIMoleculeController.modif     = true;
    }