Using lattice models we explore the factors that determine the tendencies of polypeptide chains to aggregate by exhaustively sampling the sequence and conformational space. The morphologies of the fibril-like structures and the time scales ($tau_{fib
}$) for their formation depend on a balance between hydrophobic and coulomb interactions. The extent of population of an ensemble of textbf{N$^*$} structures, which are fibril-prone structures in the spectrum of conformations of an isolated protein, is the major determinant of $tau_{fib}$. This observation is used to determine the aggregating sequences by exhaustively exploring the sequence space, thus providing a basis for genome wide search of fragments that are aggregation prone.