modos.genomics.region#
Classes#
Genomic region consisting of a chromosome (aka reference) name |
Module Contents#
- class modos.genomics.region.Region[source]#
Genomic region consisting of a chromosome (aka reference) name and a 0-indexed half-open coordinate interval. Note that the end may not be specified, in which it will be set to math.inf.
- to_htsget_query()[source]#
Serializes the region into an htsget URL query.
Example
>>> Region(chrom='chr1', start=0, end=100).to_htsget_query() 'referenceName=chr1&start=0&end=100'
- classmethod from_htsget_query(url)[source]#
Instantiate from an htsget URL query
Example
>>> Region.from_htsget_query( ... "http://localhost/htsget/reads/ex/demo1?format=CRAM&referenceName=chr1&start=0" ... ) Region(chrom='chr1', start=0, end=inf)
- Parameters:
url (str)
- classmethod from_ucsc(ucsc)[source]#
Instantiate from a UCSC-formatted region string.
Example
>>> Region.from_ucsc('chr-1ba:10-320') Region(chrom='chr-1ba', start=10, end=320) >>> Region.from_ucsc('chr1:-320') Region(chrom='chr1', start=0, end=320) >>> Region.from_ucsc('chr1:10-') Region(chrom='chr1', start=10, end=inf) >>> Region.from_ucsc('chr1:10') Region(chrom='chr1', start=10, end=inf)
Note
For more information about the UCSC coordinate system, see: http://genomewiki.ucsc.edu/index.php/Coordinate_Transforms
- classmethod from_pysam(record)[source]#
- Parameters:
record (pysam.VariantRecord | pysam.AlignedSegment)
- Return type: