Ab initio computational methods for electronic transport in nanoscaled systems are an invaluable tool for the design of quantum devices. We have developed a flexible and efficient algorithm for evaluating I-V characteristics of atomic junctions, which integrates the nonequilibrium Green's function method with density functional theory. This is currently implemented in the package SMEAGOL. The heart of SMEAGOL is our scheme for constructing the surface Green's functions describing the current-voltage probes. It consists of a direct summation of both open and closed scattering channels together with a regularization procedure of the Hamiltonian and provides great improvements over standard recursive methods. In particular it allows us to tackle material systems with complicated electronic structures, such as magnetic transition metals. Here we present a detailed description of SMEAGOL together with an extensive range of applications relevant for the two burgeoning fields of spin and molecular electronics.