genome = genomeParser.parseGenomeFile(genomeFile);
ProteinToOLNParser proteinToOLNParser = new ProteinToOLNParserImpl();
proteinToOLNMap = proteinToOLNParser.parseMappingFile(mapFile);
PeptideSearchResultsParser peptideSearchResultsParser = new PeptideSearchResultsParserImpl(proteinToOLNMap);
List<PeptideSearchResult> peptideSearchResults = peptideSearchResultsParser.parseResults(searchResultsPaths);
FileWriter bedWriter = null;
if (bedfilePath != null) {
bedWriter = new FileWriter(bedfilePath);
}
FileWriter sam = new FileWriter(outfile);
// sort search result by proteins
peptideSearchResults = peptideSearchResultsParser.sortResultsByChromosome(peptideSearchResults, proteinToOLNMap, genome);
createSAM(peptideSearchResults, sam, bedWriter);
}