diff --git a/gdc.py b/gdc.py index 2778987..d7cafa7 100644 --- a/gdc.py +++ b/gdc.py @@ -376,8 +376,7 @@ def get_project_info(projects=None): project_df = search('projects', in_filter=in_filter, fields=['name', 'primary_site', 'project_id', 'program.name']) - return project_df.set_index('id') - + return project_df def get_samples_clinical(projects=None): """Get info for all samples of ``projects`` and clinical info for all @@ -431,7 +430,11 @@ def main(): print('A simple python module providing selected GDC API functionalities.') # Simple test - print(get_project_info(['TCGA-THCA']).head()) + df = get_project_info(['TCGA-THCA']) + if(df.empty==False): + print(df.head()) + else: + print("Empty dataframe!") if __name__ == '__main__': diff --git a/gdc2xena.py b/gdc2xena.py index 19083ff..2d94472 100755 --- a/gdc2xena.py +++ b/gdc2xena.py @@ -134,7 +134,10 @@ def main(): root_dir = os.path.abspath(args.root) projects = args.projects if 'all' in [p.lower() for p in projects]: - projects = [str(x) for x in gdc.get_project_info().index] + projects = [str(x) for x in gdc.get_project_info()] + for project in projects: + if(project.empty==False): + project = project.index for p in args.not_projects: projects.remove(p) xena_dtypes = args.datatype