Package au.org.intersect.samifier.domain

Examples of au.org.intersect.samifier.domain.PeptideSequence


        for (PeptideSearchResult result : peptideSearchResults) {
            if (peptideFilter != null && !peptideFilter.accepts(result)) {
                continue;
            }

            PeptideSequence peptide = sequenceGenerator.getPeptideSequence(result);
            if (peptide == null) {
                LOG.warn("Error while geting peptide sequnce for " + result.getId());
                continue;
            }
            String proteinName = result.getProteinName();
            String resultName = proteinName + "." + result.getId();
            int peptideStart = peptide.getStartIndex()
                    + peptide.getGeneInfo().getStart();

            if (bedWriter != null && !foundProteins.contains(proteinName)) {
                foundProteins.add(proteinName);
                BedLineOutputter bedLineOutputter = new BedLineOutputter(
                        peptide, proteinName);
                bedWriter.write(bedLineOutputter.toString());
            }

            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"
                                + samEntryStrng);
                    }
View Full Code Here


                                                              // in the
                                                              // example)
        int bedStopIndex = gene.getStart() + stopIndex - 1; // BED files are
                                                            // zero based (15 in
                                                            // the example)
        return new PeptideSequence(peptideSequence, cigar.toString(), startIndex, bedStartIndex, bedStopIndex, gene);
    }
View Full Code Here

        if (DebuggingFlag.get_sbi_debug_flag() == 1) {
            CodonTranslationTable translationTable = CodonTranslationTable
                    .parseTableFile(translationTableFile);

            for (PeptideSearchResult peptideSearchResult : peptideSearchResults) {
                PeptideSequence peptideSequence = sequenceGenerator
                        .getPeptideSequence(peptideSearchResult);
                if (peptideSequence == null) {
                    LOG.warn("Error while geting peptide sequnce for " + peptideSearchResult.getId());
                    continue;
                }
                ResultsAnalyserOutputter outputter;
                outputter = new ResultsAnalyserOutputter(peptideSearchResult,
                        proteinToOLNMap, genome, peptideSequence,
                        translationTable);
                if (outputter.isValid()) {
                    output.write(outputter.toString());
                    output.write(System.getProperty("line.separator"));
                }
            }

        } else {
            for (PeptideSearchResult peptideSearchResult : peptideSearchResults) {
                PeptideSequence peptideSequence = sequenceGenerator
                        .getPeptideSequence(peptideSearchResult);
                if (peptideSequence == null) {
                    LOG.warn("Error while geting peptide sequnce for " + peptideSearchResult.getId());
                    continue;
                }
View Full Code Here

                .sortResultsByChromosome(peptideSearchResults, proteinToOLNMap,
                        genome);
        FileWriter output = new FileWriter(outputFile);

        for (PeptideSearchResult peptideSearchResult : peptideSearchResults) {
            PeptideSequence peptideSequence = sequenceGenerator
                    .getPeptideSequence(peptideSearchResult);
            if (peptideSequence == null || peptideSequence.getNucleotideSequence().isEmpty()) {
                LOG.warn("Error while geting peptide sequnce for " + peptideSearchResult.getId());
                continue;
            }
            if (DebuggingFlag.get_sbi_debug_flag() == 1) {
                CodonTranslationTable translationTable = CodonTranslationTable
View Full Code Here

TOP

Related Classes of au.org.intersect.samifier.domain.PeptideSequence

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.