The fbget --examples option provides a wealth of usage ideas: # Every line of these examples can be cut and directly pasted to your
# UNIX-like command line. Comments will be ignored, while everything
# not beginning with the # comment character will be executed, as long
# as fbget is in your $PATH
# Get the RNASeq expression level of the POLE gene, for all TCGA samples
# (both tumors and normals, in RSEM form, saved to file)
fbget --outfile=fbget-test-pole.tsv mrnaseq pole
# Similar query, but constrained to just the DLBC disease cohort
fbget mrnaseq pole cohort=dlbc
# Now constrained to single patient, and showing case insensitivity
fbget mrnaseq pOlE baRcOdE=TCGA-RQ-A6JB
# What is the DLBC cohort, anyway?
fbget cohort dlbc
# DLBC Lymphoid Neoplasm Diffuse Large B-cell Lymphoma
# List all the disease cohorts offered by FireBrowse (note that aggregate
# cohorts like COADREAD,KIPAN,GBMLGG,STES are not available at the TCGA DCC)
fbget cohorts
# Display help (docstring) for the function which retrieves clinical data
fbget help clinical
# Calling functions with no arguments also displays help (docstring)
fbget clinical
# Now get some actual clinical data, but only for thyroid (THCA) cohort
fbget clinical tHcA
# Display the complete list of clinical data element names (CDEs)
fbget clinical_names
# List the functions may be called through fbget (-l does the same thing)
fbget --list
# Get the 10 most significantly mutated ovarian cancer genes (per MutSig2CV)
fbget smg OV rank=10
# Union of the names of parameters admitted by any FireBrowse function
fbget param_names
# Show the kinds of values that may be supplied via the cohort parameter
# (applies to any function which admits the cohort parameter)
fbget param_values cohort
# Ditto, for the barcode and clinical data element (CDE) names
fbget param_values barcode
fbget param_values fh_cde
# The documentation for param_values is helpful in its own right, too
fbget help param_values
# Levels of copy number alteration in TERT gene for 3 disease cohorts,
# as computed by GISTIC2, redirected to file
fbget cn_levels tert cohort=acc,KICH,LaMl,UCS > fbget-test-tert-cn.tsv
# Which genes had significant copy number deletion (per GISTIC2 q values)
# in BRCA & UCEC cohorts? (alternate method of saving to file, CLI option)
fbget --outfile=fbget-test-cn-del.tsv cn_genes_del cohort=BRCA,ucec
# Retrieve mature strand microRNASeq from UVM, as comma-separated values
fbget mirseq hsa-let-7b-5p cohort=uvm format=csv
# Repeat the same call to show that bogus parameters induce failure
fbget mirseq has-let-7b-5p cohort=uvm format=Dum_De_Dum_Dumb |
Each of these map very naturally to the low- and high-level wrappers; in addition, here are actual excerpts of code using the low-level wrappers and high-level wrappers. The fbget --list option shows the entire set of high level functions that may be called: barcode2type
centers
clinical
clinical_fh
clinical_names
clinical_names_fh
cn_genes_all
cn_genes_amp
cn_genes_del
cn_genes_focal
cn_levels
cohort
cohorts
counts
dates
featuretable
heartbeat
help
maf
mirseq
mrnaseq
mrnaseq_quartiles
param_names
param_values
patients
platforms
reports
samplecode2type
sampletype2code
sampletypes
smg
stddata
tssites |
Their documentation may be obtained by invoking with zero arguments (shown above) or explicitly invoking help: linux% fbget help smg Help on function smg in fbget:
fbget.smg = smg(*args, **kwargs)
High level wrapper for the FireBrowse Analyses.MutationSMG method.
By default it returns ALL pages of data, in TSV format.
This service provides a list of significantly mutated genes,
as scored by MutSig. It may be filtered by cohort, rank,
gene, tool and/or Q-value threshold, but at least one cohort
must be supplied.
For more details consult the interactive documentation at
http://firebrowse.org/api-docs/#!/Analyses
OR use help(param_values) to see the range of values accepted
for each parameter, the defaults for each (if any), and the
degrees of optionality/requiredness offered by the API.
Parameters:
format (str) Format of result.
cohort (str) Narrow search to one or more TCGA disease cohorts.
tool (str) Narrow search to include only data/results produced by the selected Firehose tool.
rank (int) Number of significant genes to return.
gene (str) Comma separated list of gene name(s).
q (float) Only return results with Q-value <= given threshold.
page (int) Which page (slice) of entire results set should be returned.
page_size (int) Number of records per page of results. Maximum is 2000.
sort_by (str) Which column in the results should be used for sorting paginated results? |
The fbget --help option shows additional options that may be applied at runtime: usage: fbget.py [-h] [-d] [-e] [-l] [-o OUTFILE] [-s SERVER] [-V] [-v] function [arg [arg ...]]
Python & UNIX CLI wrappers for the FireBrowse RESTful API
fbget simplifies use and extends the power of FireBrowse, by
providing: low- and high-level Python wrappers to its RESTful
API; an interface through which the high level functions may be
called directly from the UNIX command line, without writing any
Python code; and enabling the results of such to be immediately
streamed to UNIX tools for further processing or analysis. In
addition, both the fbget CLI tool and the high level wrappers
will by default retrieve all pages of data returned by the
FireBrowse RESTful API, in TSV form that is most commonly used
for bioinformatics analysis.
For more information visit http://firebrowse.org
positional arguments:
function name of the function to be called
arg arguments to pass to function
optional arguments:
-h, --help show this help message and exit
-d, --docs emit documentation for entire api
-e, --examples show usage examples
-l, --list list all callable functions
-o OUTFILE, --outfile OUTFILE
Specify output file (will be overwritten if already exists) [sys.stdout]
-s SERVER, --server SERVER
the server hosting the FireBrowse instance [firebrowse.org]
-V, --verbose Verbose: emit to stderr RESTful calls made, etc [False]
-v, --version show program's version number and exit
-x, --debug debugging: trace RESTful calls as they are issued |
|