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

Method getLengthNormalizedReadCounts

src/rnabloom/util/PafUtils.java:352–377  ·  view source on GitHub ↗
(String pafPath, Set<String> skipSet)

Source from the content-addressed store, hash-verified

350 }
351
352 public static HashMap<String, Float> getLengthNormalizedReadCounts(String pafPath, Set<String> skipSet) throws IOException {
353 HashMap<String, Float> counts = new HashMap<>();
354
355 PafReader reader = new PafReader(pafPath);
356 String prevName = null;
357 ArrayList<Overlap> targets = new ArrayList<>();
358 for (PafRecord r = new PafRecord(); reader.hasNext();) {
359 reader.next(r);
360
361 if (!r.qName.equals(prevName)) {
362 updateNormalizedCounts(targets, counts);
363 targets = new ArrayList<>();
364 prevName = r.qName;
365 }
366
367 if (!skipSet.contains(r.tName)) {
368 targets.add(new Overlap(r));
369 }
370 }
371 reader.close();
372
373 // process the last batch of records
374 updateNormalizedCounts(targets, counts);
375
376 return counts;
377 }
378
379 /**
380 *

Callers

nothing calls this directly

Calls 7

hasNextMethod · 0.95
nextMethod · 0.95
closeMethod · 0.95
containsMethod · 0.80
addMethod · 0.65
equalsMethod · 0.45

Tested by

no test coverage detected