method to get all chem polymers given a list of PolymerNotation objects

@param polymers List of PolymerNotation objects
@return list of chem polymers
489510
public final static List<PolymerNotation> getCHEMPolymers(List<PolymerNotation> polymers) {
    List<PolymerNotation> chemPolymers = new ArrayList<PolymerNotation>();
    for (PolymerNotation polymer : polymers) {
      if (polymer.getPolymerID() instanceof ChemEntity) {
        chemPolymers.add(polymer);
      }
    }
    return chemPolymers;
  }
662609
public static final int getTotalMonomerCount(HELM2Notation helm2notation) {
    int result = 0;
    for (PolymerNotation polymer : helm2notation.getListOfPolymers()) {
      result += PolymerUtils.getTotalMonomerCount(polymer);
    }
    return result;
  }
1344423
public IRingSet getBasicRings() throws NoSuchAtomException {
        IRingSet ringset = molecule.getBuilder().newInstance(IRingSet.class);
        IAtomContainer spt = getSpanningTree();
        for (int i = 0; i < totalEdgeCount; i++)
            if (!bondsInTree[i]) ringset.addAtomContainer(getRing(spt, molecule.getBond(i)));
        return ringset;
    }
320873
public static List<IChemObject> getAllChemObjects(IChemModel chemModel) {
        List<IChemObject> list = new ArrayList<IChemObject>();
        // list.add(chemModel); // only add ChemObjects contained within
        ICrystal crystal = chemModel.getCrystal();
        if (crystal != null) {
            list.add(crystal);
        }
        IAtomContainerSet moleculeSet = chemModel.getMoleculeSet();
        if (moleculeSet != null) {
            list.add(moleculeSet);
            List<IChemObject> current = MoleculeSetManipulator.getAllChemObjects(moleculeSet);
            for (IChemObject chemObject : current) {
                if (!list.contains(chemObject)) list.add(chemObject);
            }
        }
        IReactionSet reactionSet = chemModel.getReactionSet();
        if (reactionSet != null) {
            list.add(reactionSet);
            List<IChemObject> current = ReactionSetManipulator.getAllChemObjects(reactionSet);
            for (IChemObject chemObject : current) {
                if (!list.contains(chemObject)) list.add(chemObject);
            }
        }
        return list;
    }
553938
private ImmutableSet<ASTAnnotation> getAnnotations(Annotation[] annotations) {

        ImmutableSet.Builder<ASTAnnotation> astAnnotationBuilder = ImmutableSet.builder();

        for (Annotation annotation : annotations) {
            astAnnotationBuilder.add(getAnnotation(annotation));
        }

        return astAnnotationBuilder.build();
    }
343755
public static List<EntityInfo> findPolyEntities(List<List<Chain>> polyModels) {
		TreeMap<String,EntityInfo> chainIds2entities = findEntitiesFromAlignment(polyModels);

		List<EntityInfo> entities = findUniqueEntities(chainIds2entities);

		return entities;
	}
985556
static public SimpleGraph getMoleculeGraph(IAtomContainer molecule) {
        SimpleGraph graph = new SimpleGraph();
        for (int i = 0; i < molecule.getAtomCount(); i++) {
            IAtom atom = molecule.getAtom(i);
            graph.addVertex(atom);
        }

        for (int i = 0; i < molecule.getBondCount(); i++) {
            IBond bond = molecule.getBond(i);

            /*
             * int order = (int) bond.getOrder(); for (int j=0; j<order; j++) {
             * graph.addEdge(bond.getAtoms()[0], bond.getAtoms()[1]); }
             */
            graph.addEdge(bond.getBegin(), bond.getEnd());
        }
        return graph;
    }
553032
def chemsys(self) -> set:
        
        chemsys = set()
        for e in self.entries:
            chemsys.update([el.symbol for el in e.composition.keys()])
        return chemsys
938591
public List<MimeMappingType<WebFragmentDescriptor>> getAllMimeMapping()
   {
      List<MimeMappingType<WebFragmentDescriptor>> list = new ArrayList<MimeMappingType<WebFragmentDescriptor>>();
      List<Node> nodeList = model.get("mime-mapping");
      for(Node node: nodeList)
      {
         MimeMappingType<WebFragmentDescriptor>  type = new MimeMappingTypeImpl<WebFragmentDescriptor>(this, "mime-mapping", model, node);
         list.add(type);
      }
      return list;
   }
