Skip to content

Commit

Permalink
Merge pull request #58 from mskilab/read.junctions
Browse files Browse the repository at this point in the history
read.junctions
  • Loading branch information
zining01 authored Dec 7, 2021
2 parents ecbe5e7 + f93862c commit 8c2334e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 3 additions & 5 deletions R/JaBbA.R
Original file line number Diff line number Diff line change
Expand Up @@ -3211,8 +3211,6 @@ jbaLP = function(kag.file = NULL,
kag.gg$edges$mark(cn = NULL)
kag.gg$nodes[cn > M]$mark(cn = NA, weight = NA)

## browser()

## add lower bounds depending on ALT junction tier
if (tfield %in% colnames(kag.gg$edges$dt)) {
lbs = ifelse(kag.gg$edges$dt[, ..tfield] == 1, 1, 0)
Expand Down Expand Up @@ -6722,14 +6720,14 @@ read.junctions = function(rafile,
, tier := ifelse(
tier==2, ifelse(grepl("1", this.geno), 2, 3), 3)]
values(this.ra) = this.dt
return(this.ra)
return(verify.junctions(this.ra))
})
loose=FALSE ## TODO: temporary until we figure out how
}
}

if (!get.loose | is.null(vgr$mix)){
return(ra)
return(verify.junctions(ra))
} else {
npix = is.na(vgr$mix)
## these are possible "loose ends" that we will add to the segmentation
Expand All @@ -6744,7 +6742,7 @@ read.junctions = function(rafile,
values(vgr.loose) = cbind(vcf@fixed[bix[npix], ], info(vcf)[bix[npix], ])
}

return(list(junctions = ra, loose.ends = vgr.loose))
return(list(junctions = verify.junctions(ra), loose.ends = vgr.loose))
}
} else{
rafile = data.table::fread(rafile)
Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test_filterloose.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ test_that(desc = "Testing LP JaBbA with .bw coverage input",
slack.penalty = 10,
tilim = 60,
cfield = 'ratio',
reiterate = 2,
verbose = 2,
outdir = 'JaBbA.filter',
overwrite = TRUE,
Expand Down Expand Up @@ -61,7 +62,7 @@ test_that(desc = "Testing LP JaBbA with .bw coverage input",
rescue.all = FALSE,
filter_loose = FALSE))
},
regexp = "Resetting rescue.all to TRUE")
regexp = "Skipping loose end annotation")
})

test_that(desc = "Testing LP JaBbA with .bw coverage input",
Expand Down

0 comments on commit 8c2334e

Please sign in to comment.