@Override public int getLength() { return Math.abs(this.getBioEnd() - this.getBioBegin()) + 1; }
@Override public int getLength() { return Math.abs(this.getBioEnd() - this.getBioBegin()) + 1; }
if (showExonUppercase) { StringBuilder sb = new StringBuilder(seq.toLowerCase()); int geneBioBegin = sequence.getBioBegin(); int geneBioEnd = sequence.getBioEnd(); for (ExonSequence exonSequence : sequence.getExonSequences()) {
if (showExonUppercase) { StringBuilder sb = new StringBuilder(seq.toLowerCase()); int geneBioBegin = sequence.getBioBegin(); int geneBioEnd = sequence.getBioEnd(); for (ExonSequence exonSequence : sequence.getExonSequences()) {
/** * Try to give method clarity where you want a DNASequence coding in the 5' to 3' direction * Returns the DNASequence representative of the 5' and 3' reading based on strand * @return dna sequence */ public DNASequence getSequence5PrimeTo3Prime() { String sequence = getSequenceAsString(this.getBioBegin(), this.getBioEnd(), this.getStrand()); if (getStrand() == Strand.NEGATIVE) { //need to take complement of sequence because it is negative and we are returning the gene sequence from the opposite strand StringBuilder b = new StringBuilder(getLength()); CompoundSet<NucleotideCompound> compoundSet = this.getCompoundSet(); for (int i = 0; i < sequence.length(); i++) { String nucleotide = String.valueOf(sequence.charAt(i)); NucleotideCompound nucleotideCompound = compoundSet.getCompoundForString(nucleotide); b.append(nucleotideCompound.getComplement().getShortName()); } sequence = b.toString(); } DNASequence dnaSequence = null; try { dnaSequence = new DNASequence(sequence.toUpperCase()); } catch (CompoundNotFoundException e) { // this should not happen, the sequence is DNA originally, if it does, there's a bug somewhere logger.error("Could not create new DNA sequence in getSequence5PrimeTo3Prime(). Error: {}",e.getMessage()); } dnaSequence.setAccession(new AccessionID(this.getAccession().getID())); return dnaSequence; } }
/** * Try to give method clarity where you want a DNASequence coding in the 5' to 3' direction * Returns the DNASequence representative of the 5' and 3' reading based on strand * @return dna sequence */ public DNASequence getSequence5PrimeTo3Prime() { String sequence = getSequenceAsString(this.getBioBegin(), this.getBioEnd(), this.getStrand()); if (getStrand() == Strand.NEGATIVE) { //need to take complement of sequence because it is negative and we are returning the gene sequence from the opposite strand StringBuilder b = new StringBuilder(getLength()); CompoundSet<NucleotideCompound> compoundSet = this.getCompoundSet(); for (int i = 0; i < sequence.length(); i++) { String nucleotide = String.valueOf(sequence.charAt(i)); NucleotideCompound nucleotideCompound = compoundSet.getCompoundForString(nucleotide); b.append(nucleotideCompound.getComplement().getShortName()); } sequence = b.toString(); } DNASequence dnaSequence = null; try { dnaSequence = new DNASequence(sequence.toUpperCase()); } catch (CompoundNotFoundException e) { // this should not happen, the sequence is DNA originally, if it does, there's a bug somewhere logger.error("Could not create new DNA sequence in getSequence5PrimeTo3Prime(). Error: {}",e.getMessage()); } dnaSequence.setAccession(new AccessionID(this.getAccession().getID())); return dnaSequence; } }
gff3line = key + "\t" + geneSequence.getSource() + "\t" + "gene" + "\t" + geneSequence.getBioBegin() + "\t" + geneSequence.getBioEnd() + "\t"; Double score = geneSequence.getSequenceScore(); if (score == null) {
if (startCodonBegin < geneSequence.getBioBegin()) { geneSequence.setBioBegin(startCodonBegin); if (stopCodonEnd > geneSequence.getBioBegin()) { geneSequence.setBioEnd(stopCodonEnd);
if (startCodonBegin < geneSequence.getBioBegin()) { geneSequence.setBioBegin(startCodonBegin); if (stopCodonEnd > geneSequence.getBioBegin()) { geneSequence.setBioEnd(stopCodonEnd);
if (startCodonBegin < geneSequence.getBioBegin()) { geneSequence.setBioBegin(startCodonBegin); if (stopCodonEnd > geneSequence.getBioBegin()) { geneSequence.setBioEnd(stopCodonEnd);