Skip to content

Commit

Permalink
Merge pull request #5 from flatironinstitute/with_thresholding
Browse files Browse the repository at this point in the history
With thresholding
  • Loading branch information
cskokgibbs authored Aug 20, 2021
2 parents 208fbf3 + 2f0b48f commit faf5e47
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
18 changes: 14 additions & 4 deletions inferelator_prior/network_from_motifs.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,23 @@ def parse_common_arguments(args):
_intergenic = args.intergenic if args.intergenic is not None else False

if _species is None:
_window = args.window_size if args.window_size is not None else DEFAULT_WINDOW
try:
_window = args.window_size if args.window_size is not None else DEFAULT_WINDOW
_use_tss = args.tss
except AttributeError:
_window, _use_tss = None, None

_tandem = args.tandem if args.tandem is not None else DEFAULT_TANDEM
_use_tss = args.tss
else:
_window = SPECIES_MAP[_species]['window'] if args.window_size is None else args.window_size
try:
_window = SPECIES_MAP[_species]['window'] if args.window_size is None else args.window_size
_use_tss = SPECIES_MAP[_species]['use_tss'] if args.tss else args.tss
except AttributeError:
_window, _use_tss = None, None

_tandem = SPECIES_MAP[_species]['tandem'] if args.tandem is None else args.tandem
_use_tss = SPECIES_MAP[_species]['use_tss'] if args.tss else args.tss



# Load gene and regulator lists
_gl = pd.read_csv(args.genes, index_col=None, header=None)[0].tolist() if args.genes is not None else None
Expand Down
4 changes: 3 additions & 1 deletion inferelator_prior/network_from_motifs_fasta.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@ def main():

ap.add_argument("-m", "--motif", dest="motif", help="Motif file", metavar="PATH", required=True)
ap.add_argument("-f", "--fasta", dest="fasta", help="Promoter FASTA file", metavar="FILE", required=True)
#ap.add_argument("--scan-threshold", dest="scan_threshold", default="1e-4", help="Threshold for FIMO")

# Process common arguments into values
add_common_arguments(ap)
args = ap.parse_args()
out_prefix, _window, _tandem, _use_tss, _gl, _tfl, _minfo = parse_common_arguments(args)
out_prefix, _window, _tandem, _use_tss, _gl, _tfl, _minfo, _ = parse_common_arguments(args)

_, _, prior_data = build_motif_prior_from_fasta(args.motif, args.fasta,
num_cores=args.cores,
scanner_thresh=args.scan_thresh,
motif_ic=args.min_ic,
tandem=_tandem,
scanner_type=args.scanner,
Expand Down

0 comments on commit faf5e47

Please sign in to comment.