}
if (DebuggingFlag.get_use_mascot_score_flag() == 1) {
int mapq = result.getConfidenceScore()
.round(new MathContext(0)).intValue();
samEntries.add(new SAMEntry(resultName, peptide.getGeneInfo(),
peptideStart, peptide.getCigarString(), peptide
.getNucleotideSequence(), mapq));
} else {
int mapq = result.getConfidenceScore().round(new MathContext(0)).intValue();
String sequnece = peptide.getNucleotideSequence();
String outputSequence = (peptide.getGeneInfo().getDirection() == -1) ? new StringBuilder(StringUtils.replaceChars(sequnece, "ACGT", "TGCA")).reverse().toString() : sequnece;
SAMEntry entry = new SAMEntry(resultName, peptide.getGeneInfo(), peptideStart, peptide.getCigarString(), outputSequence, mapq);
entry.setChromosomeLength(sequenceGenerator.getFastaParser().getChromosomeLength(peptide.getGeneInfo().getChromosome()));
samEntries.add(entry);
}
try {
if (DebuggingFlag.get_sbi_debug_flag() == 1) {
CodonTranslationTable translationTable = CodonTranslationTable
.parseTableFile(translationTableFile);
String nucleotideString = peptide.getNucleotideSequence();
int direction = peptide.getGeneInfo().getDirection();
String mascotPeptideString = result.getPeptideSequence();
String predictedAminoAcidSequence = new String("");
if (direction != 1) {
StringBuilder invertedReversedSequence = new StringBuilder(
StringUtils.replaceChars(nucleotideString,
"ACGT", "TGCA")).reverse();
predictedAminoAcidSequence = translationTable
.proteinToAminoAcidSequence(invertedReversedSequence
.toString());
} else {
predictedAminoAcidSequence = translationTable
.proteinToAminoAcidSequence(nucleotideString);
}
if (!predictedAminoAcidSequence.equals(mascotPeptideString)) {
String samEntryStrng = new SAMEntry(resultName,
peptide.getGeneInfo(), peptideStart,
peptide.getCigarString(),
peptide.getNucleotideSequence()).toString();
LOG.info("Incorrect nucleotide sequence for following SAM entry:\n"