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

khadi_dev #69

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Remotes:
github::mskilab/gChain,
github::mskilab/gGnome@0de9f45b5cf744375015ad4f164df555f05cf80a
Depends:
R (>= 3.6.0),
R (>= 3.5.0),
GenomicRanges,
gUtils,
gTrack,
Expand All @@ -41,4 +41,4 @@ Suggests:
covr
License: MIT + file LICENSE
LazyData: true
RoxygenNote: 7.1.1
RoxygenNote: 7.1.2
1,295 changes: 1,135 additions & 160 deletions R/JaBbA.R

Large diffs are not rendered by default.

9,637 changes: 9,637 additions & 0 deletions R/JaBbA.R.orig

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions configure
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

echo "configure working dir:"
echo $(pwd)
rm -rf src

system=`uname`
Expand Down
97 changes: 58 additions & 39 deletions inst/extdata/jba
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env Rscript
options(error = function() {traceback(2); quit('no',1)})
library(optparse)
jbastr = "
_____ ___ _ _____
Expand Down Expand Up @@ -193,26 +194,37 @@ if (!exists("opt"))
default = FALSE,
help = "run filter.loose to get a breakdown of loose ends?"),
make_option(
c("--max.threads"),
type = "integer",
default = 1L,
help = "run filter.loose to get a breakdown of loose ends?"),
c("--gurobi"),
type = "logical",
default = FALSE,
help = "use gurobi optimizer instead of CPLEX?"),
make_option(c("-v", "--verbose"),
action = "store_true",
default = FALSE,
default = TRUE,
help = "verbose output")
)

parseobj = OptionParser(usage = paste(c("jba JUNCTIONS COVERAGE [options]",
"\tJUNCTIONS can be BND style vcf, bedpe, rds of GrangesList",
" \tCOVERAGE is a .wig, .bw, .bedgraph, .bed., .rds of a granges, or .tsv .csv /.txt file that is coercible to a GRanges",
"\tuse --field=FIELD argument so specify which column to use if specific meta field of a multi-column table"),
collapse="\n"),
option_list=option_list)

args = tryCatch(parse_args(parseobj, positional_arguments= 2, print_help_and_exit = FALSE),
error = function(e) {message(jbastr); print_help(parseobj); NULL})

parseobj = OptionParser(
usage = paste(
c("jba JUNCTIONS COVERAGE [options]",
"\tJUNCTIONS can be BND style vcf, bedpe, rds of GrangesList",
" \tCOVERAGE is a .wig, .bw, .bedgraph, .bed., .rds of a granges, or .tsv .csv /.txt file that is coercible to a GRanges",
"\tuse --field=FIELD argument so specify which column to use if specific meta field of a multi-column table"),
collapse="\n"),
option_list=option_list
)
args = tryCatch(
parse_args(parseobj,
positional_arguments = TRUE,
print_help_and_exit = FALSE),

error = function(e) {message(jbastr); print_help(parseobj); NULL}
)

opt = NULL;
if (!is.null(args)) {
Expand All @@ -223,6 +235,7 @@ if (!exists("opt"))
{
message('Did not find junction file ', opt$junctions)
message('Warning: will be running JaBbA without junctions')
## print_help(parseobj); stop()
opt$junctions = ""
}
if (!file.exists(opt$coverage))
Expand All @@ -238,36 +251,42 @@ if (!exists("opt"))
suppressPackageStartupMessages(
{

if (!is.null(opt$seg) && is.character(opt$seg) && (is.na(opt$seg) || opt$seg == '/dev/null' || !file.exists(opt$seg)))
{
message('Did not find seg file ', opt$seg, ' setting to NULL')
opt$seg = NULL
}
if (!is.null(opt$seg) && is.character(opt$seg) && (is.na(opt$seg) || opt$seg == '/dev/null' || !file.exists(opt$seg)))
{
message('Did not find seg file ', opt$seg, ' setting to NULL')
opt$seg = NULL
}


## if (!is.null(opt$j.supp) && (is.na(opt$j.supp) || opt$j.supp == '/dev/null' || !file.exists(opt$j.supp)))
## {
## message('Did not find j.supp file ', opt$j.supp, ' setting to NULL')
## opt$j.supp = NULL
## }

if (!is.null(opt$j.supp) && (is.na(opt$j.supp) || opt$j.supp == '/dev/null' || !file.exists(opt$j.supp)))
{
message('Did not find j.supp file ', opt$j.supp, ' setting to NULL')
opt$j.supp = NULL
}
if (!is.null(opt$hets) && (is.na(opt$hets) || opt$hets == '/dev/null' || !file.exists(opt$hets)))
{
message('Did not find hets file ', opt$hets, ' setting to NULL')
opt$hets = NULL
}

if (!is.null(opt$hets) && (is.na(opt$hets) || opt$hets == '/dev/null' || !file.exists(opt$hets)))
{
message('Did not find hets file ', opt$hets, ' setting to NULL')
opt$hets = NULL
}
if (!is.null(opt$nseg) && (is.na(opt$nseg) || opt$nseg == '/dev/null' || !file.exists(opt$nseg)))
{
message('Did not find nseg file ', opt$nseg, ' setting to NULL')
opt$nseg = NULL
}

if (!is.null(opt$nseg) && (is.na(opt$nseg) || opt$nseg == '/dev/null' || !file.exists(opt$nseg)))
{
message('Did not find nseg file ', opt$nseg, ' setting to NULL')
opt$nseg = NULL
}
if (!is.null(opt$j.supp) && (is.na(opt$j.supp) || opt$j.supp == '/dev/null' || !file.exists(opt$j.supp)))
{
message('Did not find supplementary junction file ', opt$j.supp, ' setting to NULL')
opt$j.supp = NULL
}

if (!is.null(opt$j.supp) && (is.na(opt$j.supp) || opt$j.supp == '/dev/null' || !file.exists(opt$j.supp)))
{
message('Did not find supplementary junction file ', opt$j.supp, ' setting to NULL')
opt$j.supp = NULL
}
if (!is.null(opt$blacklist.junctions) && (is.na(opt$blacklist.junctions) || opt$blacklist.junctions == '/dev/null' || !file.exists(opt$blacklist.junctions)))
{
message('Did not find blacklist.junctions file ', opt$blacklist.junctions, ' setting to NULL')
opt$blacklist.junctions = NULL
}


require(JaBbA)
Expand Down Expand Up @@ -317,6 +336,7 @@ suppressPackageStartupMessages(
loose.penalty.mode = ifelse(opt$linear, "linear", "boolean"),
tilim = opt$tilim,
epgap = opt$epgap,
max.threads = opt$max.threads,
use.gurobi = opt$gurobi,
## TODO max.threads = Inf, max.mem = 16
## below are general options
Expand All @@ -328,9 +348,8 @@ suppressPackageStartupMessages(
ism = opt$ism,
verbose = 2,
fix.thres = opt$fix.thres,
filter_loose = opt$filter_loose
filter_loose = opt$filter_loose,
rescue.all = opt$rescue.all
)
})



quit('no', 0)
Loading