### Execute start script Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/hubs-for-institutions-collaborations-labs-and-larger-projects.md Runs the configured start script to launch the hub. ```bash ./start_script ``` -------------------------------- ### Install xenaPython Source: https://ucsc-xena.gitbook.io/project/overview-of-features/accessing-data-through-python.md Commands to install or upgrade the xenaPython library from the GitHub repository. ```bash pip install 'git+https://github.com/ucscXena/xenaPython' pip install --upgrade 'git+https://github.com/ucscXena/xenaPython' ``` -------------------------------- ### Query documentation via HTTP GET Source: https://ucsc-xena.gitbook.io/project/llms.txt Perform a GET request to the documentation index with specific question and goal parameters. ```http GET https://ucsc-xena.gitbook.io/project/master.md?ask=&goal= ``` -------------------------------- ### Create Xena Hub start script Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/hubs-for-institutions-collaborations-labs-and-larger-projects.md Defines environment variables and executes the Xena server jar in the background. ```bash #!/bin/bash PORT=7222 LOGFILE=xena/xena7222.log DOCROOT=xena/files DB=xena/myHub java -jar server.jar -r ${DOCROOT} -d ${DB} --no-gui -p ${PORT} -H 0.0.0.0 --logfile ${LOGFILE} --certfile ${CERTFILE} --keyfile ${KEYFILE}> log 2>&1 & disown ``` -------------------------------- ### Probemap File Format Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/loading-data-from-the-command-line.md Example of a tab-delimited probemap file structure. ```text #id gene chrom chromStart chromEnd strand id_1 AADACL3 chr1 12776118 12776347 + ``` -------------------------------- ### Retrieve Dataset Samples and Probe Values Source: https://ucsc-xena.gitbook.io/project/overview-of-features/accessing-data-through-python.md Example demonstrating how to fetch samples from a dataset and retrieve specific probe values using the xenaPython API. ```python import xenaPython as xena hub = "https://toil.xenahubs.net" dataset = "tcga_RSEM_gene_tpm" samples = xena.dataset_samples (hub, dataset, None) samples = xena.dataset_samples (hub, dataset, 10) samples = ["TCGA-02-0047-01","TCGA-02-0055-01","TCGA-02-2483-01"] probes = ['ENSG00000282740.1', 'ENSG00000000005.5'] [position, [ENSG00000282740_1, ENSG00000000005_5]] = xena.dataset_probe_values (hub, dataset, samples, probes) ENSG00000282740_1 [-9.9658, -2.8262, -9.9658] ``` -------------------------------- ### Data File Metadata with Probemap Reference Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/loading-data-from-the-command-line.md Example metadata file referencing a specific probemap. ```json {"type":"genomicMatrix", "cohort":"TCGA Breast Cancer", ":probeMap":"/unc_v2_exon_hg19_probe_TCGA"} ``` -------------------------------- ### Set script permissions Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/hubs-for-institutions-collaborations-labs-and-larger-projects.md Grants execute permissions to the start script. ```bash chmod u+x start_script ``` -------------------------------- ### Generating Dynamic Xena Links Source: https://ucsc-xena.gitbook.io/project/technical-documentation/deep-linking-into-xena.md A complete HTML/JavaScript example showing how to programmatically set href attributes for multiple links with different sample highlighting and filtering configurations. ```html Sample highlight Example 1: highlight samples of specific sample IDs, such as THR30_0820_S01 or THR30_0861_S01

Sample highlight Example 2: highlight samples matching an arbitary criteria, such as TARGET samples

Sample filtering Example 1: specify (filter to) what samples to show in a view using a predicate, such as TARGET samples

Sample filtering Example 2: specify samples in a view using a predicate that includes a boolean term, such as TARGET and TCGA samples (use boolean OR)

Sample filtering and highlight at the same time: specify samples in a view using a predicate (e.g. just show TARGET samples), as well as highlight specific samples by IDs, such as TARGET-40-0A4I6O-01A-01R

