MCPcopy Create free account
hub / github.com/BirolLab/RNA-Bloom / getPooledReadPaths

Method getPooledReadPaths

src/rnabloom/RNABloom.java:5066–5176  ·  view source on GitHub ↗
(String pooledReadPathsListFile,
            HashMap<String, ArrayList<String>> pooledLeftReadPaths,
            HashMap<String, ArrayList<String>> pooledRightReadPaths,
            HashMap<String, ArrayList<String>> pooledUnpairedForwardReadPaths,
            HashMap<String, ArrayList<String>> pooledUnpairedReverseReadPaths)

Source from the content-addressed store, hash-verified

5064 private final static String FIELD_SEPARATOR = "\\s+"; // any white space character
5065
5066 private static boolean getPooledReadPaths(String pooledReadPathsListFile,
5067 HashMap<String, ArrayList<String>> pooledLeftReadPaths,
5068 HashMap<String, ArrayList<String>> pooledRightReadPaths,
5069 HashMap<String, ArrayList<String>> pooledUnpairedForwardReadPaths,
5070 HashMap<String, ArrayList<String>> pooledUnpairedReverseReadPaths) throws FileNotFoundException, IOException {
5071
5072 BufferedReader br = getTextFileReader(pooledReadPathsListFile);
5073
5074 int nameColumnIndex = 0;
5075 int leftColumnIndex = 1;
5076 int rightColumnIndex = 2;
5077 int sefColumnIndex = -1;
5078 int serColumnIndex = -1;
5079 int numColumns = 3;
5080
5081 String line;
5082 int lineNumber = 0;
5083 while ((line = br.readLine()) != null) {
5084 ++lineNumber;
5085
5086 line = line.trim();
5087 if (!line.isEmpty()) {
5088 if (line.charAt(0) == '#') {
5089 String[] header = line.substring(1).split(FIELD_SEPARATOR);
5090 nameColumnIndex = -1;
5091 leftColumnIndex = -1;
5092 rightColumnIndex = -1;
5093 sefColumnIndex = -1;
5094 serColumnIndex = -1;
5095 numColumns = header.length;
5096 for (int i=0; i<header.length; ++i) {
5097 switch(header[i]) {
5098 case "name":
5099 nameColumnIndex = i;
5100 break;
5101 case "left":
5102 leftColumnIndex = i;
5103 break;
5104 case "right":
5105 rightColumnIndex = i;
5106 break;
5107 case "sef":
5108 sefColumnIndex = i;
5109 break;
5110 case "ser":
5111 serColumnIndex = i;
5112 break;
5113 default:
5114 exitOnError("`-pool` input file has unrecognized column identifier \"" + header[i] + "\" on line " + lineNumber + ":\n\t" + line);
5115 return false;
5116 }
5117 }
5118 }
5119 else {
5120 String[] entry = line.split(FIELD_SEPARATOR);
5121 int numFields = entry.length;
5122 if (numFields != numColumns) {
5123 exitOnError("`-pool` input file has unexpected number of columns on line " + lineNumber + ":\n\t" + line);

Callers 1

mainMethod · 0.95

Calls 5

exitOnErrorMethod · 0.95
getTextFileReaderMethod · 0.80
getMethod · 0.65
addMethod · 0.65
closeMethod · 0.65

Tested by

no test coverage detected