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:

      HES4-NM_021170-T00001  1392
      ISG15-NM_005101-T00002	46
      SLC2A5-NM_003039-T00003	14
      H6PD-NM_004285-T00004	30
      PIK3CD-NM_005026-T00005	200
      MTOR-NM_004958-T00006	156
      FBXO6-NM_018438-T00007	10
      MTHFR-NM_005957-T00008	154
      FHAD1-NM_052929-T00009	10
      PADI2-NM_007365-T00010	12

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.

  1. Go to the Projects > your_project > Base > Tables and enable Base by clicking on the Enable button.

  1. Select Add Table > New Table.

  2. Create your table

    1. To create your table from scratch, select Empty Table from the Create table from dropdown.

    2. Name your table FeatureCounts

    3. Uncheck the box next to Include reference, to exclude reference data from your table.

    4. Check the box next to Edit as text. This will reveal a text box that can be used to create your schema.

    5. Copy the schema text below and paste it in into the text box to create your schema.

    {
      "Fields": [
        {
          "NAME_PATTERN": "[a-zA-Z][a-zA-Z0-9_]*",
          "Name": "TranscriptID",
          "Type": "STRING",
          "Mode": "REQUIRED",
          "Description": null,
          "DataResolver": null,
          "SubBluebaseFields": []
        },
        {
          "NAME_PATTERN": "[a-zA-Z][a-zA-Z0-9_]*",
          "Name": "ExpressionCount",
          "Type": "INTEGER",
          "Mode": "REQUIRED",
          "Description": null,
          "DataResolver": null,
          "SubBluebaseFields": []
        }
      ]
    }
  3. Click the Save button

Upload data to load into your table

  1. Upload sampleX.final.count.tsv file with the final count.

    1. Select Data tab (1) from the left menu.

    2. 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

    3. Refresh the screen (3)

    4. 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.

  1. Go to Projects > your_project > Base > Schedule and click the + Add New button.

  1. Select the option to load the contents from files into a table.

  1. Create your schedule.

    1. Name your schedule LoadFeatureCounts

    2. Choose Project as the source of data for your table.

    3. 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.

    4. Specify your table as the one to load data into, by selecting your table (FeatureCounts) from the dropdown under Target Base Table.

    5. Under Write preference, select Append to table. New data will be appended to your table, rather than overwriting existing data in your table.

    6. 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

    7. Click the Save button

  1. 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.

    1. Check the status of your job on your Projects > your_project > Activity page.

    2. Click the BASE JOBS tab to view the status of scheduled Base jobs.

    3. Click BASE ACTIVITY to view Base activity.

  1. Check the data in the table.

    1. Go back to your Projects > your_project > Base > Tables page.

    2. Double-click your table to view its details.

    3. You will land on the SCHEMA DEFINITION page.

    4. Click the PREVIEW tab to view the records that were loaded into your table.

    5. 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.

  1. Go to your Projects > your_project > Base > Query page.

SELECT TranscriptID,ExpressionCount FROM FeatureCounts WHERE ExpressionCount > 100;
  1. Paste the above query into the NEW QUERY text box

  2. Click the Run Query button to run your query

  3. View your query results.

  4. 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

  1. Name: Name of the exported file

  2. 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.

  1. 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