Sample filtering using data in a hidden filter column: useful when you want to filter samples using data not displayed on the screen. You can use HIDDEN FILTER COLUMN. For exmaple, filter the samples to < 5 years old, but you don't want to actually display the age column on the screen. ``` -------------------------------- ### GET /project/master.md Source: https://ucsc-xena.gitbook.io/project/llms.txt Performs a natural language query against the documentation index to retrieve an answer and relevant sources. ```APIDOC ## GET /project/master.md ### Description Perform an HTTP GET request on the documentation index with the `ask` parameter, and the optional `goal` parameter to retrieve a direct answer and relevant excerpts from the documentation. ### Method GET ### Endpoint https://ucsc-xena.gitbook.io/project/master.md ### Parameters #### Query Parameters - **ask** (string) - Required - The immediate question to ask, written in natural language. - **goal** (string) - Optional - Describes the broader end goal to help tailor the answer. ``` -------------------------------- ### GET /heatmap/ Source: https://ucsc-xena.gitbook.io/project/technical-documentation/deep-linking-into-xena.md Constructs a URL to open the UCSC Xena heatmap browser with specific data columns and heatmap configuration parameters. ```APIDOC ## GET /heatmap/ ### Description Opens the UCSC Xena heatmap browser with a pre-defined set of columns and heatmap settings such as sample highlights or filters. ### Endpoint https://xenabrowser.net/heatmap/ ### Query Parameters - **columns** (string) - Required - A JSON-encoded array of column objects defining the data sources (host, name, fields) to display. - **heatmap** (string) - Optional - A JSON-encoded object defining heatmap settings like `showWelcome`, `searchSampleList`, `search`, or `filter`. - **filterColumns** (string) - Optional - A JSON-encoded array of column objects used for hidden filtering criteria. ### Request Example https://xenabrowser.net/heatmap/?columns=%5B%7B%22host%22%3A%22https%3A%2F%2Fxena.treehouse.gi.ucsc.edu%22%2C%22name%22%3A%22clinical_TumorCompendium_v11_PolyA_2020-04-09.tsv%22%2C%22fields%22%3A%22site_id%22%7D%5D&heatmap=%7B%22searchSampleList%22%3A%5B%22THR30_0820_S01%22%5D%7D ``` -------------------------------- ### Configure colNormalization in genomicMatrix metadata Source: https://ucsc-xena.gitbook.io/project/technical-documentation/metadata-specification-1.md Example configuration object for a genomicMatrix dataset using the colNormalization parameter. ```javascript { "cohort": "TCGA Acute Myeloid Leukemia (LAML)", "dataSubType": "gene expression RNAseq", "label": "IlluminaHiSeq", "colNormalization": true, "type": "genomicMatrix", "unit": "log2(norm_count+1)" } ``` -------------------------------- ### Delete data via command line Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/hubs-for-institutions-collaborations-labs-and-larger-projects.md Remove data files from the hub using the -x option. Note that the example for a custom port uses the -l flag in the source text. ```bash java -jar server.jar -x /path/to/root/file.tsv ``` ```bash java -jar server.jar -p ${PORT} -l /path/to/root/file.tsv ``` -------------------------------- ### Display Help Information Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/loading-data-from-the-command-line.md Access the command-line help menu to view available options. ```bash java -jar cavm-0.xx.0-standalone.jar -h ``` -------------------------------- ### Deep Linking with Sample Highlighting and Filtering Source: https://ucsc-xena.gitbook.io/project/technical-documentation/deep-linking-into-xena.md Demonstrates how to construct dynamic URLs for the Xena browser using JavaScript to encode column configurations and heatmap parameters for sample highlighting and filtering. ```html Sample highlight example 1: highlight samples of specific sample IDs, such as TCGA-C8-A131-01 or TCGA-BH-A0DL-01
Sample highlight example 2: highlight samples matching arbitary criteria, such as samples in Column B with values > 10 ``` -------------------------------- ### Configure Xena Hub database path Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/hubs-for-institutions-collaborations-labs-and-larger-projects.md Sets the location for the database file, defaulting to ${HOME}/xena/database. ```bash --database -d default to ${HOME}/xena/database ``` -------------------------------- ### Configure Xena Hub log file path Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/hubs-for-institutions-collaborations-labs-and-larger-projects.md Sets the location for the log file, defaulting to ${HOME}/xena/xena.log. ```bash --logfile default to ${HOME}/xena/xena.log ``` -------------------------------- ### Add a cohort launch button Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/hubs-for-institutions-collaborations-labs-and-larger-projects.md Use the cohortButton class to create a button that links to a specific bookmark or the visualization wizard. ```html ``` -------------------------------- ### Load data via command line Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/hubs-for-institutions-collaborations-labs-and-larger-projects.md Load data files into the hub using the -l option. Specify the port with -p if the hub is not using the default 7222 port. ```bash java -jar server.jar -l /path/to/root/file.tsv ``` ```bash java -jar server.jar -p ${PORT} -l /path/to/root/file.tsv ``` -------------------------------- ### Configure Xena Hub data root directory Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/hubs-for-institutions-collaborations-labs-and-larger-projects.md Sets the root directory for served data files, defaulting to ${HOME}/xena/files/. ```bash --root -r default to ${HOME}/xena/files/ ``` -------------------------------- ### Load Data Files via Command Line Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/loading-data-from-the-command-line.md Use the -l flag to load files from the specified directory. JSON metadata files are detected and loaded automatically. ```bash java -jar cavm-0.xx.0-standalone.jar -l ~/xena/files/* ``` ```bash java -jar cavm-0.xx.0-standalone.jar -l ~/xena/files/file1.tsv ``` -------------------------------- ### Create symbolic link for Xena server Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/hubs-for-institutions-collaborations-labs-and-larger-projects.md Create a symbolic link to the standalone jar file to simplify command-line execution. ```bash ln -sf cavm-x.xx.x-standalone.jar server.jar ``` -------------------------------- ### Access Library Help Source: https://ucsc-xena.gitbook.io/project/overview-of-features/accessing-data-through-python.md Use the built-in Python help function to inspect the xenaPython library documentation. ```python import xenaPython help(xenaPython) ``` -------------------------------- ### Download TOIL Manifest Source: https://ucsc-xena.gitbook.io/project/faq/advanced-data-and-datasets.md Use this command to download the TCGA manifest file from the S3 bucket. ```bash aws s3 cp s3://cgl-rnaseq-recompute-toil/tcga-manifest . --request-pay ``` -------------------------------- ### List Probemaps via Python Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/loading-data-from-the-command-line.md Retrieve available probemap files using the xenaPython library. ```python host =“https://reference.xenahubs.net” xenaPython.probemap_list(host) ``` -------------------------------- ### Import xenaPython Source: https://ucsc-xena.gitbook.io/project/overview-of-features/accessing-data-through-python.md Basic import statement for the xenaPython library. ```python import xenaPython as xena ``` -------------------------------- ### Add a Launch Xena Button to Landing Page Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/hubs-for-institutions-collaborations-labs-and-larger-projects.md Include this button element in your hub's info.mdown file to trigger the Xena visualization wizard for a specific cohort. ```html ``` -------------------------------- ### Link server jar Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/hubs-for-institutions-collaborations-labs-and-larger-projects.md Creates a symbolic link to the standalone jar file. ```bash ln -sf cavm-0.xx.0-standalone.jar server.jar ``` -------------------------------- ### Constructing a Xena Deep Link URL Source: https://ucsc-xena.gitbook.io/project/technical-documentation/deep-linking-into-xena.md Demonstrates how to serialize a heatmap configuration object and append it to a Xena URL as an encoded query parameter. ```javascript var heatmap_paramter = JSON.stringify({ showWelcome: false, search: "B:=TARGET" }); var url = page + ‘?columns=’ + encodeURIComponent(columns_parameter) + \ ‘?heatmap=’ + encodeURIComponent(heatmap_paramter); ``` -------------------------------- ### Constructing Xena Deep Links Source: https://ucsc-xena.gitbook.io/project/technical-documentation/deep-linking-into-xena.md Demonstrates the basic URL structure for linking to the Xena heatmap browser with encoded column and heatmap parameters. ```javascript var page = ‘https://xenabrowser.net/heatmap/’; var url = page + ‘?columns=’ + encodeURIComponent(columns_parameter) + \ ‘&heatmap=’ + encodeURIComponent(heatmap_parameter); ``` -------------------------------- ### Configure Apache as a Reverse Proxy for Xena Hub Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/hubs-for-institutions-collaborations-labs-and-larger-projects.md Use this VirtualHost configuration in Apache to serve a Xena hub over HTTPS. Ensure the certificate and key files are correctly referenced. ```apache ServerName tcga.xenahubs.net SSLEngine on SSLProxyEngine On SSLProxyVerify none SSLProxyCheckPeerCN off SSLProxyCheckPeerName off SSLProxyCheckPeerExpire off SSLCertificateFile YOURCERTIFICATE SSLCertificateKeyFile YOURKEY # setup the proxy ProxyPreserveHost On ProxyPass / https://localhost:9000/ ProxyPassReverse / https://localhost:9001/ ``` -------------------------------- ### Generate Xena Deep Links with JavaScript Source: https://ucsc-xena.gitbook.io/project/technical-documentation/deep-linking-into-xena.md This script demonstrates how to construct URLs for the Xena browser by serializing column configurations into JSON and encoding them as URL parameters. ```html Example 1 One data column (with two subcolumns) display

Example 2 Display in chart mode

Example 3 Three data column display, one clinical data column, two genomic data columns

Example 4 Specify column width, top label, and bottom label on Column C

Example 5 Reverse sort on Column B

Example 6 Display gene average in Column C

Example 7 Display introns in Column C; Hide welcome banner ``` -------------------------------- ### Establish SSH tunnel for hub access Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/hubs-for-institutions-collaborations-labs-and-larger-projects.md Use SSH tunneling to access a remote hub when a security certificate is not configured. The first command shows standard login, the second establishes the tunnel. ```bash ssh -i "xena.pem" ec2-user@ec2-11-111-11-111.compute-1.amazonaws.com ``` ```bash ssh -i "xena.pem" -L 8000:localhost:7222 ec2-user@ec2-11-111-11-111.compute-1.amazonaws.com ``` -------------------------------- ### Download Single TOIL File Source: https://ucsc-xena.gitbook.io/project/faq/advanced-data-and-datasets.md Use this command to download a specific tar.gz file from the TCGA dataset. ```bash aws s3 cp s3://cgl-rnaseq-recompute-toil/tcga/0106d51d-d581-4be7-91f3-b2f0c84468d1.tar.gz . --request-pay ``` -------------------------------- ### Constructing the columns parameter Source: https://ucsc-xena.gitbook.io/project/technical-documentation/deep-linking-into-xena.md Create a JSON-encoded string representing the columns to display and append it to the Xena page URL. ```javascript var column = {name: dataset1, host: hub1, fields: 'foo bar'}; var columns_parameter = JSON.stringify([column]); var url = page + ‘?columns=’ + encodeURIComponent(columns_parameter); ``` -------------------------------- ### Define a spatial map with microscopy images Source: https://ucsc-xena.gitbook.io/project/technical-documentation/metadata-specification-1.md Configure a spatial map by providing unit, spot diameter, and image path details. ```json { "type": "clinicalMatrix", "cohort": "name of the cohort", "label": "display label of the file", "dataSubType": "the section the dataset is displayed under in Xena Datapages, describe what data is in the life", "map": [ { "label": "display label of the map", "dataSubType": "spatial", "dimension": ["X","Y"], "unit": "pixel", "spot_diameter": 178.37655999999998, "micrometer_per_unit": 0.3083364764966877, "image": [ { "label": "display label of the image", "path": "image file path", "size": [24240, 24240], "offset": [0,0], "image_scalef": 1, }, { "label": "display label of the image", "path": "image file path", "size": [2000, 2000], "offset": [0,0], "image_scalef": 0.08250825 }] }] } ``` -------------------------------- ### Metadata with Cohort Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/loading-data-from-the-command-line.md JSON metadata file including both the data type and the specific cohort name. ```json {"type":"mutationVector", "cohort":"TCGA Breast Cancer"} ``` -------------------------------- ### Probemap Metadata File Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/loading-data-from-the-command-line.md Required metadata file for a probemap, placed in the same directory as the probemap file. ```json { “type”:“probeMap”, “assembly”:“hg19"} ``` -------------------------------- ### Delete Data Files via Command Line Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/loading-data-from-the-command-line.md Use the -x flag to remove specific data files from the system. ```bash java -jar cavm-0.xx.0-standalone.jar -x ~/xena/files/file1.tsv ``` ```bash java -jar cavm-0.xx.0-standalone.jar -x ~/xena/files/file1.tsv ~/xena/files/file2.tsv ``` -------------------------------- ### Metadata Type Definition Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/loading-data-from-the-command-line.md Minimal JSON metadata file specifying only the data type. ```json {"type":"mutationVector"} ``` -------------------------------- ### Define a spatial map with microscopy and transcript data Source: https://ucsc-xena.gitbook.io/project/technical-documentation/metadata-specification-1.md Include transcript data paths and dimensions alongside spatial image information. ```json { "type": "clinicalMatrix", "dataSubtype": "phenotype", "label": "display label of the file", "cohort": "name of the cohort", "bioentity":"cell", "map":[ { "label":"mIF H&E coregistered", "type":"spatial", "dimension":["CenterX", "CenterY"], "unit":"pixel", "micrometer_per_unit":0.120280945, "spot_diameter":84, "image":[ { "label":"morphology 2D image, coregistered H&E", "path":"/CosMx/img", "offset": [0, 0], "image_scalef": 1 } ], "transcript":[ { "label":"CosMx transcript data", "path":"transcripts.tsv", "dimension":["x","y"] } ] } ] } ``` -------------------------------- ### Metadata with Reference Genome Source: https://ucsc-xena.gitbook.io/project/local-xena-hub/loading-data-from-the-command-line.md JSON metadata file for mutation or segmented data requiring an assembly reference. ```json {"type":"mutationVector", "cohort":"TCGA Breast Cancer", "assembly":"hg19"} ``` -------------------------------- ### Define clinical feature attributes Source: https://ucsc-xena.gitbook.io/project/technical-documentation/metadata-specification-1.md Create a tab-delimited file to define feature attributes such as valueType, state, and stateOrder. ```text feature attribute value alcohol_history valueType category alcohol_history state no alcohol_history state yes alcohol_history_intensity stateOrder "no","yes" ``` -------------------------------- ### heatmap parameter Source: https://ucsc-xena.gitbook.io/project/technical-documentation/deep-linking-into-xena.md The heatmap parameter is a JSON-encoded object that allows users to configure global display settings, search for samples, and filter data views via URL. ```APIDOC ## heatmap parameter ### Description The heatmap parameter is a JSON-encoded object specifying global display options for the Xena view. ### Properties - **mode** (string) - Set to 'chart' to display in chart mode. - **showWelcome** (boolean) - Toggle the welcome banner. - **searchSampleList** (array) - List of strings to highlight specific samples. - **search** (string) - Highlight samples based on a search expression. - **filter** (string) - Filter the view to samples matching the expression. ### Usage Example ```javascript var heatmap_paramter = JSON.stringify({ showWelcome: false, search: "B:=TARGET" }); var url = page + '?columns=' + encodeURIComponent(columns_parameter) + '?heatmap=' + encodeURIComponent(heatmap_paramter); ``` ``` -------------------------------- ### columns parameter Source: https://ucsc-xena.gitbook.io/project/technical-documentation/deep-linking-into-xena.md The columns parameter is a JSON-encoded array of objects used to define the data columns displayed in the Xena interface. ```APIDOC ## columns parameter ### Description The columns parameter is a JSON-encoded array of objects, specifying the columns to display in the Xena visualization. It is passed as a query parameter in the URL. ### Properties - **name** (string) - Required - The dataset ID. - **host** (string) - Required - The hub where the data resides. - **fields** (string) - Required - The fields to display (gene, probe, or chromosome position). ### Optional Properties - **width** (number) - Optional - Width in pixels. - **columnLabel** (string) - Optional - Text for top column label. - **fieldLabel** (string) - Optional - Text for bottom column label. - **geneAverage** (boolean) - Optional - Display the gene average instead of individual probes. - **normalize** (string) - Optional - Dynamic normalization: 'none', 'mean', 'log2', or 'normal2'. - **showIntrons** (boolean) - Optional - Show introns for mutation and segmented copy number columns. - **sortDirection** (string) - Optional - Set to 'reverse' to reverse sort the samples. - **sortVisible** (boolean) - Optional - Sort column on the zoomed region. ### Usage Example ```javascript var column = {name: 'dataset1', host: 'hub1', fields: 'foo bar'}; var columns_parameter = JSON.stringify([column]); var url = page + '?columns=' + encodeURIComponent(columns_parameter); ``` ``` -------------------------------- ### Reference clinical feature file in phenotype metadata Source: https://ucsc-xena.gitbook.io/project/technical-documentation/metadata-specification-1.md Add a clinicalFeature reference to the phenotype file's JSON metadata using the colon notation. ```json { "cohort": "TCGA Breast Cancer (BRCA)", "label": "label of you dataset", "type": "clinicalMatrix", ":clinialFeature": "clinicalFeature.txt" } ``` -------------------------------- ### Define a clinical matrix map without an image Source: https://ucsc-xena.gitbook.io/project/technical-documentation/metadata-specification-1.md Use this structure to define a basic clinical matrix map with specified dimensions. ```javascript { "type": "clinicalMatrix", "cohort": "name of the cohort", "label": "display label of the file", "dataSubType": "the section the dataset is displayed under in Xena Datapages, describe what data is in the life", "map": [ { "label": "display label of the map", "dataSubType": "embedding", "dimension": ["UMAP_1","UMAP_2","UMAP_3"] } ] } ``` -------------------------------- ### Define survival time units in metadata Source: https://ucsc-xena.gitbook.io/project/technical-documentation/metadata-specification-1.md Specify the units for survival endpoints like OS, DSS, DFI, and PFI within the clinicalMatrix metadata JSON. ```json { "cohort": "TCGA Breast Cancer (BRCA)", "dataSubType": "phenotype", "label": "Curated survival data", "type": "clinicalMatrix", "units": { "OS": "days", "DSS": "days", "DFI": "days", "PFI": "days" } } ``` -------------------------------- ### filterColumns parameter Source: https://ucsc-xena.gitbook.io/project/technical-documentation/deep-linking-into-xena.md The filterColumns parameter allows users to specify columns that are used for sample filtering without being displayed in the visualization. ```APIDOC ## filterColumns parameter ### Description This parameter defines columns that are available for sample filtering but are not displayed in the visual spreadsheet. These columns are referenced semantically after the columns defined in the 'columns' parameter. ``` -------------------------------- ### Define clinical feature metadata Source: https://ucsc-xena.gitbook.io/project/technical-documentation/metadata-specification-1.md Specify the type as clinicalFeature in the JSON file accompanying the clinical feature text file. ```json { "type":"clinicalFeature" } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.