Adds/subtracts electrons and returns a new object.

        :param charge: number of electrons to add
        :type charge: integer
        :returns: a spectrum with appropriately shifted masses
        :rtype: CentroidedSpectrum

def charged(self, charge):
        """
        Adds/subtracts electrons and returns a new object.

        :param charge: number of electrons to add
        :type charge: integer
        :returns: a spectrum with appropriately shifted masses
        :rtype: CentroidedSpectrum

        """
        result = self.copy()
        result.addCharge(charge)
        return result