1162360
@Override
	public  ChemComp getChemComp(String recordName) {

		// make sure we work with upper case records
		recordName = recordName.toUpperCase().trim();

		boolean haveFile = true;
		if ( recordName.equals("?")){
			return null;
		}

		if ( ! fileExists(recordName)) {
			// check if we should install all components
			checkDoFirstInstall();
		}
		if ( ! fileExists(recordName)) {
			// we previously have installed already the definitions,
			// just do an incrememntal update
			haveFile = downloadChemCompRecord(recordName);
		}

		// Added check that download was successful and chemical component is available.
		if (haveFile) {
			String filename = getLocalFileName(recordName);
			InputStream inStream = null;
			try {

				InputStreamProvider isp = new InputStreamProvider();

				inStream = isp.getInputStream(filename);

				MMcifParser parser = new SimpleMMcifParser();

				ChemCompConsumer consumer = new ChemCompConsumer();

				// The Consumer builds up the BioJava - structure object.
				// you could also hook in your own and build up you own data model.
				parser.addMMcifConsumer(consumer);

				parser.parse(new BufferedReader(new InputStreamReader(inStream)));

				ChemicalComponentDictionary dict = consumer.getDictionary();

				ChemComp chemComp = dict.getChemComp(recordName);

				// May be null if the file was corrupt. Fall back on ReducedChemCompProvider in that case
				if(chemComp != null) {
					return chemComp;
				}

			} catch (IOException e) {

				logger.warn(
						"Could not download chemical component file {} for {}. Error: {}. Now trying to use the local chemical component definitions.",
						filename, recordName, e.getMessage());

			}
			finally{
				// Now close it
				if(inStream!=null){
					try {
						inStream.close();
					} catch (IOException e) {
						// This would be weird...
						logger.error("Could not close chemical component file {}. A resource leak could occur!!", filename);
					}
				}

			}
		}

		// see https://github.com/biojava/biojava/issues/315
		// probably a network error happened. Try to use the ReducedChemCOmpProvider
		if( fallback == null) {
			fallback = new ReducedChemCompProvider();
		}

		logger.warn("Falling back to ReducedChemCompProvider for {}. This could indicate a network error.", recordName);
		return fallback.getChemComp(recordName);

	}
957271
def get_rotatable_bonds(self,mol):
		
		RotatableBondSmarts = Chem.MolFromSmarts('[!$(*#*)&!D1]-&!@[!$(*#*)&!D1]')
		bonds = mol.GetSubstructMatches(RotatableBondSmarts,uniquify=1)
		return bonds
57076
def from_polymers(cls, polymers):
        
        n = len(polymers)
        instance = cls(n=n, auto_build=False)
        instance.major_radii = [x.major_radius for x in polymers]
        instance.major_pitches = [x.major_pitch for x in polymers]
        instance.major_handedness = [x.major_handedness for x in polymers]
        instance.aas = [x.num_monomers for x in polymers]
        instance.minor_helix_types = [x.minor_helix_type for x in polymers]
        instance.orientations = [x.orientation for x in polymers]
        instance.phi_c_alphas = [x.phi_c_alpha for x in polymers]
        instance.minor_repeats = [x.minor_repeat for x in polymers]
        instance.build()
        return instance
733001
public Chemical getChemicalList(int i) {
    if (ManualDescriptor_Type.featOkTst && ((ManualDescriptor_Type)jcasType).casFeat_chemicalList == null)
      jcasType.jcas.throwFeatMissing("chemicalList", "de.julielab.jules.types.pubmed.ManualDescriptor");
    jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((ManualDescriptor_Type)jcasType).casFeatCode_chemicalList), i);
    return (Chemical)(jcasType.ll_cas.ll_getFSForRef(jcasType.ll_cas.ll_getRefArrayValue(jcasType.ll_cas.ll_getRefValue(addr, ((ManualDescriptor_Type)jcasType).casFeatCode_chemicalList), i)));}
497359
public Monomer getBaseMonomer(MonomerStore monomerStore) {

    String baseSymbol = getBaseSymbol();
    if (baseSymbol != null && !baseSymbol.equalsIgnoreCase("")) {
      try {
        Map<String, Monomer> monomers = monomerStore.getMonomers(Monomer.NUCLIEC_ACID_POLYMER_TYPE);
        Monomer m = monomers.get(baseSymbol);
        return m;
      } catch (Exception ex) {
        LOG.info("Unable to get base monomer for "
            + baseSymbol);
        return null;
      }
    } else {
      return null;
    }

  }
802872
@Override
    public List<IBond> getConnectedBondsList(IAtom atom) {
        List<IBond> bondsList = new ArrayList<IBond>();
        for (int i = 0; i < bondCount; i++) {
            if (bonds[i].contains(atom)) bondsList.add(bonds[i]);
        }
        return bondsList;
    }
576658
public final static PolymerNotation addAnnotationToPolymer(final PolymerNotation polymer, final String annotation) {
		if (polymer.getAnnotation() != null) {
			return new PolymerNotation(polymer.getPolymerID(), polymer.getPolymerElements(),
					polymer.getAnnotation() + " | " + annotation);
		}
		return new PolymerNotation(polymer.getPolymerID(), polymer.getPolymerElements(), annotation);
	}
325099
public static IAtomContainerSet getAllMolecules(IReactionSet set) {
        IAtomContainerSet moleculeSet = set.getBuilder().newInstance(IAtomContainerSet.class);
        for (IReaction reaction : set.reactions()) {
            IAtomContainerSet molecules = ReactionManipulator.getAllMolecules(reaction);
            for (IAtomContainer ac : molecules.atomContainers()) {
                boolean contain = false;
                for (IAtomContainer atomContainer : moleculeSet.atomContainers()) {
                    if (atomContainer.equals(ac)) {
                        contain = true;
                        break;
                    }
                }
                if (!contain) moleculeSet.addAtomContainer(ac);

            }
        }
        return moleculeSet;
    }