Package au.org.intersect.samifier.domain

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


            String name = "p" + nameIndex + (isHalfInterval ? "b" : "a") + "."
                    + (isForward ? "+" : "-") + (subIndex + 1);
            int length = endIndex - startIndex + 1;
            String frame = Integer.toString(subIndex + 1);
            ProteinLocation location = new ProteinLocation(name, startIndex, length,
                    isForward ? GenomeConstant.FORWARD_FLAG
                            : GenomeConstant.REVERSE_FLAG, frame, null, null, chromosome);
            location.setOrigin("VPGenerator");
            locations.add(location);
        }
    }
View Full Code Here


            if (direction.equals(GenomeConstant.FORWARD_FLAG)) {
                if (firstIndex > secondIndex) {
                    throw new LocationGeneratorException("Error in line : " + line);
                }
                proteinLocations.add(new ProteinLocation(name, firstIndex, secondIndex - firstIndex + 1, direction, frame, confidenceScore, null, chromosome));
            } else if (direction.startsWith(GenomeConstant.REVERSE_FLAG)) {
                if (secondIndex > firstIndex) {
                    throw new LocationGeneratorException("Error in line : " + line);
                }
                proteinLocations.add(new ProteinLocation(name, secondIndex,
                        firstIndex - secondIndex + 1,
                        GenomeConstant.REVERSE_FLAG, frame, confidenceScore, null, chromosome));
            } else {
                throw new LocationGeneratorException(
                        "Unexpected value for direction (4th column) at line: "
View Full Code Here

            locations = removeDuplicates(locations);
            locations = mergeProteins(locations);
            Collections.sort(locations);
            Iterator<ProteinLocation> setIterator = locations.iterator();
            while (setIterator.hasNext()) {
                ProteinLocation currentElement = setIterator.next();
                if (currentElement.getLength() < MIN_PROTEIN_LENGTH) {
                    setIterator.remove();
                }
            }
            if (locations.size() > 1) {
              //remove all proteins that are contained inside bigger protein
                setIterator = locations.iterator();
                ProteinLocation base = setIterator.next();
                while (setIterator.hasNext()) {
                    ProteinLocation currentElement = setIterator.next();
                    if (currentElement.getStartIndex() >= base.getStartIndex() && currentElement.getStop() <= base.getStop()
                        && currentElement.getStartIndex() % 3 == base.getStartIndex() % 3 ){
                        base.update(currentElement);
                        setIterator.remove();
                    } else {
                        base = currentElement;
                    }
View Full Code Here

            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

    }

    private List<ProteinLocation> mergeProteins(List<ProteinLocation> locations) {
        Map<Integer, ProteinLocation> proteinMap = new HashMap<Integer, ProteinLocation>();
        for (ProteinLocation location : locations) {
            ProteinLocation loc = proteinMap.get(location.getStartIndex());
            if (loc == null) {
                proteinMap.put(location.getStartIndex(), location);
            } else {
               loc.update(location);
            }
        }
        ArrayList<ProteinLocation> proteinList = new ArrayList<ProteinLocation>(proteinMap.values());
        return proteinList;
    }
View Full Code Here

        return proteinList;
    }
    private List<ProteinLocation> removeDuplicates(List<ProteinLocation> locations) {
        Map<String, ProteinLocation> uniqueLocation = new HashMap<String, ProteinLocation>();
        for (ProteinLocation loc : locations) {
            ProteinLocation propetinOnList = uniqueLocation.get(loc.getAbsoluteStartStop());
            if (propetinOnList == null) {
                uniqueLocation.put(loc.getAbsoluteStartStop(), loc);
            } else {
                if (loc.getStartIndex() < propetinOnList.getStartIndex()) {
                    uniqueLocation.put(loc.getAbsoluteStartStop(), loc);
                }
            }
        }
        return new ArrayList<ProteinLocation>(uniqueLocation.values());
View Full Code Here

       

    }
    @Test
    public void testForwardWithProperStart(){
        ProteinLocation expectedLocation = new ProteinLocation("q0", 37, 102, "+", "0");
        List<ProteinLocation> expectedArray = new ArrayList<ProteinLocation>();
        expectedArray.add(expectedLocation);
        String [] mascotFiles = {"test/resources/merger/test_mascot_search_results.txt"};
        File genomeFile = new File("test/resources/merger/virtual_protein_proper_start.gff");
        File chromosomeDir = new File("test/resources/merger/");
View Full Code Here

        }
    }
    //test with no start and no end for start
    @Test
    public void testForwardWithNoStart(){
        ProteinLocation expectedLocation = new ProteinLocation("q0", 10, 129, "+", "0");
        List<ProteinLocation> expectedArray = new ArrayList<ProteinLocation>();
        expectedArray.add(expectedLocation);
        String [] mascotFiles = {"test/resources/merger/test_mascot_search_results.txt"};
        File genomeFile = new File("test/resources/merger/virtual_protein.gff");
        File chromosomeDir = new File("test/resources/merger/");
View Full Code Here

       
    }
    //test with no end for start
    @Test
    public void testForwardNoEndForStart(){
        ProteinLocation expectedLocation = new ProteinLocation("q0", 37, 102, "+", "0");
        List<ProteinLocation> expectedArray = new ArrayList<ProteinLocation>();
        expectedArray.add(expectedLocation);
        String [] mascotFiles = {"test/resources/merger/test_mascot_search_results.txt"};
        File genomeFile = new File("test/resources/merger/virtual_protein_no_end_for_start.gff");
        File chromosomeDir = new File("test/resources/merger/");
View Full Code Here

       
    }
    //test with no start -> end is in place
    @Test
    public void testForwardNoStartProperEnd(){
        ProteinLocation expectedLocation = new ProteinLocation("q0", 31, 108, "+", "0");
        List<ProteinLocation> expectedArray = new ArrayList<ProteinLocation>();
        expectedArray.add(expectedLocation);
        String [] mascotFiles = {"test/resources/merger/test_mascot_search_results.txt"};
        File genomeFile = new File("test/resources/merger/virtual_protein_no_start_proper_end.gff");
        File chromosomeDir = new File("test/resources/merger/");
View Full Code Here

TOP

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

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.