日期:2014-05-17 浏览次数:20719 次
BufferedReader brSnpDetailFile = new BufferedReader( new InputStreamReader(new FileInputStream( inputParameters.getAnnotationFilePath()))); int index = 0; while ((stringLine = brSnpDetailFile.readLine()) != null) { String[] tempString = stringLine.split("\t", -1); /*server*/ String snpId = tempString[3]; String associatedGeneName = tempString[4]; /*test String snpId = tempString[3]; String associatedGeneName = tempString[5]; */ if (userSnpFileHashMap.containsKey(snpId)) { float pValue = userSnpFileHashMap.get(snpId); Snp snp = new Snp(); snp.setAssociatedGeneName(associatedGeneName); snp.setReferenceId(snpId); snp.setPValue(pValue);
public void annotationFileParser(String filePath,String[] annotationFileArray){ try { BufferedReader brAnnotation = new BufferedReader( new InputStreamReader(new FileInputStream(new File(filePath)))); String stringLine = null; int index = 0; while ((stringLine = brAnnotation.readLine()) != null) { annotationFileArray[index] = stringLine; index ++; if(index % 10000000 == 0){ System.out.println(index); } } } catch (Exception e) { e.printStackTrace(); } }[/
int index = 0; for(int i = 0;i < annotationFileArray.length;i ++){ /*server*/ String snpId = annotationFileArray[i].split("\t", -1)[3]; String associatedGeneName = annotationFileArray[i].split("\t", -1)[4]; /* String snpId = annotationFileArray[i].split("\t", -1)[3]; String associatedGeneName = annotationFileArray[i].split("\t", -1)[5]; */ if (userSnpFileHashMap.containsKey(snpId)) { float pValue = userSnpFileHashMap.get(snpId); Snp snp = new Snp(); snp.setAssociatedGeneName(associatedGeneName); snp.setReferenceId(snpId); snp.setPValue(pValue); // put all filtered snp into array. snpArrayList.add(snp); // put all filtered P-Value into array. pValueArrayList.add(pValue); if (!associateGeneNameIndexArrayHashMap .containsKey(associatedGeneName)) { ArrayList<Integer> tempArrayList = new ArrayList<Integer>(); tempArrayList.add(index); associateGeneNameIndexArrayHashMap.put(associatedGeneName, tempArrayList); } else { associateGeneNameIndexArrayHashMap.get(associatedGeneName).add(index); } index++;