(String pafPath, Set<String> skipSet)
| 4478 | } |
| 4479 | |
| 4480 | public HashMap<String, Float> getLengthNormalizedReadCounts(String pafPath, Set<String> skipSet) throws IOException { |
| 4481 | HashMap<String, Float> counts = new HashMap<>(); |
| 4482 | |
| 4483 | PafReader reader = new PafReader(pafPath); |
| 4484 | String prevName = null; |
| 4485 | ArrayList<StrandedOverlap> targets = new ArrayList<>(); |
| 4486 | for (PafRecord r = new PafRecord(); reader.hasNext();) { |
| 4487 | reader.next(r); |
| 4488 | |
| 4489 | if (!r.qName.equals(prevName)) { |
| 4490 | updateCounts(targets, counts); |
| 4491 | targets = new ArrayList<>(); |
| 4492 | prevName = r.qName; |
| 4493 | } |
| 4494 | |
| 4495 | if (!skipSet.contains(r.tName)) { |
| 4496 | targets.add(pafToStrandedOverlap(r)); |
| 4497 | } |
| 4498 | } |
| 4499 | reader.close(); |
| 4500 | |
| 4501 | // process the last batch of records |
| 4502 | updateCounts(targets, counts); |
| 4503 | |
| 4504 | return counts; |
| 4505 | } |
| 4506 | |
| 4507 | public static void main(String[] args) { |
| 4508 | try { |
no test coverage detected