Advertisement

If you have an ACS member number, please enter it here so we can link this account to your membership. (optional)

ACS values your privacy. By submitting your information, you are gaining access to C&EN and subscribing to our weekly newsletter. We use the information you provide to make your reading experience better, and we will never sell your data to third party members.

ENJOY UNLIMITED ACCES TO C&EN

Education

Perspectives: Teaching chemists to code

Providing undergraduate chemistry majors with computer programming skills can make them more efficient and effective scientists

by Charles J. Weiss
September 4, 2017 | A version of this story appeared in Volume 95, Issue 35

 

Spreadsheets are a standard tool in chemistry for simple tasks such as data analysis and graphing. Chemistry students are often introduced to spreadsheets their first year of college, if not earlier, and those who continue on to do research will likely use them as a means of handling and visualizing data.

An image shows an overlay of three computer screens of Jupyter notebook pages with graphs, data, and information.
Credit: Charles Weiss
Weiss uses Jupyter Notebooks, like these examples shown, in his scientific computing undergraduate chemistry course.

Although spreadsheets have more capabilities than many people realize, they are still limited in comparison with science-specific data-analysis software applications. For example, spreadsheets are currently incapable of or not well suited for image analysis, automated data processing, high-dimensional data analysis, complex simulations, and machine learning that are needed in modern chemical research laboratories.

While some educators in the chemistry community have embraced advanced data-analysis software, it’s surprising that its use isn’t more common. And going beyond that, it’s surprising that computer programming has not effectively permeated the training of undergraduate chemistry majors. The American Chemical Society’s guidelines for undergraduate training do not directly address educating students on using digital tools and programming for dealing with experimental data.

In an age when chemistry classrooms have long been equipped with computers, and when research labs and companies where our students will go to work are experiencing a digital data deluge, it seems that we are leaving them ill prepared.

Software better geared to those earning chemistry degrees or conducting research is readily available. Common examples include MATLAB, Python’s SciPy stack, and GNU Octave. The last two are free, open-source packages. So why haven’t these become standard tools taught to all undergraduate chemistry majors? A key barrier to their adoption is that each of these packages requires some level of programming ability ... and computer programming is not part of the standard training for chemists ... but it should be.

Learning computer programming is an invaluable skill for chemists, as it empowers them to do more with collected data and, ultimately, to be more efficient and effective scientists. A competitive edge today doesn’t necessarily go to the person who can collect the best data but to the person who can best process and analyze the data collected. This nuance involves automating repetitive and time-consuming tasks, mining large data sets that don’t fit well in spreadsheets, and extracting information and trends too subtle or complex for people to discern without computers.

Add your thoughts

Share your experiences with undergraduate chemistry computer programming in the comment box below.

I recently chatted with a fellow chemist who had interviewed for a job at a company. The interviewer asked whether this chemist knew how to program. The company maintains an extensive database of its research results obtained over the years, and research managers want their team members to have computer programming skills so that they can access this data and use it in their ongoing research. The interviewer also pointed out that computer programming is a skill that, unfortunately, most chemists joining the company do not have.

I have seen firsthand how students light up when data analysis and computing resources are made available to them. To address the lack of programming training in traditional chemistry courses, last fall I taught the first iteration of a class called Scientific Computing for Chemists. During the course, chemistry students learned basic Python programming and how to use Jupyter Notebooks and SciPy stack—all free and open source—to solve chemical problems (J. Chem. Educ. 2017, DOI: 10.1021/acs.jchemed.7b00078).

The importance and utility of the course content, which assumes no previous programming experience, is underscored by the postcourse survey, which revealed that three-quarters of the students had applied what they were learning to their independent research projects or other courses before the computing course had concluded. The survey also shows that the students believed they learned to perform valuable data analyses that they didn’t previously know were possible and that the course provided them better understanding of and confidence in working with digital data. I am teaching the course again this fall.

My chemistry colleagues have noticed a difference because of the course, stopping me in the hallway to comment on how excited the scientific computing students were for taking it and reporting how student coding carried over into other courses. For example, one professor noted that the students taking the advanced analytical chemistry course in the spring approached many of the problems using Python and Jupyter Notebooks. Instead of performing the calculations by hand or using spreadsheets, students immediately went for the more advanced tools.

Incorporating more data analysis into the undergraduate curriculum takes time. Chemistry departments have increasing requirements placed on them for granting undergraduate degrees and, further, have limits on the number of courses they can require or offer for a major. This situation can make it difficult to include a topic such as computer programming that educators may not view as central to chemical science.

But that is an outdated view of chemical science. Scientific computing can be introduced to students in a course as described above or through a course from a computer science department. It can also be infused into other existing chemistry courses.

Last spring, I replaced an outdated piece of software for an intermediate-level chemistry course lab activity with Python and Jupyter Notebooks. Our general chemistry radioactivity lab this fall will include students running precoded, stochastic simulations of radioactive decay to examine how randomness influences experimental outcomes. The students are being asked to modify values used in the code, but they do not need to know programming for the activity. This exercise will provide our first-year chemistry students with an early exposure to using more sophisticated tools for running simulations and visualizations.

Weiss
[+]Enlarge
Credit: Courtesy of Charles Weiss
A photo of Charles Weiss of Wabash College.
Credit: Courtesy of Charles Weiss

No matter how this new knowledge is incorporated into the curriculum, we should work to equip our students entering the field of chemistry with the digital skills to be efficient and effective scientists. This includes the ability to process, analyze, and visualize data using at least one programming language and to be comfortable writing scripts to automate research tasks. While it will take time and effort to implement, emphasizing programming skills will empower students and better prepare them for their careers.

Charles J. Weiss teaches chemistry and scientific computing at Wabash College and conducts research in organometallic catalysis and bioinformatics. He taught himself to program in Python to support his teaching and research.

Article:

This article has been sent to the following recipient:

0 /1 FREE ARTICLES LEFT THIS MONTH Remaining
Chemistry matters. Join us to get the news you need.