python/pymethylprocess/MethylationDataTypes.py
def remove_missingness(self, cpg_threshold=None, sample_threshold=None):
        """Remove samples and CpGs with certain level of missingness..

        Parameters
        ----------
        cpg_threshold
            If more than fraction of Samples for this CpG are missing, remove cpg.
        sample_threshold
            If more than fraction of CpGs for this sample are missing, remove sample.
        """
        cpgs_remove = np.array([])
        samples_remove = np.array([])
        cpgs=self.return_cpgs()
        samples=self.return_idx()
        na_frame = pd.isna(self.beta).astype(int)
        if cpg_threshold != None:
            cpgs_remove=cpgs[na_frame.sum(axis=0).apply(lambda x: x/float(na_frame.shape[0])).values >= cpg_threshold]
        if sample_threshold != None:
            samples_remove=samples[na_frame.sum(axis=1).apply(lambda x: x/float(na_frame.shape[1])) >= sample_threshold]
        self.beta = self.beta.loc[~np.isin(samples,samples_remove),~np.isin(cpgs,cpgs_remove)]
        self.pheno = self.pheno.loc[self.beta.index,:]
Remove samples and CpGs with certain level of missingness..

        Parameters
        ----------
        cpg_threshold
            If more than fraction of Samples for this CpG are missing, remove cpg.
        sample_threshold
            If more than fraction of CpGs for this sample are missing, remove sample.
        
Remove samples and CpGs with certain level of missingness
Parameters

cpg_threshold
If more than fraction of Samples for this CpG are missing, remove cpg.
sample_threshold
If more than fraction of CpGs for this sample are missing, remove sample.
Remove samples and CpGs with certain level of missingness Parameters cpg_threshold If more than fraction of Samples for this CpG are missing remove cpg . sample_threshold If more than fraction of CpGs for this sample are missing remove sample .
def remove_missingness(self, cpg_threshold=None, sample_threshold=None):
        cpgs_remove = np.array([])
        samples_remove = np.array([])
        cpgs=self.return_cpgs()
        samples=self.return_idx()
        na_frame = pd.isna(self.beta).astype(int)
        if cpg_threshold != None:
            cpgs_remove=cpgs[na_frame.sum(axis=0).apply(lambda x: x/float(na_frame.shape[0])).values >= cpg_threshold]
        if sample_threshold != None:
            samples_remove=samples[na_frame.sum(axis=1).apply(lambda x: x/float(na_frame.shape[1])) >= sample_threshold]
        self.beta = self.beta.loc[~np.isin(samples,samples_remove),~np.isin(cpgs,cpgs_remove)]
        self.pheno = self.pheno.loc[self.beta.index,:]
def remove_missingness ( self , cpg_threshold = None , sample_threshold = None ) : cpgs_remove = np . array ( [ ] ) samples_remove = np . array ( [ ] ) cpgs = self . return_cpgs ( ) samples = self . return_idx ( ) na_frame = pd . isna ( self . beta ) . astype ( int ) if cpg_threshold != None : cpgs_remove = cpgs [ na_frame . sum ( axis = 0 ) . apply ( lambda x : x / float ( na_frame . shape [ 0 ] ) ) . values >= cpg_threshold ] if sample_threshold != None : samples_remove = samples [ na_frame . sum ( axis = 1 ) . apply ( lambda x : x / float ( na_frame . shape [ 1 ] ) ) >= sample_threshold ] self . beta = self . beta . loc [ ~ np . isin ( samples , samples_remove ) , ~ np . isin ( cpgs , cpgs_remove ) ] self . pheno = self . pheno . loc [ self . beta . index , : ]
Remove samples and CpGs with certain level of missingness..
Parameters
Remove samples and CpGs with certain level of missingness .. Parameters
"""Remove samples and CpGs with certain level of missingness..

        Parameters
        ----------
        cpg_threshold
            If more than fraction of Samples for this CpG are missing, remove cpg.
        sample_threshold
            If more than fraction of CpGs for this sample are missing, remove sample.
        """
self
cpg_threshold
sample_threshold