Skip to content
Snippets Groups Projects
Unverified Commit 8df6b0cb authored by maryamghr's avatar maryamghr Committed by GitHub
Browse files

small fix

parent 0e7b8e0c
No related branches found
No related tags found
No related merge requests found
......@@ -36,8 +36,7 @@ getHaplotagTable <- function(sv.table=NULL, bam.path=NULL) {
## split reads per selected region
hits <- findOverlaps(SV.regions.gr.perCell, fragments)
fragments.per.region <- split(fragments[subjectHits(hits)], queryHits(hits))
# subset regions to the regions that have non-zero read count
regions <- regions[unique(queryHits(hits)),]
## count haplotagged reads in selected regions
counts <- lapply(fragments.per.region, getHapReadCount)
counts.df <- do.call(rbind, counts)
......@@ -100,6 +99,8 @@ getHaplotagTable2 <- function(bedFile=NULL, bam.path=NULL, CPUs=4, file.destinat
## split reads per selected region
hits <- findOverlaps(regions.gr, fragments)
fragments.per.region <- split(fragments[subjectHits(hits)], queryHits(hits))
# subset regions to the regions that have non-zero read count
regions <- regions[unique(queryHits(hits)),]
## count haplotagged reads in selected regions
#use parallel execution with a given number of CPUs
counts <- bplapply(fragments.per.region, getHapReadCount, BPPARAM = MulticoreParam(CPUs))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment