Package org.biojava.nbio.genome.util
Class ChromosomeMappingTools
java.lang.Object
org.biojava.nbio.genome.util.ChromosomeMappingTools
A class that can map chromosomal positions to mRNA (coding sequence) positions.
- Author:
- Andreas Prlic
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
formatExonStructure
(GeneChromosomePosition chromosomePosition) Pretty print the details of a GeneChromosomePosition to a StringgetCDSExonRanges
(GeneChromosomePosition chromPos) Extracts the exon boundaries in CDS coordinates.static int
getCDSLength
(GeneChromosomePosition chromPos) Get the length of the CDS in nucleotides.static int
getCDSLengthForward
(List<Integer> exonStarts, List<Integer> exonEnds, int cdsStart, int cdsEnd) Get the length of the coding sequencestatic int
getCDSLengthReverse
(List<Integer> exonStarts, List<Integer> exonEnds, int cdsStart, int cdsEnd) Get the length of the coding sequencestatic int
getCDSPosForChromosomeCoordinate
(int coordinate, GeneChromosomePosition chromosomePosition) I have a genomic coordinate, where is it on the mRNAstatic int
getCDSPosForward
(int chromPos, List<Integer> exonStarts, List<Integer> exonEnds, int cdsStart, int cdsEnd) Converts the genetic coordinate to the position of the nucleotide on the mRNA sequence for a gene living on the forward DNA strand.static int
getCDSPosReverse
(int chromPos, List<Integer> exonStarts, List<Integer> exonEnds, int cdsStart, int cdsEnd) Converts the genetic coordinate to the position of the nucleotide on the mRNA sequence for a gene living on the reverse DNA strand.Extracts the boundaries of the coding regions in chromosomal coordinatesstatic ChromPos
getChromosomePosForCDScoordinate
(int cdsNucleotidePosition, GeneChromosomePosition chromPos) maps the position of a CDS nucleotide back to the genomestatic ChromPos
getChromPosForward
(int cdsPos, List<Integer> exonStarts, List<Integer> exonEnds, int cdsStart, int cdsEnd) Get the CDS position mapped onto the chromosome positionstatic ChromPos
getChromPosReverse
(int cdsPos, List<Integer> exonStarts, List<Integer> exonEnds, int cdsStart, int cdsEnd) Get the CDS position mapped on the chromosome position
-
Field Details
-
CHROMOSOME
- See Also:
-
CDS
- See Also:
-
-
Constructor Details
-
ChromosomeMappingTools
public ChromosomeMappingTools()
-
-
Method Details
-
formatExonStructure
Pretty print the details of a GeneChromosomePosition to a String- Parameters:
chromosomePosition
-- Returns:
-
getCDSLength
Get the length of the CDS in nucleotides.- Parameters:
chromPos
-- Returns:
- length of the CDS in nucleotides.
-
getChromosomePosForCDScoordinate
public static ChromPos getChromosomePosForCDScoordinate(int cdsNucleotidePosition, GeneChromosomePosition chromPos) maps the position of a CDS nucleotide back to the genome- Parameters:
cdsNucleotidePosition
-- Returns:
- a ChromPos object
-
getChromPosReverse
public static ChromPos getChromPosReverse(int cdsPos, List<Integer> exonStarts, List<Integer> exonEnds, int cdsStart, int cdsEnd) Get the CDS position mapped on the chromosome position- Parameters:
exonStarts
-exonEnds
-cdsStart
-cdsEnd
-- Returns:
-
getChromPosForward
public static ChromPos getChromPosForward(int cdsPos, List<Integer> exonStarts, List<Integer> exonEnds, int cdsStart, int cdsEnd) Get the CDS position mapped onto the chromosome position- Parameters:
exonStarts
-exonEnds
-cdsStart
-cdsEnd
-- Returns:
-
getCDSLengthReverse
public static int getCDSLengthReverse(List<Integer> exonStarts, List<Integer> exonEnds, int cdsStart, int cdsEnd) Get the length of the coding sequence- Parameters:
exonStarts
-exonEnds
-cdsStart
-cdsEnd
-- Returns:
-
getCDSLengthForward
public static int getCDSLengthForward(List<Integer> exonStarts, List<Integer> exonEnds, int cdsStart, int cdsEnd) Get the length of the coding sequence- Parameters:
exonStarts
-exonEnds
-cdsStart
-cdsEnd
-- Returns:
-
getCDSExonRanges
public static List<com.google.common.collect.Range<Integer>> getCDSExonRanges(GeneChromosomePosition chromPos) Extracts the exon boundaries in CDS coordinates. (needs to be divided by 3 to get AA positions)- Parameters:
chromPos
-- Returns:
-
getChromosomalRangesForCDS
public static List<com.google.common.collect.Range<Integer>> getChromosomalRangesForCDS(GeneChromosomePosition chromPos) Extracts the boundaries of the coding regions in chromosomal coordinates- Parameters:
chromPos
-- Returns:
-
getCDSPosForChromosomeCoordinate
public static int getCDSPosForChromosomeCoordinate(int coordinate, GeneChromosomePosition chromosomePosition) I have a genomic coordinate, where is it on the mRNA- Parameters:
coordinate
-chromosomePosition
-- Returns:
-
getCDSPosForward
public static int getCDSPosForward(int chromPos, List<Integer> exonStarts, List<Integer> exonEnds, int cdsStart, int cdsEnd) Converts the genetic coordinate to the position of the nucleotide on the mRNA sequence for a gene living on the forward DNA strand.- Parameters:
chromPos
- The genetic coordinate on a chromosomeexonStarts
- The list holding the genetic coordinates pointing to the start positions of the exons (including UTR regions)exonEnds
- The list holding the genetic coordinates pointing to the end positions of the exons (including UTR regions)cdsStart
- The start position of a coding regioncdsEnd
- The end position of a coding region- Returns:
- the position of the nucleotide base on the mRNA sequence corresponding to the input genetic coordinate (base 1)
-
getCDSPosReverse
public static int getCDSPosReverse(int chromPos, List<Integer> exonStarts, List<Integer> exonEnds, int cdsStart, int cdsEnd) Converts the genetic coordinate to the position of the nucleotide on the mRNA sequence for a gene living on the reverse DNA strand.- Parameters:
chromPos
- The genetic coordinate on a chromosomeexonStarts
- The list holding the genetic coordinates pointing to the start positions of the exons (including UTR regions)exonEnds
- The list holding the genetic coordinates pointing to the end positions of the exons (including UTR regions)cdsStart
- The start position of a coding regioncdsEnd
- The end position of a coding region- Returns:
- the position of the nucleotide base on the mRNA sequence corresponding to the input genetic coordinate (base 1)
-