Code for SMARTX analysis