/** * Get the stitched together CDS sequences then maps to the cDNA * @return */ public DNASequence getDNACodingSequence() { StringBuilder sb = new StringBuilder(); for (CDSSequence cdsSequence : cdsSequenceList) { sb.append(cdsSequence.getCodingSequence()); } DNASequence dnaSequence = null; try { dnaSequence = new DNASequence(sb.toString().toUpperCase()); } catch (CompoundNotFoundException e) { // if I understand this should not happen, please correct if I'm wrong - JD 2014-10-24 logger.error("Could not create DNA coding sequence, {}. This is most likely a bug.", e.getMessage()); } dnaSequence.setAccession(new AccessionID(this.getAccession().getID())); return dnaSequence; }
/** * Get the stitched together CDS sequences then maps to the cDNA * @return */ public DNASequence getDNACodingSequence() { StringBuilder sb = new StringBuilder(); for (CDSSequence cdsSequence : cdsSequenceList) { sb.append(cdsSequence.getCodingSequence()); } DNASequence dnaSequence = null; try { dnaSequence = new DNASequence(sb.toString().toUpperCase()); } catch (CompoundNotFoundException e) { // if I understand this should not happen, please correct if I'm wrong - JD 2014-10-24 logger.error("Could not create DNA coding sequence, {}. This is most likely a bug.", e.getMessage()); } dnaSequence.setAccession(new AccessionID(this.getAccession().getID())); return dnaSequence; }
for (int i = 0; i < cdsSequenceList.size(); i++) { CDSSequence cdsSequence = cdsSequenceList.get(i); String codingSequence = cdsSequence.getCodingSequence(); CDSSequence nextCDSSequence = cdsSequenceList.get(i + 1); if (nextCDSSequence.phase == 1) { String nextCodingSequence = nextCDSSequence.getCodingSequence(); codingSequence = codingSequence + nextCodingSequence.substring(0, 1); } else if (nextCDSSequence.phase == 2) { String nextCodingSequence = nextCDSSequence.getCodingSequence(); codingSequence = codingSequence + nextCodingSequence.substring(0, 2); CDSSequence nextCDSSequence = cdsSequenceList.get(i + 1); if (nextCDSSequence.phase == 1) { String nextCodingSequence = nextCDSSequence.getCodingSequence(); codingSequence = codingSequence + nextCodingSequence.substring(0, 1); } else if (nextCDSSequence.phase == 2) { String nextCodingSequence = nextCDSSequence.getCodingSequence(); codingSequence = codingSequence + nextCodingSequence.substring(0, 2);
for (int i = 0; i < cdsSequenceList.size(); i++) { CDSSequence cdsSequence = cdsSequenceList.get(i); String codingSequence = cdsSequence.getCodingSequence(); CDSSequence nextCDSSequence = cdsSequenceList.get(i + 1); if (nextCDSSequence.phase == 1) { String nextCodingSequence = nextCDSSequence.getCodingSequence(); codingSequence = codingSequence + nextCodingSequence.substring(0, 1); } else if (nextCDSSequence.phase == 2) { String nextCodingSequence = nextCDSSequence.getCodingSequence(); codingSequence = codingSequence + nextCodingSequence.substring(0, 2); CDSSequence nextCDSSequence = cdsSequenceList.get(i + 1); if (nextCDSSequence.phase == 1) { String nextCodingSequence = nextCDSSequence.getCodingSequence(); codingSequence = codingSequence + nextCodingSequence.substring(0, 1); } else if (nextCDSSequence.phase == 2) { String nextCodingSequence = nextCDSSequence.getCodingSequence(); codingSequence = codingSequence + nextCodingSequence.substring(0, 2);