(Collection<String> forwardReadPaths,
Collection<String> reverseReadPaths,
Collection<String> longReadPaths,
Collection<String> refTranscriptsPaths,
boolean reverseComplementLong,
int numThreads,
boolean addCountsOnly,
boolean storeReadKmerPairs)
| 1104 | } |
| 1105 | |
| 1106 | public void populateGraph(Collection<String> forwardReadPaths, |
| 1107 | Collection<String> reverseReadPaths, |
| 1108 | Collection<String> longReadPaths, |
| 1109 | Collection<String> refTranscriptsPaths, |
| 1110 | boolean reverseComplementLong, |
| 1111 | int numThreads, |
| 1112 | boolean addCountsOnly, |
| 1113 | boolean storeReadKmerPairs) throws IOException, InterruptedException { |
| 1114 | |
| 1115 | // screeningBf = new BloomFilter(sbfNumBits, sbfNumHash, graph.getHashFunction()); |
| 1116 | /** parse the reads */ |
| 1117 | |
| 1118 | long numReads = 0; |
| 1119 | |
| 1120 | ExecutorService service = Executors.newFixedThreadPool(numThreads); |
| 1121 | |
| 1122 | ArrayList<SeqToGraphWorker> threadPool = new ArrayList<>(); |
| 1123 | int threadId = 0; |
| 1124 | |
| 1125 | for (String path : forwardReadPaths) { |
| 1126 | SeqToGraphWorker t = new SeqToGraphWorker(++threadId, path, false, addCountsOnly, storeReadKmerPairs); |
| 1127 | service.submit(t); |
| 1128 | threadPool.add(t); |
| 1129 | } |
| 1130 | |
| 1131 | for (String path : reverseReadPaths) { |
| 1132 | SeqToGraphWorker t = new SeqToGraphWorker(++threadId, path, true, addCountsOnly, storeReadKmerPairs); |
| 1133 | service.submit(t); |
| 1134 | threadPool.add(t); |
| 1135 | } |
| 1136 | |
| 1137 | for (String path : longReadPaths) { |
| 1138 | SeqToGraphWorker t = new SeqToGraphWorker(++threadId, path, reverseComplementLong, addCountsOnly, false); |
| 1139 | service.submit(t); |
| 1140 | threadPool.add(t); |
| 1141 | } |
| 1142 | |
| 1143 | service.shutdown(); |
| 1144 | service.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); |
| 1145 | |
| 1146 | for (SeqToGraphWorker t : threadPool) { |
| 1147 | numReads += t.getReadCount(); |
| 1148 | } |
| 1149 | |
| 1150 | System.out.println("Parsed " + NumberFormat.getInstance().format(numReads) + " reads in total."); |
| 1151 | |
| 1152 | if (!refTranscriptsPaths.isEmpty()) { |
| 1153 | System.out.println("Augmenting graph with reference transcripts..."); |
| 1154 | |
| 1155 | service = Executors.newFixedThreadPool(numThreads); |
| 1156 | |
| 1157 | for (String path : refTranscriptsPaths) { |
| 1158 | PairedKmersToGraphWorker t = new PairedKmersToGraphWorker(++threadId, path, true); |
| 1159 | service.submit(t); |
| 1160 | } |
| 1161 | |
| 1162 | service.shutdown(); |
| 1163 | service.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); |
nothing calls this directly
no test coverage detected