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

Method write

src/rnabloom/RNABloom.java:1639–1779  ·  view source on GitHub ↗
(String fragment, ArrayList<Kmer> transcriptKmers)

Source from the content-addressed store, hash-verified

1637 }
1638
1639 public synchronized void write(String fragment, ArrayList<Kmer> transcriptKmers) throws IOException {
1640 if (!represented(transcriptKmers,
1641 graph,
1642 screeningBf,
1643 lookahead,
1644 maxIndelSize,
1645 maxTipLength,
1646 percentIdentity)) {
1647
1648 String transcript = graph.assemble(transcriptKmers);
1649 ArrayDeque<Integer> pasPositions = null;
1650
1651 boolean txptReverseComplemented = false;
1652 if (minPolyATailLengthRequired > 0) {
1653 boolean hasPolyATail = polyATailOnlyPattern.matcher(transcript).matches();
1654 boolean hasPolyTHead = false;
1655
1656 if (strandSpecific) {
1657 pasPositions = getPolyASignalPositions(transcript, polyASignalPattern, polyATailOnlyMatchingPattern);
1658 }
1659 else {
1660 hasPolyTHead = polyTHeadOnlyPattern.matcher(transcript).matches();
1661
1662 if (hasPolyATail) {
1663 pasPositions = getPolyASignalPositions(transcript, polyASignalPattern, polyATailOnlyMatchingPattern);
1664 }
1665
1666 if (hasPolyTHead && (pasPositions == null || pasPositions.isEmpty())) {
1667 String transcriptRC = reverseComplement(transcript);
1668
1669 pasPositions = getPolyASignalPositions(transcriptRC, polyASignalPattern, polyATailOnlyMatchingPattern);
1670
1671 if (!pasPositions.isEmpty()) {
1672 transcript = transcriptRC;
1673 txptReverseComplemented = true;
1674 }
1675 }
1676 }
1677 }
1678
1679 for (Kmer kmer : transcriptKmers) {
1680 screeningBf.add(kmer.getHash());
1681 }
1682
1683 int len = transcript.length();
1684 float cov = getMedianKmerCoverage(transcriptKmers);
1685
1686 StringBuilder headerBuilder = new StringBuilder();
1687 headerBuilder.append(prefix);
1688 headerBuilder.append(++cid);
1689 headerBuilder.append(" l=");
1690 headerBuilder.append(len);
1691 headerBuilder.append(" c=");
1692 headerBuilder.append(String.format("%.1f", cov));
1693 if (!fragment.isEmpty()) {
1694 headerBuilder.append(" F=[");
1695 headerBuilder.append(fragment);
1696 headerBuilder.append("]");

Callers 7

runMethod · 0.45
writeQuartilesToFileMethod · 0.45
writeToFileMethod · 0.45
writeUnconnectedMethod · 0.45
writeShortMethod · 0.45
writeLongMethod · 0.45
mainMethod · 0.45

Calls 12

representedMethod · 0.80
assembleMethod · 0.80
getMedianKmerCoverageMethod · 0.80
addMethod · 0.65
nextMethod · 0.65
hasNextMethod · 0.65
reverseComplementMethod · 0.45
getHashMethod · 0.45
sizeMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected