Base Basics
Base is a genomics data aggregation and knowledge management solution suite. It is a secure and scalable integrated genomics data analysis solution which provides information management and knowledge mining. Refer to the Base documentation for more details.
This tutorial provides an exmple for exercising the basic operations used with the Base, including how to create a table, load the table with data, and query the table.
Prerequisites
An ICA project with access to Base
If you don't already have a project, please follow the instructions in the Project documentation to create a project.
File to import
A tab delimited gene expression file (sampleX.final.count.tsv). Example format:
Create table
Tables are components of databases that store data in a 2-dimensional format of columns and rows. Each row represents a new data record in the table; each column represents a field in the record. On ICA, you can use Base to create custom tables to fit your data. A schema definition defines the fields in a table. On ICA you can create a schema definition from scratch, or from a template. In this activity, you will create a table for RNAseq count data, by creating a schema definition from scratch.
Go to the Projects > your_project > Base > Tables and enable Base by clicking on the Enable button.
Select Add Table > New Table.
Create your table
To create your table from scratch, select Empty Table from the Create table from dropdown.
Name your table FeatureCounts
Uncheck the box next to Include reference, to exclude reference data from your table.
Check the box next to Edit as text. This will reveal a text box that can be used to create your schema.
Copy the schema text below and paste it in into the text box to create your schema.
Click the Save button
Upload data to load into your table
Upload sampleX.final.count.tsv file with the final count.
Select Data tab (1) from the left menu.
Click on the grey box (2) to choose the file to upload or drag and drop the sampleX.final.count.tsv into the grey box
Refresh the screen (3)
The uploaded file (4) will appear on the data page after successful upload.
Create a schedule to load data into your table
Data can be loaded into tables manually or automatically. To load data automatically, you can set up a schedule. The schedule specifies which files’ data should be automatically loaded into a table, when those files are uploaded to ICA or created by an analyses on ICA. Active schedules will check for new files every 24 hours.
In this exercise, you will create a schedule to automatically load RNA transcript counts from .final.count.tsv files into the table you created above.
Go to Projects > your_project > Base > Schedule and click the + Add New button.
Select the option to load the contents from files into a table.
Create your schedule.
Name your schedule LoadFeatureCounts
Choose Project as the source of data for your table.
To specify that data from .final.count.tsv files should be loaded into your table, enter .final.count.tsv in the Search for a part of a specific ‘Orignal Name’ or Tag text box.
Specify your table as the one to load data into, by selecting your table (FeatureCounts) from the dropdown under Target Base Table.
Under Write preference, select Append to table. New data will be appended to your table, rather than overwriting existing data in your table.
The format of the .final.count.tsv files that will be loaded into your table are TSV/tab-delimited, and do not contain a header row. For the Data format, Delimiter, and Header rows to skip fields, use these values:
Data format: TSV
Delimiter: Tab
Header rows to skip: 0
Click the Save button
Highlight your schedule. Click the Run button to run your schedule now.
It will take a short time to prepare and load data into your table.
Check the status of your job on your Projects > your_project > Activity page.
Click the BASE JOBS tab to view the status of scheduled Base jobs.
Click BASE ACTIVITY to view Base activity.
Check the data in the table.
Go back to your Projects > your_project > Base > Tables page.
Double-click your table to view its details.
You will land on the SCHEMA DEFINITION page.
Click the PREVIEW tab to view the records that were loaded into your table.
Click the DATA tab, to view a list of the files whose data has been loaded into your table.
Query a table
To request data or information from a Base table, you can run an SQL query. You can create and run new queries or saved queries.
In this activity, we will create and run a new SQL query to find out how many records (RNA transcripts) in your table have counts greater than 100.
Go to your Projects > your_project > Base > Query page.
Paste the above query into the NEW QUERY text box
Click the Run Query button to run your query
View your query results.
Save your query for future use by clicking the Save Query button. You will be asked to "Name" the query before clicking on the "Create" button.
Export table data
Find the table you want to export on the "Tables" page under BASE. Go to the table details page by clicking twice on the table you want to export.
Click on the Export As File icon and complete the required fields
Name: Name of the exported file
Data Format: A table can be exported in CSV and JSON format. The exported files can be compressed using GZIP, BZ2, DEFLATE or RAW_DEFLATE.
CSV Format: In addition to Comma, the file can be Tab, Pipe or Custom character delimited.
JSON Format: Selecting JSON format exports the table in a text file containing a JSON object for each entry in the table. This is the standard snowflake behavior.
Export to single/multiple files: This option allows the export of a table as a single (large) file or multiple (smaller) files. If "Export to multiple files" is selected, a user can provide "Maximum file size (in bytes)" for exported files. The default value is 16,000,000 bytes but can be increased to accommodate larger files. The maximum file size supported is 5 GB.
Last updated