Package au.org.intersect.samifier.domain

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


            PeptideSearchResult peptideSearchResult)
            throws PeptideSequenceGeneratorException {
        String proteinName = peptideSearchResult.getProteinName();
        String oln = proteinOLNMap.getOLN(proteinName);

        GeneInfo gene = genome.getGene(oln);
        if (gene == null) {
            LOG.info("Protein ID found in accession file, but locus not found in genome file");
            LOG.info("ERR_GFF: " + proteinName + " " + oln);
            return null;
        }
View Full Code Here


                .parseResults(searchResultsPaths);
        translationTable = CodonTranslationTable
                .parseTableFile(translationTableFile);

        for (PeptideSearchResult peptideSearchResult : peptideSearchResults) {
            GeneInfo geneInfo = genome.getGene(peptideSearchResult
                    .getProteinName());
            if (geneInfo == null) {
                System.err.println(peptideSearchResult.getProteinName()
                        + " not found in the genome");
                continue;
            }
            if (peptideFilter != null && (!peptideFilter.accepts(peptideSearchResult))){
                    continue;
            }

            int virtualGeneStart = geneInfo.getStart() - 1;
            int virtualGeneStop = geneInfo.getStop() - 1;

            int peptideAbsoluteStart;
            int peptideAbsoluteStop;

            int startOffset = (peptideSearchResult.getPeptideStart() - 1) * GenomeConstant.BASES_PER_CODON;
            int stopOffset = (peptideSearchResult.getPeptideStop() - 1) * GenomeConstant.BASES_PER_CODON;

            if (geneInfo.isForward()) {
                peptideAbsoluteStart = virtualGeneStart + startOffset;
                peptideAbsoluteStop = virtualGeneStart + stopOffset;
            } else {
                peptideAbsoluteStart = virtualGeneStop - startOffset;
                peptideAbsoluteStop = virtualGeneStop - stopOffset;
            }

            GenomeNucleotides genomeNucleotides = getGenomeNucleotides(geneInfo.getChromosome());
            int startPosition = searchStart(peptideSearchResult, peptideAbsoluteStart, genomeNucleotides, geneInfo);
            int stopPosition = searchStop(peptideSearchResult, peptideAbsoluteStop, genomeNucleotides, geneInfo, false);
            if (startPosition == NOT_FOUND || stopPosition == NOT_FOUND) {
                continue;
            }
            ProteinLocation loc = new ProteinLocation("?", getStartPosition(startPosition, stopPosition) , Math.abs(stopPosition - startPosition),
                    geneInfo.getDirectionStr(), "0", peptideSearchResult.getConfidenceScore(),
                    peptideSearchResult.getProteinName() + "(" + (virtualGeneStart + 1) + "-" + (virtualGeneStop + 1) + ")", geneInfo.getChromosome());
            loc.setAbsoluteStartStop(getStartPosition(startPosition, stopPosition) + "_" + Math.abs(stopOffset - startOffset));
            loc.setOrigin("VPMerger");
            proteinLocations.add(loc);
        }
        return proteinLocations;
View Full Code Here

                String type = parts[2];
                if (type == null) {
                    continue;
                }
                if (GENE_RE.matcher(type).matches()) {
                    GeneInfo gene = parseGene(parts);
                    processGene(genome, gene);
                } else if (SEQUENCE_RE.matcher(type).find()) {
                    GeneSequence sequence = parseSequence(parts);
                    processSequence(genome, parts[CHROMOSOME_PART], sequence);
                }
View Full Code Here

        if (start > stop) {
            throwParsingException("Start-stop invalid");
        }
        //parse virtual genes
       
        return new GeneInfo(chromosome, extractId(parts[ATTRIBUTES_PART]), start, stop, parseStrand(direction), parseVirtualProteins(extractId(parts[ATTRIBUTES_PART]), parts[ATTRIBUTES_PART]));
    }
View Full Code Here

    }

    private void processSequence(Genome genome, String chromosome,
            GeneSequence sequence) throws GenomeFileParsingException {
        if (!genome.hasGene(sequence.getParentId())) {
            GeneInfo gene = new GeneInfo(chromosome, sequence.getParentId(),
                    sequence.getStart(), sequence.getStop(),
                    sequence.getDirection(), sequence.getVirtualProteins());
            genome.addGene(gene);
        }
        GeneInfo gene = genome.getGene(sequence.getParentId());
        if (gene.getDirection() != sequence.getDirection()) {
            throwParsingException("A sequence in gene " + gene.getId() + " has inconsistent direction");
        }
        if (gene.getStart() > sequence.getStart()) {
            throwParsingException("Start of sequence in gene " + gene.getId() + " overflows gene");
        }
        if (gene.getStop() < sequence.getStop()) {
            throwParsingException("Stop of sequence in gene " + gene.getId() + " overflows gene");
        }
        genome.getGene(sequence.getParentId()).addLocation(sequence);
    }
View Full Code Here

            ProteinToOLNMap proteinToOLNMap, Genome genome) {
        List<PeptideSearchResult> result = new ArrayList<PeptideSearchResult>();
        HashMap<String, String> proteinIDToChromosome = new HashMap<String, String>();
        for (PeptideSearchResult res : searchResult) {
            String proteinID = proteinToOLNMap.getOLN(res.getProteinName());
            GeneInfo genInfo = genome.getGene(proteinID);
            if (genInfo == null) {
                LOG.warn("No gene location for " + proteinID);
                continue;
            }
            String chromosome = genInfo.getChromosome();
            proteinIDToChromosome.put(res.getProteinName(), chromosome);
        }
        Set<String> chromosomes = new HashSet<String>(
                proteinIDToChromosome.values());
        for (String chromosome : chromosomes) {
View Full Code Here

TOP

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

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.