private double calculateMass() {
        double mass = 0;
        Group c_terminal = this.peptide.getCTerminalGroup();
        Group n_terminal = this.peptide.getNTerminalGroup();
        List<AminoAcid> acidList = this.peptide.getAminoAcids();

        for (AminoAcid acid : acidList) {
            mass += acid.getMonoMass();
        }
        mass += c_terminal == null ? 0 : c_terminal.getMass();
        mass += n_terminal == null ? 0 : n_terminal.getMass();

        //calculate modifications
        Map<Integer, PTModification> ptm = peptide.getPTM();
        Integer position;
        PTModification modification;
        Iterator<Integer> it = ptm.keySet().iterator();
        while (it.hasNext()) {
            position = it.next();
            modification = ptm.get(position);
            if(modification.getMonoMassDeltas() != null && !modification.getMonoMassDeltas().isEmpty())
               mass += modification.getMonoMassDeltas().get(0);
        }

        return mass;
    }