Section 7. If, after the granting of letters of administration to a public administrator and before the final settlement of the estate, the husband, widow or an heir of the deceased, in writing, claims the right of administration or requests the appointment of some other suitable person to the trust, the probate court may, in its discretion, grant letters of administration accordingly, or if, after the granting of such letters to a public administrator, a will of the deceased is proved and allowed, said court shall grant letters testamentary or letters of administration with the will annexed. When the person to whom such letters are granted gives the bond required by law the powers of the public administrator over the estate shall cease.