Package au.org.intersect.samifier.domain

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


    }

    private ProteinToOLNMap doFileParsing(File mappingFile) throws IOException,
            ProteinToOLNMappingFileParsingException {
        FileBasedProteinToOLNMap proteinOLN = new FileBasedProteinToOLNMap();

        BufferedReader reader = null;
        try {
            reader = new BufferedReader(new FileReader(mappingFile));

            // Skip header line
            String line;
            int lineNumber = 1;
            while ((line = reader.readLine()) != null) {
                lineNumber++;
                if (line.matches("^#.*$")) {
                    continue;
                }
                // ordered_locus_name accession_id protein_name id
                // Tab delimited
                String[] parts = line.split("\\s+");
                if (parts.length < 3) {
                    throw new ProteinToOLNMappingFileParsingException(
                            "Line "
                                    + lineNumber
                                    + " not in expected format, should be: ordered_locus_name accession_id protein_name id");
                }
                proteinOLN.addMapping(parts[2], parts[0]);
            }
        } finally {
            if (reader != null) {
                reader.close();
            }
View Full Code Here

TOP

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

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.