if (interactive()) {
# First, we use magmaRset to create an object which will tell other magmaR
# functions our authentication token (as well as some other optional bits).
# When run in this way, it will ask you to give your token.
magma <- magmaRset()
### To obtain the 'group' attribute, from the subject-model, that are
# associated with records of the rna_seq-model:
# "Raw" output of query:
query_list <- query(
target = magma,
projectName = "example",
queryTerms =
list('rna_seq',
'::all',
'biospecimen',
'subject',
'group'))
print(query_list)
# Or instead re-formatted to a dataframe, which may be easier for
# downstream applications in R:
query_df <- query(
target = magma,
projectName = "example",
queryTerms =
list('rna_seq',
'::all',
'biospecimen',
'subject',
'group'),
format = 'df')
print(query_df)
}
Run the code above in your browser using DataLab