The composition, protons or heavier nuclei, of ultra-high-energy cosmic rays (UHECRs) is traditionally inferred from the longitudinal profile of extensive air shower (EAS), since the maximum depth of EAS depends on the composition. However, the estimated composition of UHECRs tends to have large uncertainties as their energy increases, because this technique is based on the analysis of event-by-event simulations and the amount data for high energy events are limited. To overcome this difficulty, we explore a new method to infer the chemical composition of UHECRs from the astrophysical point of view. The trajectory of UHECRs is affected by the intervening magnetic field and the deflection angle (δ) is governed by the strength of magnetic field (B) and the energy (E) and charge (Z) of primary particle, δ∝ZB/E. We analyze the correlation between the arrival direction distribution of UHECRs and the large-scale structure of the universe in the southern galactic hemisphere. We estimate the composition of UHECRs through the Bayesian parameter inference of the deflection angle in Monte-Carlo simulations.