mg-rest-adjacency server

Methods

class rest.app.GetEndPoints[source]

Class to handle the http requests for returning information about the end points

get()[source]

GET list all end points

List of all of the end points for the current service.

Example

1
curl -X GET http://localhost:5001/mug/api/adjacency
class rest.app.GetDetails[source]

Class to handle the http requests for the size of the chromosome, the number of bins and available resolutions

get(*args, **kwargs)[source]

GET List details from the file

Call to list the available chromosomes and resolutions within a dataset

Parameters:
  • user_id (str) – User ID
  • file_id (str) – Identifier of the file to retrieve data from
Returns:

chromosomes : list

List of the available chromosomes and their length

resolutions : list

List of the resolutions for the dataset

Return type:

dict

Examples

1
2
3
curl -X GET
    -H "Authorization: Bearer teststring"
    http://localhost:5001/mug/api/adjacency/details?file_id=test_file
class rest.app.GetInteractions[source]

Class to handle the http requests for retrieving ranges of interactions from a given dataset

get(*args, **kwargs)[source]

GET List details from the file

Call to list the available chromosomes and resolutions within a dataset

Parameters:
  • user_id (str) – User ID
  • file_id (str) – Identifier of the file to retrieve data from
  • chrom (str) – Chromosome identifier (1, 2, 3, chr1, chr2, chr3, I, II, III, etc) for the chromosome of interest
  • start (int) – Start position for a selected region
  • end (int) – End position for a selected region
  • res (int) – Resolution of the dataset requested
  • limit_chr (str) – Limit the interactions returned to those between chr and
  • limit_start (int) – Start position for a specific interacting chromosomal region. This is to be used in conjunction with the limit_chr parameter
  • limit_end (int) – End position for a specific interacting chromosomal region This is to be used in conjunction with the limit_chr parameter
Returns:

chr : str

Chromosome ID

resolutions : list

List of the resolutions for the dataset

start : int

Start position for a selected region

end : int

End position for a selected region

res : int

Resolution of the dataset requested

limit_chr : str

Limit the interactions returned to those between chr and

limit_start : int

Start position for a specific interacting chromosomal region. This is to be used in conjunction with the limit_chr parameter

limit_end : int

End position for a specific interacting chromosomal region This is to be used in conjunction with the limit_chr parameter

values : list

List of values for each window of the region of a given resolution

log : list

List of errors that have occurred

Return type:

dict

Examples

1
2
3
curl -X GET
    -H "Authorization: Bearer teststring"
    http://localhost:5001/mug/api/adjacency/getInteractions?file_id=test_file&chr=<chr_id>&res=<res>

Notes

By default this is in JSON format. If the output is required in a tab separated format then the following needs to be specified in the header of the request:

1
2
3
4
curl -X GET
    -H "Accept: application/tsv"
    -H "Authorization: Bearer teststring"
    http://localhost:5001/mug/api/adjacency/getInteractions?file_id=test_file&chr=<chr_id>&res=<res>

This will return the values from the JSON format in the following order

  1. Chromosome 1
  2. Starting position for chromosome 1
  3. Chromosome 2
  4. Starting position for chromosome 2
  5. Value
class rest.app.GetValue[source]

Class to handle the http requests for retrieving a single value from a given dataset

get(*args, **kwargs)[source]

GET single value

Call to get a single value for a spcific bin x bin location

Parameters:
  • user_id (str) – User ID
  • file_id (str) – Identifier of the file to retrieve data from
  • pos_x (int) – Location of the window on the first region of interest
  • pos_y (int) – Location of the window on the second region of interest
  • res (int) – Resolution of the dataset requested
Returns:

chrA : str

Chromosome ID 1

chrB : str

Chromosome ID 2

resolution : int

Resolution of the bin of interest

pos_x : int

Location of the window on the first region of interest

pos_y : int

Location of the window on the second region of interest is to be used in conjunction with the limit_chr parameter

values : list

List of values for each window of the region of a given resolution

Return type:

dict

Examples

1
2
3
curl -X GET
    -H "Authorization: Bearer teststring"
    http://localhost:5001/mug/api/adjacency/getValue?file_id=test_file&chr=<chr_id>&res=<res>
class rest.app.Ping[source]

Class to handle the http requests to ping a service

static get()[source]

GET Status

List the current status of the service along with the relevant information about the version.

Examples

1
curl -X GET http://localhost:5001/mug/api/adjacency/ping