Java wrapper for performing various conversions between common identifiers.
- Java 8
- Python
- hgvs python package
- Liftover
- HGVS to Genomic Coordinates
liftOvers on genomic coordinates. The wrapper provides easy to use methods for converting genomic coordinates from one build version to another. Additionally, it is pre-configured to offer support for the most common conversions.
LiftOvers can be performed easily by either using the predefined liftovers, or by supplying a custom chain file. Chain files are written in the Chain Format from UCSC. A large number of chainfiles are publicly available to download here,
try {
LiftOver intervalLiftOver = UCSCLiftOver.hg19ToHg38();
Interval newInterval = intervalLiftOver.liftOver("chr1",743267,743268);
} catch(LiftOverException e){
e.printStackTrace();
} catch(IOException e){
e.printStackTrace();
}
try {
String path = "/path/to/customChainFile";
String from = "mm9";
String to = "mm10";
ChainFile chainFile = new UCSCChainFile(path, from, to);
LiftOver intervalLiftOver = new UCSCLiftOver(chainFile);
Interval newInterval = intervalLiftOver.liftOver("chr1",7724,8662);
} catch(LiftOverException e){
e.printStackTrace();
} catch(IOException e){
e.printStackTrace();
}
Several liftovers have been included
From | To |
---|---|
hg17 | hg18 |
hg17 | hg19 |
hg18 | hg17 |
hg18 | hg19 |
hg18 | hg38 |
hg19 | hg17 |
hg19 | hg18 |
hg19 | hg38 |
hg38 | hg19 |
The HGVS to genomic coordinate converter offers a thin wrapper around the hgvs python package for your java project. It will take any valid HGVS and convert it to genomic positions.
In order to use this pacakage you must first install both python and HGVS on the computer you will be running this.
Use pip to install hgvs:
pip install hgvs
If you are using OSX and run into a problem while installing hgvs, you may need to install supporting postgresql libraries:
brew install postgresql
try {
String hgvs = "NM_182763.2:c.688+403C>T"
GenomeInterval interval = HGVSConverter.hgvsToGenomic(hgvs);
} catch(HGVSException e){
e.printStackTrace();
}