Skip to content

Commit 388220d

Browse files
committed
Merge branch 'master' of github.com:andreasprlic/biojava
* 'master' of github.com:andreasprlic/biojava: updating icon to new official BioJava logo adding tools to map from chromosome positions to mRNA coding sequence position. # Conflicts: # biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java
2 parents 993f65a + 2b903c9 commit 388220d

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

biojava-genome/src/main/java/org/biojava/nbio/genome/util/ChromosomeMappingTools.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class ChromosomeMappingTools {
2020
public static final boolean debug = false;
2121
private static final String newline = System.getProperty("line.separator");
2222

23+
2324
public static final String CHROMOSOME = "CHROMOSOME";
2425
public static final String CDS = "CDS";
2526

@@ -36,6 +37,7 @@ public static String printHTMLExonStructure(GeneChromosomePosition chromosomePos
3637
return printHTMLExonStructureForward(chromosomePosition);
3738

3839
return printHTMLExonStructureReverse(chromosomePosition);
40+
3941
}
4042

4143
private static String formatExonStructureForward(GeneChromosomePosition chromPos) {
@@ -765,8 +767,10 @@ public static int getCDSLengthReverse(List<Integer> exonStarts,
765767
inCoding = false;
766768
codingLength += (end - cdsStart);
767769
if (debug) {
770+
768771
System.out.println(" <- Exon : " + (cdsStart+1) + " - " + end + " | " + (end - cdsStart) + " | " + (codingLength-3) + " | " + (codingLength % 3));
769772
System.out.println(" UTR : " + start + " - " + (cdsStart ));
773+
770774
}
771775

772776
} else if (inCoding) {
@@ -863,6 +867,7 @@ public static int getCDSLengthForward(List<Integer> exonStarts, List<Integer> ex
863867
*/
864868
public static List<Range> getCDSExonRanges(GeneChromosomePosition chromPos){
865869
if ( chromPos.getOrientation() == '+')
870+
866871
return getCDSExonRangesForward(chromPos,CDS);
867872

868873
return getCDSExonRangesReverse(chromPos,CDS);
@@ -883,6 +888,7 @@ public static List<Range> getChromosomalRangesForCDS(GeneChromosomePosition chro
883888

884889
private static List<Range> getCDSExonRangesReverse(GeneChromosomePosition chromPos,
885890
String responseType) {
891+
886892
List<Integer> exonStarts = chromPos.getExonStarts();
887893
List<Integer> exonEnds = chromPos.getExonEnds();
888894

@@ -944,6 +950,7 @@ private static List<Range> getCDSExonRangesReverse(GeneChromosomePosition chromP
944950
s.append(newline);
945951
}
946952

953+
947954
Range r ;
948955
if ( responseType.equals(CDS))
949956
r = Range.closed(0,codingLength);
@@ -954,6 +961,7 @@ private static List<Range> getCDSExonRangesReverse(GeneChromosomePosition chromP
954961

955962
} else if (start <= cdsStart && end >= cdsStart) {
956963
inCoding = false;
964+
957965
Range r;
958966
if ( responseType.equals(CDS))
959967
r = Range.closed(codingLength,codingLength+(end-cdsStart));
@@ -973,6 +981,7 @@ private static List<Range> getCDSExonRangesReverse(GeneChromosomePosition chromP
973981

974982
} else if (inCoding) {
975983
// full exon is coding
984+
976985
Range r;
977986
if ( responseType.equals(CDS))
978987
r = Range.closed(codingLength,codingLength+(end-start));
@@ -1003,6 +1012,7 @@ private static List<Range> getCDSExonRangesReverse(GeneChromosomePosition chromP
10031012
}
10041013

10051014

1015+
10061016
private static List<Range> getCDSExonRangesForward(GeneChromosomePosition chromPos,
10071017
String responseType) {
10081018

@@ -1028,6 +1038,7 @@ private static List<Range> getCDSExonRangesForward(GeneChromosomePosition chromP
10281038
codingLength += (end - cdsStart);
10291039
//
10301040

1041+
10311042
Range r;
10321043
if ( responseType.equals(CDS))
10331044
r = Range.closed(0,codingLength);
@@ -1039,6 +1050,7 @@ private static List<Range> getCDSExonRangesForward(GeneChromosomePosition chromP
10391050
//System.out.println(" <-- CDS end at: " + cdsEnd );
10401051
inCoding = false;
10411052

1053+
10421054
Range r;
10431055
if ( responseType.equals(CDS))
10441056
r = Range.closed(codingLength,codingLength+(cdsEnd-start));
@@ -1049,6 +1061,7 @@ private static List<Range> getCDSExonRangesForward(GeneChromosomePosition chromP
10491061

10501062
} else if (inCoding) {
10511063
// full exon is coding
1064+
10521065
Range r;
10531066
if ( responseType.equals(CDS))
10541067
r = Range.closed(codingLength,codingLength+(end-start));

biojava-genome/src/test/java/org/biojava/nbio/genome/TestGenomeMapping.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void testAK1() {
7979
chromranges = Lists.reverse(chromranges);
8080

8181
assertTrue(chromranges.size() == 6);
82-
82+
8383
// compare with https://www.ncbi.nlm.nih.gov/CCDS/CcdsBrowse.cgi?REQUEST=CCDS&DATA=CCDS6881
8484
validateExon(0,127868008,127868076, chromranges );
8585
validateExon(1,127868320,127868512, chromranges );

0 commit comments

Comments
 (0)