Ejemplo n.º 1
0
 public HashCluster(Dictionary<string, List<byte>> profiles, Alignment _al, HashCInput input)
 {
     this.input = input;
     stateAlign = profiles;
     currentV = 0;
     al = _al;            
     maxV = 4;
     threadNumbers = dirSettings.numberOfCores;
 }
Ejemplo n.º 2
0
        public void InitHashCluster()
        {
            if(dcd!=null)
                PrepareForDCD(dcd, input);
            else
                if(alignFile!=null && alignFile.Length>0)
                {
                    al = new Alignment();
                    al.Prepare(alignFile, input.profileName);
                   // al.Prepare(profiles, profName, input.profileName);

                   al.MyAlign(alignFile);
                   //al.CombineAll();
                   stateAlign = al.GetStateAlign();
                    //AddErrors(al.errors);
         //           stateAlign = al.GetStateAlign();
                    if (input.regular)
                    {
                        if (input.profileName == input.profileNameReg)
                            stateAlignReg = stateAlign;
                        else
                        {
                            Alignment alReg = new Alignment();
                            if (alignFile != null)
                                alReg.Prepare(alignFile, input.profileNameReg);
                            else
                                alReg.Prepare(dirName, dirSettings, input.profileNameReg);
                            alReg.MyAlign(alignFile);
                            stateAlignReg = alReg.GetStateAlign();
                        }
                    }
                }
                if(stateAlign==null)                
                    PrepareForPDB(dirName, alignFile, input);                   


        }
Ejemplo n.º 3
0
        protected Dictionary <byte,int>[] JuryConsensusStates(Alignment alUse,List<string> structNames)
        {
            jury1D juryLocal = new jury1D();
            juryLocal.PrepareJury(alUse,stateAlign);

            Dictionary <byte ,int>[] cons=new Dictionary<byte,int>[columns.Length];


            ClusterOutput output = juryLocal.JuryOptWeights(structNames);
            if (output == null)
                return null;
            int i = 0;
            string result;
            if (structNames.Contains("consensus"))
                result = "consensus";
            else
                result = output.juryLike[0].Key;

            foreach (var item in stateAlign[result])
            {
                cons[i] = new Dictionary<byte, int>();
                cons[i++].Add(item, 0);
            }
            return cons;
        }
Ejemplo n.º 4
0
        void PrepareForPDB(string dirName, string alignFile,HashCInput input)
        {
            dirSettings.Load();
            this.dirName = dirName;
            al = new Alignment();
            if (alignFile != null)
                 al.Prepare(alignFile, input.profileName);
            else
            {
                al.Prepare(dirName, dirSettings, input.profileName);
            
            }
            al.MyAlign(alignFile);
            stateAlign = al.GetStateAlign();
            if (input.regular)
            {
                if (input.profileName == input.profileNameReg)
                    stateAlignReg = stateAlign;
                else
                {
                    Alignment alReg = new Alignment();

                    if(alignFile!=null)
                        alReg.Prepare(alignFile, input.profileNameReg);
                    else
                        alReg.Prepare(dirName, dirSettings, input.profileNameReg);
                    alReg.MyAlign(alignFile);
                    stateAlignReg = alReg.GetStateAlign();
                }
            }
            this.input = input;

        }
Ejemplo n.º 5
0
        void PrepareForDCD(DCDFile dcd, HashCInput input)
        {
            dirSettings.Load();
            this.dcd = dcd;
            al = new Alignment();
            al.Prepare(dcd, dirSettings, input.profileName);
            al.MyAlign(alignFile);
            stateAlign = al.GetStateAlign();
            if (input.regular)
            {
                if (input.profileName == input.profileNameReg)
                    stateAlignReg = stateAlign;
                else
                {

                    Alignment alReg = new Alignment();
                    alReg.Prepare(dcd, dirSettings, input.profileNameReg);
                    alReg.MyAlign(alignFile);
                    stateAlignReg = alReg.GetStateAlign();
                }
            }
            this.input = input;

        }