Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restriction fragment aware background correction fix #97

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

5Aki1
Copy link

@5Aki1 5Aki1 commented Feb 10, 2025

When using restriction fragment aware background correction, hichipper would often fail with this error:

Fri Feb  7 11:05:51 PST 2025: Something went wrong in determining peaks for anchor inference; rerun with the  flag to debug.

When assigning mcols(cont)$dist in the lamdaProcess.R file, it is possible that the number of rows returned from distanceToNearest() do not match the number of rows in cont.

This solution assigns the missing rows as NA and then fills the distance with a zero.

> nearestHits
Hits object with 48306420 hits and 1 metadata column:
             queryHits subjectHits |  distance
             <integer>   <integer> | <integer>
         [1]         1     7200235 |       520
         [2]         3     7200494 |       276
         [3]         4     7181959 |       661
         [4]         5     7181973 |       364
         [5]         6     7181973 |       361
         ...       ...         ... .       ...
  [48306416]  48306419     3655739 |         1
  [48306417]  48306420     3655740 |         2
  [48306418]  48306421     3655740 |         6
  [48306419]  48306422     3655761 |       367
  [48306420]  48306423     7195795 |       382
  -------
  queryLength: 48306423 / subjectLength: 7499821

> cont
GRanges object with 48306423 ranges and 2 metadata columns:
                           seqnames              ranges strand |        V4      dist
                              <Rle>           <IRanges>  <Rle> | <numeric> <integer>
         [1]       chrUn_KI270748v1             0-92286      * |   5.44588       520
         [2]       chrUn_KI270337v1               0-331      * |   5.44588      <NA>
         [3]       chrUn_KI270749v1            0-158273      * |   5.44588       276
         [4] chr1_KI270713v1_random             0-14438      * |   5.44588       661
         [5] chr1_KI270713v1_random         14438-14439      * |   5.46840       364
         ...                    ...                 ...    ... .       ...       ...
  [48306419]                   chr8 145065626-145065644      * |   5.49780         1
  [48306420]                   chr8 145065644-145065650      * |   5.46840         2
  [48306421]                   chr8 145065650-145065665      * |   5.45370         6
  [48306422]                   chr8 145065665-145078500      * |   5.44588       367
  [48306423]       chrUn_KI270465v1              0-1143      * |   5.44588       382
  -------

@5Aki1 5Aki1 changed the title My feature branch Restriction fragment aware background correction fix Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant