Skip to content

Commit

Permalink
revert back to full covars
Browse files Browse the repository at this point in the history
  • Loading branch information
taoliu committed Oct 4, 2022
1 parent 9ec2922 commit 77ffc3c
Show file tree
Hide file tree
Showing 4 changed files with 1,167 additions and 961 deletions.
6 changes: 3 additions & 3 deletions MACS3/Commands/hmmratac_cmd.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Time-stamp: <2022-10-04 12:12:26 Tao Liu>
# Time-stamp: <2022-10-04 15:13:57 Tao Liu>

"""Description: Main HMMR command
Expand Down Expand Up @@ -217,7 +217,7 @@ def run( args ):
options.info( f"#4 Load Hidden Markov Model from given model file")
hmm_model, i_open_region, i_background_region, i_nucleosomal_region, options.hmm_binsize = hmm_model_init( options.hmm_file )
else:
options.info( f"#4 Train Hidden Markov Model with Multinormal Emission" )
options.info( f"#4 Train Hidden Markov Model with Multivariate Gaussian Emission" )

# extract signals within peak using the given binsize
options.info( f"# Extract signals in training regions with bin size of {options.hmm_binsize}")
Expand All @@ -238,7 +238,7 @@ def run( args ):

options.info( f"# Use Baum-Welch algorithm to train the HMM")

hmm_model = hmm_training( training_data, training_data_lengths, random_seed = options.hmm_randomSeed, covar="diag" )
hmm_model = hmm_training( training_data, training_data_lengths, random_seed = options.hmm_randomSeed, covar="full" )

options.info( f"# HMM converged: {hmm_model.monitor_.converged}")

Expand Down
5 changes: 1 addition & 4 deletions MACS3/Signal/HMMR_HMM.pyx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cython: language_level=3
# cython: profile=True
# Time-stamp: <2022-10-04 12:31:15 Tao Liu>
# Time-stamp: <2022-10-04 15:14:15 Tao Liu>

"""Module description:
Expand All @@ -25,9 +25,6 @@ from cpython cimport bool
from hmmlearn import hmm
import json
# from hmmlearn cimport hmm
# from sklearn.cluster import KMeans
# from sklearn.cluster cimport KMeans


# ------------------------------------
# MACS3 modules
Expand Down
4 changes: 2 additions & 2 deletions bin/macs3
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
# Time-stamp: <2022-10-04 12:14:31 Tao Liu>
# Time-stamp: <2022-10-04 13:48:15 Tao Liu>

"""Description: MACS v3 main executable.
Expand Down Expand Up @@ -812,7 +812,7 @@ def add_hmmratac_parser( subparsers ):
# group for peak calling arguments
group_call = argparser_hmmratac.add_argument_group( "Peak calling arguments" )
group_call.add_argument( "-c", "--prescan-cutoff", dest = "prescan_cutoff", type = float,
help = "The fold change cutoff for prescanning candidate regions in the whole dataset. The we will use HMM to predict states on these candidate regions. Higher the prescan cutoff, fewer regions will be considered. Must > 1. Default: 1.2",
help = "The fold change cutoff for prescanning candidate regions in the whole dataset. Then we will use HMM to predict states on these candidate regions. Higher the prescan cutoff, fewer regions will be considered. Must > 1. Default: 1.2",
default = 1.2 )

group_call.add_argument( "--minlen", dest = "openregion_minlen", type = int,
Expand Down
Loading

0 comments on commit 77ffc3c

Please sign in to comment.