scripts/parse_nagim.py
def _parse_sample_project_map(tsv_path: str) -> List[Sample]:
    """
    Initialize list of Sample object and set project IDs.
    """
    sample_by_nagim_id = {}
    df = pd.read_csv(tsv_path, sep='\t', header=None, names=['nagim_id', 'proj'])
    for (nagim_id, proj) in zip(df.nagim_id, df.proj):
        if proj in PROJECT_ID_MAP.values():
            cpg_proj = proj
        elif proj in PROJECT_ID_MAP:
            cpg_proj = PROJECT_ID_MAP[proj]
        else:
            raise ValueError(
                f'Unknown project {proj}. Known project IDs: {PROJECT_ID_MAP}'
            )
        sample_by_nagim_id[nagim_id] = Sample(
            nagim_id=nagim_id,
            project_id=cpg_proj,
        )
    logger.info(f'Read {len(sample_by_nagim_id)} samples from {tsv_path}')
    return list(sample_by_nagim_id.values())

    Initialize list of Sample object and set project IDs.
    
Initialize list of Sample object and set project IDs.
Initialize list of Sample object and set project IDs .
def _parse_sample_project_map(tsv_path: str) -> List[Sample]:
    sample_by_nagim_id = {}
    df = pd.read_csv(tsv_path, sep='\t', header=None, names=['nagim_id', 'proj'])
    for (nagim_id, proj) in zip(df.nagim_id, df.proj):
        if proj in PROJECT_ID_MAP.values():
            cpg_proj = proj
        elif proj in PROJECT_ID_MAP:
            cpg_proj = PROJECT_ID_MAP[proj]
        else:
            raise ValueError(
                f'Unknown project {proj}. Known project IDs: {PROJECT_ID_MAP}'
            )
        sample_by_nagim_id[nagim_id] = Sample(
            nagim_id=nagim_id,
            project_id=cpg_proj,
        )
    logger.info(f'Read {len(sample_by_nagim_id)} samples from {tsv_path}')
    return list(sample_by_nagim_id.values())
def _parse_sample_project_map ( tsv_path : str ) -> List [ Sample ] : sample_by_nagim_id = { } df = pd . read_csv ( tsv_path , sep = '\t' , header = None , names = [ 'nagim_id' , 'proj' ] ) for ( nagim_id , proj ) in zip ( df . nagim_id , df . proj ) : if proj in PROJECT_ID_MAP . values ( ) : cpg_proj = proj elif proj in PROJECT_ID_MAP : cpg_proj = PROJECT_ID_MAP [ proj ] else : raise ValueError ( f'Unknown project {proj}. Known project IDs: {PROJECT_ID_MAP}' ) sample_by_nagim_id [ nagim_id ] = Sample ( nagim_id = nagim_id , project_id = cpg_proj , ) logger . info ( f'Read {len(sample_by_nagim_id)} samples from {tsv_path}' ) return list ( sample_by_nagim_id . values ( ) )
Initialize list of Sample object and set project IDs.
Initialize list of Sample object and set project IDs .
"""
    Initialize list of Sample object and set project IDs.
    """
tsv_path
str