Questions
Questions

2254 BIOSC 1544 SEC1000 Exam #2

Single choice

Consider the following Python code, which is meant to count the number of molecules in molecules.sdf that pass Lipinski's rule of fives: from rdkit import Chem from rdkit.Chem import AllChem, Crippen, Lipinski mols = [mol for mol in Chem.SDMolSupplier("molecules.sdf") if mol is not None] cnt = 0 for m in mols:     mw = 1 if AllChem.CalcExactMolWt(m) <= 500 else 0     logp = 1 if Crippen.MolLogP(m) <= 5 else 0     hd = 1 if Lipinski.NumHDonors(m) <= 5 else 0     ha = 1 if Lipinski.NumHAcceptors(m) <= 10 else 0     num_pass = mw + logp + hd + ha     # Modified rule: incorrectly rejects molecules with even one violation     if num_pass == 4:           cnt += 1 print(cnt) What is wrong with this code?

Options
A.The script incorrectly loads molecules because Chem.SDMolSupplier("molecules.sdf") does not return a list.
B.It incorrectly calculates molecular weight using AllChem.CalcExactMolWt(m), which is not an RDKit function.
C.It does not allow for one violation of the four criteria, which contradicts the rule’s original intent.
D.The code should be using >= instead of <= in the threshold conditions.
E.The code should count the number of violations instead of the number of passing criteria.
View Explanation

View Explanation

Verified Answer
Please login to view
Step-by-Step Analysis
Let’s break down the question and each proposed option to understand what’s faulty in this snippet. Option 1: 'The script incorrectly loads molecules because Chem.SDMolSupplier("molecules.sdf") does not return a list.' In this code, the author converts the supplier into a list with a list comprehension: mols = [mol for mol in Chem.SDMolSupplier("molecules.sdf") if mol is not None]. RDKit’s SDMolSupplier returns an iterable generator-like object, which is perfectly valid to iterate over or to materialize into a list as done here. Therefore, this option mischar......Login to view full explanation

Log in for full answers

We've collected over 50,000 authentic exam questions and detailed explanations from around the globe. Log in now and get instant access to the answers!

More Practical Tools for Students Powered by AI Study Helper

Join us and instantly unlock extensive past papers & exclusive solutions to get a head start on your studies!