def format_usage_masks(self, V_usage_mask_in, J_usage_mask_in, print_warnings = True):
        """Format raw usage masks into lists of indices.
    
        Usage masks allows the Pgen computation to be conditioned on the V and J 
        gene/allele identities. The inputted masks are lists of strings, or a 
        single string, of the names of the genes or alleles to be conditioned on. 
        The default mask includes all productive V or J genes.
    
        Parameters
        ----------
        V_usage_mask_in : str or list
            An object to indicate which V alleles should be considered. The default
            input is None which returns the list of all productive V alleles.
        J_usage_mask_in : str or list
            An object to indicate which J alleles should be considered. The default
            input is None which returns the list of all productive J alleles.
        print_warnings : bool
            Determines whether warnings are printed or not. Default ON.
    
        Returns
        -------
        V_usage_mask : list of integers
            Indices of the V alleles to be considered in the Pgen computation
        J_usage_mask : list of integers
            Indices of the J alleles to be considered in the Pgen computation
        
        Examples
        --------
        >>> generation_probability.format_usage_masks('TRBV27*01','TRBJ1-1*01')
        ([34], [0])
        >>> generation_probability.format_usage_masks('TRBV27*01', '')
        ([34], [0, 1, 2, 3, 4, 7, 8, 9, 10, 11, 12, 13])
        >>> generation_probability.format_usage_masks(['TRBV27*01', 'TRBV13*01'], 'TRBJ1-1*01')
        ([34, 18], [0])
            
        """
        #Format the V usage mask
        if V_usage_mask_in is None: #Default case, use all productive V genes with non-zero probability
            #V_usage_mask = [v for v, V in enumerate(ppp['cutV_genomic_CDR3_segs']) if len(V) > 0]
            V_usage_mask = self.d_V_usage_mask
        elif isinstance(V_usage_mask_in, list):
            e_V_usage_mask = set()
            for v in V_usage_mask_in:
                try:
                    e_V_usage_mask = e_V_usage_mask.union(self.V_mask_mapping[v])
                except KeyError:
                    if print_warnings:
                        print 'Unfamiliar V gene/allele: ' + v
                    pass
            if len(e_V_usage_mask) == 0:
                if print_warnings:
                    print 'No recognized V genes/alleles. Using default V_usage_mask'
                V_usage_mask = self.d_V_usage_mask
            else:
                V_usage_mask = list(e_V_usage_mask)
        else:
            try:
                V_usage_mask = self.V_mask_mapping[V_usage_mask_in]
            except KeyError:
                #Do raise error here as the mask will be empty
                if print_warnings:
                    print 'Unfamiliar V usage mask: ' + str(V_usage_mask_in) + ', please check the allowed V alleles. Using default V_usage_mask'
                V_usage_mask = self.d_V_usage_mask
                
                
        #Format the J usage mask
        if J_usage_mask_in is None: #Default case, use all productive J genes with non-zero probability
            #J_usage_mask = [j for j, J in enumerate(ppp['cutJ_genomic_CDR3_segs']) if len(J) > 0]
            J_usage_mask = self.d_J_usage_mask
        elif isinstance(J_usage_mask_in, list):
            e_J_usage_mask = set()
            for j in J_usage_mask_in:
                try:
                    e_J_usage_mask = e_J_usage_mask.union(self.J_mask_mapping[j])
                except KeyError:
                    if print_warnings:
                        print 'Unfamiliar J gene/allele: ' + j
                    pass
            if len(e_J_usage_mask) == 0:
                if print_warnings:
                    print 'No recognized J genes/alleles. Using default J_usage_mask'
                J_usage_mask = self.d_J_usage_mask
            else:
                J_usage_mask = list(e_J_usage_mask)
        else:
            try:
                J_usage_mask = self.J_mask_mapping[J_usage_mask_in]
            except KeyError:
                #Do raise error here as the mask will be empty
                if print_warnings:
                    print 'Unfamiliar J usage mask: ' + str(J_usage_mask_in) + ', please check the allowed J alleles. Using default J_usage_mask'
                J_usage_mask = self.d_J_usage_mask
                
        return V_usage_mask, J_usage_mask
Format raw usage masks into lists of indices.
    
        Usage masks allows the Pgen computation to be conditioned on the V and J 
        gene/allele identities. The inputted masks are lists of strings, or a 
        single string, of the names of the genes or alleles to be conditioned on. 
        The default mask includes all productive V or J genes.
    
        Parameters
        ----------
        V_usage_mask_in : str or list
            An object to indicate which V alleles should be considered. The default
            input is None which returns the list of all productive V alleles.
        J_usage_mask_in : str or list
            An object to indicate which J alleles should be considered. The default
            input is None which returns the list of all productive J alleles.
        print_warnings : bool
            Determines whether warnings are printed or not. Default ON.
    
        Returns
        -------
        V_usage_mask : list of integers
            Indices of the V alleles to be considered in the Pgen computation
        J_usage_mask : list of integers
            Indices of the J alleles to be considered in the Pgen computation
        
        Examples
        --------
        >>> generation_probability.format_usage_masks('TRBV27*01','TRBJ1-1*01')
        ([34], [0])
        >>> generation_probability.format_usage_masks('TRBV27*01', '')
        ([34], [0, 1, 2, 3, 4, 7, 8, 9, 10, 11, 12, 13])
        >>> generation_probability.format_usage_masks(['TRBV27*01', 'TRBV13*01'], 'TRBJ1-1*01')
        ([34, 18], [0])