waldronlab / cBioPortalData

Integrate the cancer genomics portal, cBioPortal, using MultiAssayExperiment
https://waldronlab.io/cBioPortalData/
30 stars 12 forks source link

There is an error in the JSON format of the request payload - R api wrapper #41

Closed jjgao closed 3 years ago

jjgao commented 3 years ago

reported by @mattdmem https://github.com/cBioPortal/cbioportal/issues/8392

Hello, nice tool.

I am trying to get some data in R and I am getting the error:

"There is an error in the JSON format of the request payload"

R4.0.4

mutationData(cbio,molecularProfileIds =molecular_profile , sampleIds = sampleIds)

where molecular profile is:

[1] "lung_msk_pdx_mutations"

and sampleIds is:

  [1] "P-0014285-T02-IM6" "P-0005544-T01-IM5" "P-0000339-T01-IM3" "P-0000543-T01-IM3" "P-0000636-T01-IM3" "P-0001833-T01-IM3" "P-0003502-T01-IM5"
  [8] "P-0003709-T01-IM5" "P-0004218-T01-IM5" "P-0004266-T01-IM5" "P-0004410-T01-IM5" "P-0004442-T01-IM5" "P-0004860-T01-IM5" "P-0005173-T01-IM5"
 [15] "P-0005544-T02-IM5" "P-0005562-T01-IM5" "P-0006273-T01-IM5" "P-0006364-T01-IM5" "P-0006598-T01-IM5" "P-0006844-T01-IM5" "P-0006844-T02-IM5"
 [22] "P-0007498-T01-IM5" "P-0007500-T01-IM5" "P-0007870-T01-IM5" "P-0007870-T02-IM6" "P-0008553-T01-IM5" "P-0008876-T01-IM5" "P-0008903-T01-IM5"
 [29] "P-0008944-T01-IM5" "P-0009358-T01-IM5" "P-0009702-T01-IM5" "P-0010351-T01-IM5" "P-0010571-T01-IM5" "P-0010681-T01-IM5" "P-0010901-T01-IM5"
 [36] "P-0010947-T01-IM5" "P-0011312-T01-IM5" "P-0011456-T01-IM5" "P-0012001-T01-IM5" "P-0012091-T01-IM5" "P-0012092-T01-IM5" "P-0012287-T01-IM5"
 [43] "P-0012308-T01-IM5" "P-0012341-T01-IM5" "P-0012443-T01-IM5" "P-0012736-T01-IM5" "P-0014243-T01-IM6" "P-0014285-T03-IM6" "P-0014389-T01-IM6"
 [50] "P-0015360-T01-IM6" "P-0015360-T02-IM6" "P-0015759-T01-IM6" "P-0015780-T01-IM6" "P-0016779-T01-IM6" "P-0016781-T01-IM6" "P-0018599-T01-IM6"
 [57] "P-0018814-T01-IM6" "P-0018903-T01-IM6" "MSK_LX13"          "MSK_LX138"         "MSK_LX148B"        "MSK_LX151"         "MSK_LX154"        
 [64] "MSK_LX174"         "MSK_LX175"         "MSK_LX181"         "MSK_LX189"         "MSK_LX19"          "MSK_LX206"         "MSK_LX206B"       
 [71] "MSK_LX210"         "MSK_LX212"         "MSK_LX213"         "MSK_LX216"         "MSK_LX224"         "MSK_LX229"         "MSK_LX234"        
 [78] "MSK_LX239"         "MSK_LX242"         "MSK_LX25"          "MSK_LX263"         "MSK_LX267B"        "MSK_LX27"          "MSK_LX276"        
 [85] "MSK_LX282"         "MSK_LX285"         "MSK_LX29"          "MSK_LX292"         "MSK_LX293B"        "MSK_LX296"         "MSK_LX298"        
 [92] "MSK_LX300"         "MSK_LX304"         "MSK_LX304B"        "MSK_LX307"         "MSK_LX317"         "MSK_LX318"         "MSK_LX323"        
 [99] "MSK_LX326"         "MSK_LX337"         "MSK_LX349"         "MSK_LX366"         "MSK_LX369"         "MSK_LX370"         "MSK_LX374"        
[106] "MSK_LX376"         "MSK_LX382B"        "MSK_LX393B"        "MSK_LX40"          "MSK_LX408"         "MSK_LX413"         "MSK_LX424"        
[113] "MSK_LX424B"        "MSK_LX462"         "MSK_LX465"         "MSK_LX479"         "MSK_LX482"         "MSK_LX489"         "MSK_LX491"        
[120] "MSK_LX512"         "MSK_LX513"         "MSK_LX515"         "MSK_LX524"         "MSK_LX535"         "MSK_LX537"         "MSK_LX55"         
[127] "MSK_LX585"         "MSK_LX59"          "MSK_LX6"           "MSK_LX631"         "MSK_LX632"         "MSK_LX640"         "MSK_LX651"        
[134] "MSK_LX666"         "MSK_LX68"          "MSK_LX87"          "MSK_LX95"          "MSK_LX96" 

Any ideas?

Thanks!!

LiNk-NY commented 3 years ago

Thanks JJ! I will have a look at this soon. Sorry for the delay. Best, Marcel

LiNk-NY commented 3 years ago

Hi Matthew, @mattdmem

mutationData is a bit of an advanced function to use and is at a lower level than cBioPortalData().

I would recommend sticking to the standard API, i.e., using the cBioPortalData() function:

> cBioPortalData(cbio, "lung_msk_pdx", genePanelId = "IMPACT341",
    molecularProfileIds = "lung_msk_pdx_mutations", sampleListId = "lung_msk_pdx_all")
harmonizing input:
  removing 2 colData rownames not in sampleMap 'primary'
A MultiAssayExperiment object of 1 listed
 experiment with a user-defined name and respective class.
 Containing an ExperimentList class object of length 1:
 [1] lung_msk_pdx_mutations: RangedSummarizedExperiment with 807 rows and 134 columns
Functionality:
 experiments() - obtain the ExperimentList instance
 colData() - the primary/phenotype DataFrame
 sampleMap() - the sample coordination DataFrame
 `$`, `[`, `[[` - extract colData columns, subset, or experiment
 *Format() - convert into a long or wide DataFrame
 assays() - convert ExperimentList to a SimpleList of matrices
 exportClass() - save all data to files

Currently, in the release version of cBioPortalData the function only accepts gene panel identifiers genePanelId. See genePanels(cbio).

The development version of the package in Bioconductor (3.13; soon to be released) will support gene inputs.

Best regards, Marcel