Human DNA sequence determines the cellular fate through transcription to RNA and translation to proteins. DNA and RNA undergo extensive processing in the cells based on the sequence and cellular state, where alternative splicing in particular determines RNA isoform choice. In the recent years, in addition to the sequence of nucleic acid, its structure and epigenetic landscape have been shown to play important roles in cellular functions. For example, DNA and RNA G-quadruplex (G4) structures were found to affect oncogene expression and to be attractive therapeutic targets. This thesis mainly focuses on the DNA and RNA G4 structure formation and RNA splicing in cellular contexts.First, I analyse the formation of irregular G4 forming motifs using reported experimental data on DNA G4 in cells. I find possible correlations of DNA G4 formation with contextual epigenetic features using neural networks and propose a deep learning-based method for G4 prediction in cells. Motivated by the scarcity of RNA G4 probing methods, I additionally propose a method for detection of RNA G-quadruplexes in long RNA with direct nanopore sequencing. Contextual machine learning is further applied to predict alternative RNA splicing in cells using RNA-binding protein (RBP) levels. In summary, I have developed deep learning methods for prediction of G4 structure formation and RNA splicing in cells, which will help to advance our understanding of DNA/RNA structure and processing in different cellular contexts.