Transition of bacterial flagella from helical to straight forms with different subunit arrangements