localpdb/PDB.py
def select_updates(self, mode='am+'):
        """
        Selects entries that were added or modified when compare to previous PDB release.
        @param mode: Select entries that were added ("a"), modified ("m"). "+" loads new entries compared to the
        previous localpdb version (important when localpdb is not updated weekly). If "+" is missing only new entries
        present in weekly PDB release will be selected.
        """
        map = {'a': 'added', 'm': 'modified_major'}
        ids = set()
        if not ('a' in mode or 'm' in mode):
            raise ValueError('Either \'a\' or \'m\' must be included in \'mode\'!')
        for m in ['a', 'm']:
            if m in mode:
                fn = f'{self.db_path}/data/{self.version}/{map[m]}.txt'
                if '+' in mode:
                    if os.path.isfile(f'{self.db_path}/data/{self.version}/{map[m]}_merged.txt'):
                        fn = f'{self.db_path}/data/{self.version}/{map[m]}_merged.txt'
                    else:
                        raise RuntimeError(f'\'+\' is not compatible with \'{map[m]}\' mode and localpdb version \'{self.version}\'')
                with open(fn) as f:
                    tmp_ids = {line.rstrip() for line in f}
                    ids = ids | tmp_ids
        curr_ids = set(self.entries.index.values)
        self.entries = self.entries.loc[ids & curr_ids]

        Selects entries that were added or modified when compare to previous PDB release.
        @param mode: Select entries that were added ("a"), modified ("m"). "+" loads new entries compared to the
        previous localpdb version (important when localpdb is not updated weekly). If "+" is missing only new entries
        present in weekly PDB release will be selected.
        
Selects entries that were added or modified when compare to previous PDB release.
Selects entries that were added or modified when compare to previous PDB release .
def select_updates(self, mode='am+'):
        map = {'a': 'added', 'm': 'modified_major'}
        ids = set()
        if not ('a' in mode or 'm' in mode):
            raise ValueError('Either \'a\' or \'m\' must be included in \'mode\'!')
        for m in ['a', 'm']:
            if m in mode:
                fn = f'{self.db_path}/data/{self.version}/{map[m]}.txt'
                if '+' in mode:
                    if os.path.isfile(f'{self.db_path}/data/{self.version}/{map[m]}_merged.txt'):
                        fn = f'{self.db_path}/data/{self.version}/{map[m]}_merged.txt'
                    else:
                        raise RuntimeError(f'\'+\' is not compatible with \'{map[m]}\' mode and localpdb version \'{self.version}\'')
                with open(fn) as f:
                    tmp_ids = {line.rstrip() for line in f}
                    ids = ids | tmp_ids
        curr_ids = set(self.entries.index.values)
        self.entries = self.entries.loc[ids & curr_ids]
def select_updates ( self , mode = 'am+' ) : map = { 'a' : 'added' , 'm' : 'modified_major' } ids = set ( ) if not ( 'a' in mode or 'm' in mode ) : raise ValueError ( 'Either \'a\' or \'m\' must be included in \'mode\'!' ) for m in [ 'a' , 'm' ] : if m in mode : fn = f'{self.db_path}/data/{self.version}/{map[m]}.txt' if '+' in mode : if os . path . isfile ( f'{self.db_path}/data/{self.version}/{map[m]}_merged.txt' ) : fn = f'{self.db_path}/data/{self.version}/{map[m]}_merged.txt' else : raise RuntimeError ( f'\'+\' is not compatible with \'{map[m]}\' mode and localpdb version \'{self.version}\'' ) with open ( fn ) as f : tmp_ids = { line . rstrip ( ) for line in f } ids = ids | tmp_ids curr_ids = set ( self . entries . index . values ) self . entries = self . entries . loc [ ids & curr_ids ]
Selects entries that were added or modified when compare to previous PDB release.
Selects entries that were added or modified when compare to previous PDB release .
"""
        Selects entries that were added or modified when compare to previous PDB release.
        @param mode: Select entries that were added ("a"), modified ("m"). "+" loads new entries compared to the
        previous localpdb version (important when localpdb is not updated weekly). If "+" is missing only new entries
        present in weekly PDB release will be selected.
        """
self
mode
Select entries that were added ("a"), modified ("m"). "+" loads new entries compared to the
previous localpdb version (important when localpdb is not updated weekly). If "+" is missing only new entries
present in weekly PDB release will be selected.
Select entries that were added ( " a " ) modified ( " m " ) . " + " loads new entries compared to the previous localpdb version ( important when localpdb is not updated weekly ) . If " + " is missing only new entries present in weekly PDB release will be selected .