First-principles study of electronic properties of one dimensional nanostructures