Fetching CNA info from python client

95 views
Skip to first unread message

Ken

unread,
Jun 25, 2021, 11:55:38 AM6/25/21
to cBioPortal for Cancer Genomics Discussion Group
Dear cBioPortal folks,

I am trying to access copy number alterations information using the python client. I can easily fetch mutations info, with, for example:

muts = cbioportal.Mutations.getMutationsInMolecularProfileBySampleListIdUsingGET(
                molecularProfileId='acc_tcga_mutations',
                sampleListId='acc_tcga_all',
                projection="DETAILED"
            ).result()

However, I have not been able to figure out what suffix to add to the study ID in order the get the correct molecularProfileId for CNAs:

CNAs = cbioportal.Discrete_Copy_Number_Alterations.getDiscreteCopyNumbersInMolecularProfileUsingGET(
                molecularProfileId='acc_tcga_linear_CNA',
                sampleListId='acc_tcga_all',
                projection="DETAILED"
            ).result()

>>> MatchingResponseNotFound: Response specification matching http status_code 404 not found for operation Operation(getDiscreteCopyNumbersInMolecularProfileUsingGET). Either add a response specification for the status_code or use a `default` response.


What is the correct way to obtain CNA information for a given study using the python client?

Thank you,
Ken

Benjamin Gross

unread,
Jun 28, 2021, 10:17:15 AM6/28/21
to Ken, cBioPortal for Cancer Genomics Discussion Group
Hi Ken,

I’m not sure which library you are using, but if you have a study id of interest, you can use the "get all molecular profiles in a study” web service  endpoint:


curl -X GET "https://www.cbioportal.org/api/studies/acc_tcga/molecular-profiles?direction=ASC&pageNumber=0&pageSize=10000000&projection=SUMMARY" -H "accept: application/json"

The “molecularAlterationType” property will let you know if the profile is “COPY_NUMBER_ALTERATION” data.

Best,
Benjamin

--
You received this message because you are subscribed to the Google Groups "cBioPortal for Cancer Genomics Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cbioportal+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cbioportal/29ce8d98-fd86-4688-8033-295e435d828dn%40googlegroups.com.

Katherine Caley

unread,
Oct 27, 2022, 11:39:38 AM10/27/22
to cBioPortal for Cancer Genomics Discussion Group
Hi Ken, 

I believe its "gistic" 

the 
cnas = cbioportal.Discrete_Copy_Number_Alterations.getDiscreteCopyNumbersInMolecularProfileUsingGET(
             molecularProfileId=acc_tcga_gistic',
             sampleListId=acc_tcga_all',
             projection='DETAILED'
).result()

Reply all
Reply to author
Forward
0 new messages