Skip to content

Commit

Permalink
Removing a utility tool that was really internal to biojava, but that…
Browse files Browse the repository at this point in the history
… was using external resources that are now gone.

Also removed some tests that were using external resources.
  • Loading branch information
josemduarte committed Feb 1, 2022
1 parent c7f5ef1 commit 0e47572
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 415 deletions.

This file was deleted.

Expand Up @@ -22,7 +22,8 @@

import java.io.File;

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

}

/** Sets a chromosome for TwoBitParser.
/**
* Sets a chromosome for TwoBitParser.
*
* @param chr The chromosome name (e.g. chr21)
*/
Expand All @@ -67,7 +69,8 @@ public void setChromosome(String chr) throws Exception {
}
}

/** Extract a sequence from a chromosome, using chromosomal coordinates
/**
* Extract a sequence from a chromosome, using chromosomal coordinates
*
* @param chromosomeName
* @param start
Expand Down
Expand Up @@ -899,8 +899,8 @@ public static int getCDSPosReverse(int chromPos, List<Integer> exonStarts, List<
public static List<Range<Integer>> getCDSRegions(List<Integer> origExonStarts, List<Integer> origExonEnds, int cdsStart, int cdsEnd) {

// remove exons that are fully landed in UTRs
List<Integer> exonStarts = new ArrayList<Integer>(origExonStarts);
List<Integer> exonEnds = new ArrayList<Integer>(origExonEnds);
List<Integer> exonStarts = new ArrayList<>(origExonStarts);
List<Integer> exonEnds = new ArrayList<>(origExonEnds);

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

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

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

String dnaSequence = "";
StringBuilder dnaSequence = new StringBuilder();
for (Range<Integer> range : cdsRegion) {
String exonSequence = twoBitFacade.getSequence(chromosome,range.lowerEndpoint(), range.upperEndpoint());
dnaSequence += exonSequence;
dnaSequence.append(exonSequence);
}
if (orientation.equals('-')) {
dnaSequence = new StringBuilder(dnaSequence).reverse().toString();
DNASequence dna = new DNASequence(dnaSequence);
dnaSequence = new StringBuilder(new StringBuilder(dnaSequence.toString()).reverse().toString());
DNASequence dna = new DNASequence(dnaSequence.toString());
SequenceView<NucleotideCompound> compliment = dna.getComplement();
dnaSequence = compliment.getSequenceAsString();
dnaSequence = new StringBuilder(compliment.getSequenceAsString());
}
return new DNASequence(dnaSequence.toUpperCase());
return new DNASequence(dnaSequence.toString().toUpperCase());
}
}

0 comments on commit 0e47572

Please sign in to comment.