def _calculateCoverageMasks(proteindb, peptidedb):
        """Calcualte the sequence coverage masks for all proteindb elements.
        Private method used by :class:`ProteinDatabase`.

        A coverage mask is a numpy boolean array with the length of the protein
        sequence. Each protein position that has been covered in at least one
        peptide is set to True. Coverage masks are calculated for unique and for
        shared peptides. Peptides are matched to proteins according to positions
        derived by the digestion of the FASTA file.

        Alternatively peptides could also be matched to proteins just by
        sequence as it is done in :func:`pyteomics.parser.coverage`, but this is
        not the case here.

        :param proteindb: a dictionary containing :class:`ProteinSequence`
            entries, for example ``ProteinDatabase.proteins``
        :param proteindb: a dictionary containing :class:`PeptideSequence`
            entries, for example ``ProteinDatabase.peptides``

        Sets two attributes for each ``ProteinSequence`` entry:
            ``.coverageMaskUnique`` = coverage mask of unique peptides
            ``.coverageMaskShared`` = coverage mask of shared peptides
        """
        for proteinId, proteinEntry in viewitems(proteindb):
            coverageMaskUnique = numpy.zeros(proteinEntry.length(), dtype='bool')
            for peptide in proteinEntry.uniquePeptides:
                startPos, endPos = peptidedb[peptide].proteinPositions[proteinId]
                coverageMaskUnique[startPos-1:endPos] = True
            coverageMaskShared = numpy.zeros(proteinEntry.length(), dtype='bool')
            for peptide in proteinEntry.sharedPeptides:
                startPos, endPos = peptidedb[peptide].proteinPositions[proteinId]
                coverageMaskShared[startPos-1:endPos] = True
            setattr(proteinEntry, 'coverageMaskUnique', coverageMaskUnique)
            setattr(proteinEntry, 'coverageMaskShared', coverageMaskShared)
Calcualte the sequence coverage masks for all proteindb elements.
        Private method used by :class:`ProteinDatabase`.

        A coverage mask is a numpy boolean array with the length of the protein
        sequence. Each protein position that has been covered in at least one
        peptide is set to True. Coverage masks are calculated for unique and for
        shared peptides. Peptides are matched to proteins according to positions
        derived by the digestion of the FASTA file.

        Alternatively peptides could also be matched to proteins just by
        sequence as it is done in :func:`pyteomics.parser.coverage`, but this is
        not the case here.

        :param proteindb: a dictionary containing :class:`ProteinSequence`
            entries, for example ``ProteinDatabase.proteins``
        :param proteindb: a dictionary containing :class:`PeptideSequence`
            entries, for example ``ProteinDatabase.peptides``

        Sets two attributes for each ``ProteinSequence`` entry:
            ``.coverageMaskUnique`` = coverage mask of unique peptides
            ``.coverageMaskShared`` = coverage mask of shared peptides