Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolved issue #5 #6

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
9 changes: 6 additions & 3 deletions gdc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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__':
Expand Down
5 changes: 4 additions & 1 deletion gdc2xena.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down