Ejemplo n.º 1
0
        private static void ProcessChemFile(IChemFile chemFile, ISettings settings, FileUsage usage,
                                            MoleculeLoadingResults results, LoadingProgress progress)
        {
            MoleculeProcessingProgress molProcessing = new MoleculeProcessingProgress(progress);

            progress.MoveToNextProcess(molProcessing);

            // calc size
            int numModels = 0;

            for (int seq = 0; seq < chemFile.ChemSequenceCount; seq++)
            {
                IChemSequence chemSeq = chemFile.getChemSequence(seq);
                numModels += chemSeq.ChemModelCount;
            }
            float modelSz = 1.0f / (float)numModels;

            results.NumSequences = chemFile.ChemSequenceCount;
            for (int seq = 0; seq < chemFile.ChemSequenceCount; seq++)
            {
                IChemSequence chemSeq = chemFile.getChemSequence(seq);
                results.NumModels += chemSeq.ChemModelCount;
                for (int model = 0; model < chemSeq.ChemModelCount; model++)
                {
                    ProcessChemModel(chemSeq.getChemModel(model), settings, usage, results, molProcessing, modelSz);
                }
                molProcessing.Log("Processed Sequence", LogItem.ItemLevel.Success);
            }
            molProcessing.Log("Processed File", LogItem.ItemLevel.Success);
        }
 public static int getBondCount(IChemSequence sequence)
 {
     int count = 0;
     for (int i = 0; i < sequence.ChemModelCount; i++)
     {
         count += ChemModelManipulator.getBondCount(sequence.getChemModel(i));
     }
     return count;
 }
 /// <summary> Puts all the Molecules of this container together in one 
 /// AtomCcntainer.
 /// 
 /// </summary>
 /// <returns>  The AtomContainer with all the Molecules of this container
 /// 
 /// </returns>
 /// <deprecated> This method has a serious performace impact. Try to use
 /// other methods.
 /// </deprecated>
 public static IAtomContainer getAllInOneContainer(IChemSequence sequence)
 {
     IAtomContainer container = sequence.Builder.newAtomContainer();
     for (int i = 0; i < sequence.ChemModelCount; i++)
     {
         IChemModel model = sequence.getChemModel(i);
         container.add(ChemModelManipulator.getAllInOneContainer(model));
     }
     return container;
 }
Ejemplo n.º 4
0
        public static int getBondCount(IChemSequence sequence)
        {
            int count = 0;

            for (int i = 0; i < sequence.ChemModelCount; i++)
            {
                count += ChemModelManipulator.getBondCount(sequence.getChemModel(i));
            }
            return(count);
        }
Ejemplo n.º 5
0
 public static System.Collections.IList getAllChemObjects(IChemSequence sequence)
 {
     System.Collections.ArrayList list = new System.Collections.ArrayList();
     list.Add(sequence);
     for (int i = 0; i < sequence.ChemModelCount; i++)
     {
         list.AddRange(ChemModelManipulator.getAllChemObjects(sequence.getChemModel(i)));
     }
     return(list);
 }
Ejemplo n.º 6
0
        // Private procedures

        //UPGRADE_NOTE: Access modifiers of method 'write' were changed to 'public'. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1204'"
        public void write(IChemSequence cs)
        {
            int count = cs.ChemModelCount;

            for (int i = 0; i < count; i++)
            {
                write("frame: " + (i + 1) + "\n");
                write(cs.getChemModel(i).Crystal);
            }
        }
Ejemplo n.º 7
0
        /// <summary> Puts all the Molecules of this container together in one
        /// AtomCcntainer.
        ///
        /// </summary>
        /// <returns>  The AtomContainer with all the Molecules of this container
        ///
        /// </returns>
        /// <deprecated> This method has a serious performace impact. Try to use
        /// other methods.
        /// </deprecated>
        public static IAtomContainer getAllInOneContainer(IChemSequence sequence)
        {
            IAtomContainer container = sequence.Builder.newAtomContainer();

            for (int i = 0; i < sequence.ChemModelCount; i++)
            {
                IChemModel model = sequence.getChemModel(i);
                container.add(ChemModelManipulator.getAllInOneContainer(model));
            }
            return(container);
        }
 public static System.Collections.IList getAllChemObjects(IChemSequence sequence)
 {
     System.Collections.ArrayList list = new System.Collections.ArrayList();
     list.Add(sequence);
     for (int i = 0; i < sequence.ChemModelCount; i++)
     {
         list.AddRange(ChemModelManipulator.getAllChemObjects(sequence.getChemModel(i)));
     }
     return list;
 }