All functions
|
AreOverlappingRegionKeys()
|
Check if two regionkeys are overlapping.
Return 1 if the regions overlap, 0 otherwise. |
AreOverlappingRegionRegionKey()
|
Check if a region and a regionkey are overlapping.
Return 1 if the regions overlap, 0 otherwise. |
AreOverlappingRegions()
|
Check if two regions are overlapping.
Return 1 if the regions overlap, 0 otherwise. |
AreOverlappingVariantKeyRegionKey()
|
Check if variantkey and regionkey are overlapping.
Return 1 if the regions overlap, 0 otherwise. |
CheckReference()
|
Check if the reference allele matches the reference genome data.
Return Positive number in case of success, negative in case of error:
* 0 the reference allele match the reference genome;
* 1 the reference allele is inconsistent with the genome reference (i.e. when contains nucleotide letters other than A, C, G and T);
* -1 the reference allele don't match the reference genome;
* -2 the reference allele is longer than the genome reference sequence. |
CloseVariantKey()
|
Unmap the memory-mapped files.
This should be the last function called in order to close any open memory-mapped file. |
CompareVariantKeyChrom()
|
Compares two VariantKeys by chromosome only.
Returns -1 if the first chromosome is smaller than the second, 0 if they are equal and 1 if the first is greater than the second. |
CompareVariantKeyChromPos()
|
Compares two VariantKeys by chromosome and position.
Return -1 if the first CHROM+POS is smaller than the second, 0 if they are equal and 1 if the first is greater than the second. |
DecodeChrom()
|
Decode the CHROM code. |
DecodeRefAlt()
|
Decode the 32 bit REF+ALT code if reversible (if it has 11 or less bases in total and only contains ACGT letters). |
DecodeRegionKey()
|
Decode a RegionKey code and returns the components as regionkey_t structure. |
DecodeRegionStrand()
|
Decode the strand direction code (0 > 0, 1 > +1, 2 > -1). |
DecodeStringID()
|
Decode the encoded string ID.
This function is the reverse of encode_string_id.
The string is always returned in uppercase mode. |
DecodeVariantKey()
|
Decode a VariantKey code and returns the components. |
EncodeChrom()
|
Returns chromosome encoding. |
EncodeRefAlt()
|
Returns reference+alternate encoding. |
EncodeRegionKey()
|
Returns a 64 bit regionkey |
EncodeRegionStrand()
|
Encode the strand direction (-1 > 2, 0 > 0, +1 > 1). |
EncodeStringID()
|
Encode maximum 10 characters of a string into a 64 bit unsigned integer.
This function can be used to convert generic string IDs to numeric IDs. |
EncodeStringNumID()
|
Encode a string composed by a character section followed by a separator character and a numerical section
into a 64 bit unsigned integer. For example: "ABCDE:0001234"
Encodes up to 5 characters in uppercase, a number up to 2^27, and up to 7 zero padding digits.
If the string is 10 character or less, then the EncodeStringID() is used. |
EncodeVariantKey()
|
Returns a 64 bit variant key based on pre-encoded CHROM, POS (0-base) and REF+ALT. |
ExtendRegionKey()
|
Extend a regionkey region by a fixed amount from the start and end position. |
ExtractRegionKeyChrom()
|
Extract the CHROM code from RegionKey. |
ExtractRegionKeyEndPos()
|
Extract the END POS code from RegionKey. |
ExtractRegionKeyStartPos()
|
Extract the START POS code from RegionKey. |
ExtractRegionKeyStrand()
|
Extract the STRAND from RegionKey. |
ExtractVariantKeyChrom()
|
Extract the CHROM code from VariantKey. |
ExtractVariantKeyPos()
|
Extract the POS code from VariantKey. |
ExtractVariantKeyRefAlt()
|
Extract the REF+ALT code from VariantKey. |
FindAllRvVariantKeyByRsid()
|
Search for the specified rsID and returns all the associated VariantKeys in the RV file.
NOTE: the output is limited to maximum 10 results. |
FindAllVrRsidByVariantKey()
|
Search for the specified VariantKey and returns all the associated rsIDs in the VR file.
NOTE: the output is limited to maximum 10 results. |
FindRefAltByVariantKey()
|
Retrieve the REF and ALT strings for the specified VariantKey.
Return REF+ALT length or 0 if the VariantKey is not found. |
FindRvVariantKeyByRsid()
|
Search for the specified rsID and returns the first occurrence of VariantKey in the RV file, or zero if not found. |
FindVrChromposRange()
|
Search for the specified CHROM-POS range and returns the first occurrence of rsID in the VR file. |
FindVrRsidByVariantKey()
|
Search for the specified VariantKey and returns the first occurrence of rsID in the VR file, or 0 if not found. |
FlipAllele()
|
Flip the allele nucleotides (replaces each letter with its complement).
The resulting string is always in uppercase.
Support extended nucleotide letters. |
GetGenorefSeq()
|
Returns the genome reference nucleotide at the specified chromosome and position. |
GetNextRvVariantKeyByRsid()
|
Get the next VariantKey for the specified rsID in the RV file, or 0 if not found
This function can be called in a loop to get all VariantKeys that are associated with the same rsID (if any). |
GetNextVrRsidByVariantKey()
|
Get the next rsID for the specified VariantKey in the VR file, or 0 if not found
This function can be called in a loop to get all rsIDs that are associated with the same VariantKey (if any). |
GetRegionKeyChromEndPos()
|
Get the CHROM + END POS encoding from RegionKey. |
GetRegionKeyChromStartPos()
|
Get the CHROM + START POS encoding from RegionKey. |
GetVariantKeyChromEndPos()
|
Get the CHROM + END POS encoding from VariantKey. |
GetVariantKeyChromStartPos()
|
Get the CHROM + START POS encoding from VariantKey. |
GetVariantKeyEndPos()
|
Get the VariantKey end position (POS + REF length).
Return variant end position. |
GetVariantKeyRefLength()
|
Retrieve the REF length for the specified VariantKey.
Return REF length or 0 if the VariantKey is not reversible and not found. |
HashStringID()
|
Hash the input string into a 64 bit unsigned integer.
This function can be used to convert long string IDs to numeric IDs. |
InitVariantKey()
|
Load the VariantKey support files.
This should be the first function called in order to load the support files. |
MmapGenorefFile()
|
Memory map the specified genome reference binary file (fasta.bin).
Returns the memory mapped file object, the columns object and the number of rows. |
MmapNRVKFile()
|
Memory map the specified NRVK binary file (nrvk.bin).
Returns the memory mapped file object, the columns object and the number of rows. |
MmapRSVKFile()
|
Memory map the specified RSVK binary file (rsvk.bin).
Returns the memory mapped file object, the columns object and the number of rows. |
MmapVKRSFile()
|
Memory map the specified VKRS binary file (vkrs.bin).
Returns the memory mapped file object, the columns object and the number of rows. |
MunmapBinfile()
|
Unmap and close the memory-mapped file.
On success, munmap() returns 0, on failure -1. |
NormalizeVariant()
|
Normalize a variant.
Flip alleles if required and apply the normalization algorithm described at:
https://genome.sph.umich.edu/wiki/Variant_Normalization
Return Positive bitmask number in case of success, negative number in case of error.
When positive, each bit has a different meaning when set, has defined by the NORM_* defines:
* bit 0:
Reference allele is inconsistent with the genome reference (i.e. when contains nucleotide letters other than A, C, G and T).
* bit 1:
Alleles have been swapped.
* bit 2:
Alleles nucleotides have been flipped (each nucleotide have been replaced with its complement).
* bit 3:
Alleles have been left extended.
* bit 4:
Alleles have been right trimmed.
* bit 5:
Alleles have been left trimmed. |
NormalizedVariantKey()
|
Create a normalized variantkey. |
ParseRegionKeyHex()
|
Parses a RegionKey hexadecimal string and returns the code. |
ParseVariantKeyHex()
|
Parses a VariantKey hexadecimal string and returns the code. |
RegionKey()
|
Returns a 64 bit regionkey based on CHROM, START POS (0-based), END POS and STRAND. |
RegionKeyHex()
|
Returns RegionKey hexadecimal string (16 characters). |
ReverseRegionKey()
|
Reverse a RegionKey code and returns the normalized components as regionkey_rev_t structure. |
ReverseVariantKey()
|
Reverse a VariantKey code and returns the normalized components. |
VariantKey()
|
Returns a 64 bit variant key based on CHROM, POS (0-base), REF, ALT.
The variant should be already normalized (see NormalizeVariant or use NormalizedVariantkey). |
VariantKeyHex()
|
Returns VariantKey hexadecimal string (16 characters). |
VariantKeyRange()
|
Returns minimum and maximum variant keys for range searches. |
VariantToRegionkey()
|
Get RegionKey from VariantKey. |
VknrBinToTsv()
|
Convert a vrnr.bin file to a simple TSV.
Return Number of written bytes or 0 in case of error.
For the reverse operation see the resources/tools/nrvk.sh script. |
as.character(<hex64>)
|
Coerce hex64 vector to decimal character |
as.character(<uint64>)
|
Coerce uint64 vector to character |
as.data.frame(<uint64>)
|
Coerce uint64 vector to data.frame. |
as.hex64(<>)
|
Coerce from NULL to hex64. |
as.hex64()
|
Coerce to hex64. |
as.hex64(<character>)
|
Coerce character vector to hex64 |
as.hex64(<factor>)
|
Coerce from factor to hex64. |
as.hex64(<hex64>)
|
Coerce from hex64 to hex64. |
as.hex64(<uint64>)
|
Convert uint64 vector to hex64. |
as.uint64(<>)
|
Coerce from NULL to uint64. |
as.uint64()
|
Coerce to uint64. |
as.uint64(<character>)
|
Coerce character vector to uint64 |
as.uint64(<double>)
|
Coerce double vector to uint64 |
as.uint64(<factor>)
|
Coerce from factor to uint64. |
as.uint64(<hex64>)
|
Convert hexadecimal character vector to uint64. |
as.uint64(<integer>)
|
Coerce integer vector to uint64 |
as.uint64(<uint64>)
|
Coerce from uint64 to uint64. |
c(<uint64>)
|
Concatenate uint64 vectors. |
cbind(<uint64>)
|
Combine uint64 vectors by columns. |
`==`(<uint64>)
|
Returns true if x and y are equal. |
format(<uint64>)
|
Format uint64 vector for pretty printing. |
`>`(<uint64>)
|
Returns true if x is greater than y. |
`>=`(<uint64>)
|
Returns true if x is greater or equal than y. |
hex64()
|
Create a new hex64 vector. |
identical.hex64()
|
Identity function for class hex64. |
identical.uint64()
|
Identity function for class uint64. |
intersect.uint64()
|
Returns the intersection of two sorted uint64 vectors. |
is.hex64()
|
Check if the object x is of hex64 class. |
is.uint64()
|
Check if the object x is of uint64 class. |
`length<-`(<uint64>)
|
Set the length of uint64 vector. |
`<`(<uint64>)
|
Returns true if x is less than y. |
`<=`(<uint64>)
|
Returns true if x is less or equal than y. |
`!=`(<uint64>)
|
Returns true if x and y are different. |
order.uint64()
|
Returns a permutation which rearranges its first argument into ascending order. |
print(<uint64>)
|
Prints uint64 argument and returns it invisibly. |
rbind(<uint64>)
|
Combine uint64 vectors by rows. |
rep(<uint64>)
|
Replicate elements of uint64 vectors. |
rev(<uint64>)
|
Reverse a uint64 vector. |
sort(<uint64>)
|
Sorts a uint64 vector in ascending order. |
`[`(<uint64>)
|
Extract uint64 vector parts |
`[[`(<uint64>)
|
Extract uint64 vector parts |
`[[<-`(<uint64>)
|
Replace parts of uint64 vector |
`[<-`(<uint64>)
|
Replace parts of uint64 vector |
uint64()
|
Create a new uint64 vector. |
union.uint64()
|
Returns the union of two sorted uint64 vectors. |
unique(<uint64>)
|
Eliminates all but the first element from every consecutive group of equal values. |