CDMI Utilities

This package contains useful methods for manipulating the data types in the KBase Central Data Model. Unlike API methods, these do not require actual access to a database instance.

Important Definitions

region string

A region string specifies a portion of a contig in the form of a string. It contains a contig ID followed by an underscore, the start location, the strand (+ or -), and the region length. Thus, NC17007_101+483 represents the 483-base-pair region beginning at the 101st base pair on the plus strand of contig NC17007, and kb|108762_436-101 represents the region of contig kb|108762 beginning at the 436th base pair and extending backward through the 336th base pair.

location_string

A location string represents multiple regions on a contig (and sometimes on multiple contigs). It is formed by joining the individual region strings together with commas. So, for example kb|108762_436+120,kb|108762_561+132 is a location string for two regions on the contig kb|108762 separated by a gap of 5 base pairs.

region

A region is a 4-tuple specifying a single portion of a contig. The elements of the tuple are (0) the contig ID, (1) the start location, (2) the strand (+ or -), and (3) the length. Thus, ['NC17007', 101, '+', 483] represents the 483-base-pair region beginning at the 101st base pair on the plus strand of contig NC17007, and ['kb|108762', 436, '-', 101] represents the region of contig kb|108762 beginning at the 436th base pair and extending backward through the 336th base pair.

location

A location is a reference to a list of regions and specifies one or more portions of one or more contigs. So, for example, [['kb|108762', 436, '+', 120], ['kb|108762', 561, '+', 132]] is a location for two regions on the contig kb|108762 separated by a gap of 5 base pairs.

Methods

location_string_to_location

my $location = location_string_to_location($location_string);

Convert a location string to a location.

location_string

A location string representing one or more regions in a contig.

RETURN

Returns the same location in the form of a reference to a list of regions, each of which is a 4-tuple.

region_string_to_region

my $region = region_string_to_region($region_string);

Convert a region string to a region.

region_string

A region string representing a single portion of a contig.

RETURN

Returns a the same region in the form of a 4-tuple.

location_to_location_string

my $location = location_to_location_string($location);

Convert a location to a location string.

location

A location in the form of a reference to a list of 4-tuples.

RETURN

Returns the same location information in the form of a location string.

region_to_region_string

my $region = region_to_region_string($region);

Convert a region to a region string.

region

A region in the form of a 4-tuple.

RETURN

Returns the same region in the form of a region string.