We performed an integrated analysis of drug chemical structures and drug-induced transcriptional responses. We demonstrated that a network representing three-dimensional structural similarities among 5452 compounds can be used to automatically group together drugs with similar scaffolds, physicochemical parameters and mode-of-action. We compared the structural network to a network representing transcriptional similarities among a subset of 1309 drugs for which transcriptional response were available in the Connectivity Map data set. Analysis of structurally similar, but transcriptionally different drugs sharing the same MOA enabled us to detect and remove weak and noisy transcriptional responses, greatly enhancing the reliability of transcription-based approaches to drug discovery and drug repositioning. Cardiac glycosides exhibited the strongest transcriptional responses with a significant induction of pathways related to epigenetic regulation, which suggests an epigenetic mechanism of action for these drugs. Drug classes with the weakest transcriptional responses tended to induce expression of cytochrome P450 enzymes, hinting at drug-induced drug resistance. Analysis of transcriptionally similar, but structurally different drugs with unrelated MOA, led us to the identification of a 'toxic' transcriptional signature indicative of lysosomal stress (lysosomotropism) and lipid accumulation (phospholipidosis) partially masking the target-specific transcriptional effects of these drugs. We found that this transcriptional signature is shared by 258 compounds and it is associated to the activation of the transcription factor TFEB, a master regulator of lysosomal biogenesis and autophagy. Finally, we built a predictive Random Forest model of these 258 compounds based on 128 physicochemical parameters, which should help in the early identification of potentially toxic drug candidates.