Skip to content

Commit 0e47572

Browse files
committed
Removing a utility tool that was really internal to biojava, but that was using external resources that are now gone.
Also removed some tests that were using external resources.
1 parent c7f5ef1 commit 0e47572

4 files changed

Lines changed: 29 additions & 415 deletions

File tree

biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/twobit/SimpleTwoBitFileProvider.java

Lines changed: 0 additions & 90 deletions
This file was deleted.

biojava-genome/src/main/java/org/biojava/nbio/genome/parsers/twobit/TwoBitFacade.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222

2323
import java.io.File;
2424

25-
/** A facade that makes it easier to work with a 2bit file.
25+
/**
26+
* A facade that makes it easier to work with a 2bit file.
2627
*
2728
* Created by yana on 3/27/17.
2829
*/
@@ -49,7 +50,8 @@ public void close() throws Exception {
4950

5051
}
5152

52-
/** Sets a chromosome for TwoBitParser.
53+
/**
54+
* Sets a chromosome for TwoBitParser.
5355
*
5456
* @param chr The chromosome name (e.g. chr21)
5557
*/
@@ -67,7 +69,8 @@ public void setChromosome(String chr) throws Exception {
6769
}
6870
}
6971

70-
/** Extract a sequence from a chromosome, using chromosomal coordinates
72+
/**
73+
* Extract a sequence from a chromosome, using chromosomal coordinates
7174
*
7275
* @param chromosomeName
7376
* @param start

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -899,8 +899,8 @@ public static int getCDSPosReverse(int chromPos, List<Integer> exonStarts, List<
899899
public static List<Range<Integer>> getCDSRegions(List<Integer> origExonStarts, List<Integer> origExonEnds, int cdsStart, int cdsEnd) {
900900

901901
// remove exons that are fully landed in UTRs
902-
List<Integer> exonStarts = new ArrayList<Integer>(origExonStarts);
903-
List<Integer> exonEnds = new ArrayList<Integer>(origExonEnds);
902+
List<Integer> exonStarts = new ArrayList<>(origExonStarts);
903+
List<Integer> exonEnds = new ArrayList<>(origExonEnds);
904904

905905
int j=0;
906906
for (int i = 0; i < origExonStarts.size(); i++) {
@@ -920,7 +920,7 @@ public static List<Range<Integer>> getCDSRegions(List<Integer> origExonStarts, L
920920
exonEnds.remove(nExons-1);
921921
exonEnds.add(cdsEnd);
922922

923-
List<Range<Integer>> cdsRegion = new ArrayList<Range<Integer>>();
923+
List<Range<Integer>> cdsRegion = new ArrayList<>();
924924
for ( int i=0; i<nExons; i++ ) {
925925
Range<Integer> r = Range.closed(exonStarts.get(i), exonEnds.get(i));
926926
cdsRegion.add(r);
@@ -956,17 +956,17 @@ public static DNASequence getTranscriptDNASequence(TwoBitFacade twoBitFacade, St
956956

957957
List<Range<Integer>> cdsRegion = getCDSRegions(exonStarts, exonEnds, cdsStart, cdsEnd);
958958

959-
String dnaSequence = "";
959+
StringBuilder dnaSequence = new StringBuilder();
960960
for (Range<Integer> range : cdsRegion) {
961961
String exonSequence = twoBitFacade.getSequence(chromosome,range.lowerEndpoint(), range.upperEndpoint());
962-
dnaSequence += exonSequence;
962+
dnaSequence.append(exonSequence);
963963
}
964964
if (orientation.equals('-')) {
965-
dnaSequence = new StringBuilder(dnaSequence).reverse().toString();
966-
DNASequence dna = new DNASequence(dnaSequence);
965+
dnaSequence = new StringBuilder(new StringBuilder(dnaSequence.toString()).reverse().toString());
966+
DNASequence dna = new DNASequence(dnaSequence.toString());
967967
SequenceView<NucleotideCompound> compliment = dna.getComplement();
968-
dnaSequence = compliment.getSequenceAsString();
968+
dnaSequence = new StringBuilder(compliment.getSequenceAsString());
969969
}
970-
return new DNASequence(dnaSequence.toUpperCase());
970+
return new DNASequence(dnaSequence.toString().toUpperCase());
971971
}
972972
}

0 commit comments

Comments
 (0)