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

Method populateGraph

src/rnabloom/RNABloom.java:1106–1176  ·  view source on GitHub ↗
(Collection<String> forwardReadPaths,
                            Collection<String> reverseReadPaths,
                            Collection<String> longReadPaths,
                            Collection<String> refTranscriptsPaths,
                            boolean reverseComplementLong,
                            int numThreads,
                            boolean addCountsOnly,
                            boolean storeReadKmerPairs)

Source from the content-addressed store, hash-verified

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);

Callers

nothing calls this directly

Calls 9

getReadCountMethod · 0.95
submitMethod · 0.80
getDbgbfMethod · 0.80
getCbfMethod · 0.80
getRpkbfMethod · 0.80
addMethod · 0.65
getFPRMethod · 0.65

Tested by

no test coverage detected