Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

DanWebster/python-api

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Convert files to live data sets on Quilt

Optional prep (your steps may vary)

  1. Get a list of files you want to upload (see get-files-to-upload/)
  2. Download the files in the list (see curl-all.py)
  3. Unzip downloaded files (if needed)
cd downloads
gunzip *.gz

Upload to Quilt

  1. Use data_set.py to create individual data sets (see python data_set.py --help). You will need a Quilt username and password. Or use batch.py to create multiple data sets.
python data_set.py
  -e https://quiltdata.com
  -u USERNAME
  -n "ENCODE data"
  -d "#A549 #histone peak data #hg19"
  -f downloads/wgEncodeBroadHistoneNhaH3k36me3StdPk.broadPeak

File formats in this example

Resources

REST API

Action Endpoint Details
New table POST /tables/ See below
Delete table DELETE /tables/TABLE_ID/ See below
Update table meta-data PATCH /tables/TABLE_ID See below
Add column to table POST /tables/TABLE_ID/columns/ See below
Append row to table POST /data/TABLE_ID/rows/ See below
Get table rows GET /data/TABLE_ID/rows See below
Get table row GET /data/TABLE_ID/rows/ROW_ID See below
Genome intersect or subtract POST /genemath/ See below

Notes

  • For all REST calls, the content-type is application/JSON.
  • Description fields automatically linkify URLs and support <a>, <i>, <em>, <strong>, <b> tags

Tables

Create table

POST /tables/

Data format

{
  'name': string,
  'description': text `<a>, <i>, <em>, <strong>, <b>` tags supported; automatic linkification of URLs
  'columns': [
    {
      'name': string,
      'sqlname': optional string,
      'description': optional text,
      'type' : one of 'String', 'Number', 'Image', 'Text'
    },
    ...
  ]
}

Returns

Table data as JSON object, includes id field with the table's identifier.

Add column to table

POST /tables/TABLE_ID/columns/

Data format

{
   'name': string,
   'sqlname': optional string,
   'description': text,
   'type': one of 'String', 'Number', 'Image', or 'Text'
}

Returns

Column data as JSON object, includes id field with the column's identifier.

Delete table

DELETE /tables/TABLE_ID

Update table meta-data

PATCH /tables/TABLE_ID

Data format

{
   'name': string,
   'description': text
}

Table Data

  • Use column sqlname as keys in input data

Append row

POST /data/TABLE_ID/rows/

Data format

[
  {columnSqlname0: value0, columnSqlname1 : value1, ... },
  ...
]

Get rows

GET /data/TABLE_ID/rows

  • Rows are keyed by the Quilt Row ID field qrid
  • NOTE: Currently limited to the first 500 rows

Returns

Row data as JSON object, keyed by column.sqlname.

Get row

GET /data/TABLE_ID/rows/ROW_ID

Returns

Row data as JSON object, keyed by column.sqlname.

Quilt tables

Join

POST /quilts/

Data format

{
  'left_table_id': int,
  'right_table_id': int,
  'left_column_id': int,
  'right_column_id': int,
  'jointype': one of 'inner', 'leftOuter', 'firstMatch'
}

Returns

Quilt info as JSON object, includes sqlname field with the quilt's identifier.

Undo join

DELETE /quilts/QUILT_SQLNAME

Genome Math

  • Performs a gene math operation on two tables
  • Creates a new table with the result.
  • Columns are specified by column.id.

Intersect or subtract

POST /genemath/

Data Format

{
  'operator': one of 'Intersect' or 'Subtract',
  'left_chr': integer (column id),
  'left_start': integer (column id),
  'left_end':  integer (column id),
  'right_chr':  integer (column id),
  'right_start': integer (column id),
  'right_end':  integer (column id)
}

Returns

JSON object representing the result table.

About

Client API for uploading and manipulating data on Quilt

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.