Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix bug in --baum-welch option of train_seqstructhmm (increase versio…
…n to 1.07)
  • Loading branch information
heller committed Jun 28, 2018
1 parent ef8d3e8 commit cfa3231
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions bin/train_seqstructhmm
Expand Up @@ -31,8 +31,8 @@ def parseArguments(args):
help='FASTA file with RNA structures for training')
parser.add_argument('--motif_length', '-n', type=int, default = 6,
help='length of the motif that shall be found (default: 6)')
parser.add_argument('--baum_welch', '-b', action='store_true', default = True,
help='should the model be initialized with a Baum-Welch optimized sequence motif (default: yes)')
parser.add_argument('--random', '-r', action='store_true',
help='Initialize the model randomly (default: initialize with Baum-Welch optimized sequence motif)')
parser.add_argument('--flexibility', '-f', type=int, default = 10,
help='greedyness of Gibbs sampler: model parameters are sampled from among the top f configurations (default: f=10), set f to 0 in order to include all possible configurations')
parser.add_argument('--block_size', '-s', type=int, default = 1,
Expand Down Expand Up @@ -66,7 +66,7 @@ def main(args):
main_logger.info("Call: %s", " ".join(args))
main_logger.info("Chosen options:")
main_logger.info("Motif Length: %s", options.motif_length)
main_logger.info("Baum-Welch initialization: %s", "on" if options.baum_welch else "off")
main_logger.info("Baum-Welch initialization: %s", "off" if options.random else "on")
main_logger.info("Flexibility: top %s configurations", options.flexibility)
main_logger.info("Block size: %s", options.block_size)
main_logger.info("Termination threshold: %s", options.threshold)
Expand All @@ -83,12 +83,12 @@ def main(args):
#Initialize model
model = SeqStructHMM(job_directory, main_logger, numbers_logger, training_sequence_container, options.motif_length,
options.flexibility, options.block_size)
if options.baum_welch:
if options.random:
model.prepare_model_randomly()
else:
best_baumwelch_sequence_model = seq_hmm.find_best_baumwelch_sequence_models(options.motif_length, training_sequence_container, main_logger)
best_viterbi_paths = best_baumwelch_sequence_model[1]
model.prepare_model_with_viterbi(best_viterbi_paths)
else:
model.prepare_model_randomly()
main_logger.info('Completed initialisation. Begin training..')

#Train model
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -4,7 +4,7 @@
long_description = """RNA-binding proteins (RBPs) play a vital role in the post-transcriptional control of RNAs. They are known to recognize RNA molecules by their nucleotide sequence as well as their three-dimensional structure. ssHMM is an RNA motif finder that combines a hidden Markov model (HMM) with Gibbs sampling to learn the joint sequence and structure binding preferences of RBPs from high-throughput RNA-binding experiments, such as CLIP-Seq. The model can be visualized as an intuitive graph illustrating the interplay between RNA sequence and structure."""

setup(name='sshmm',
version='1.0.6',
version='1.0.7',
description='A sequence-structure hidden Markov model for the analysis of RNA-binding protein data.',
long_description=long_description,
url='https://github.molgen.mpg.de/heller/ssHMM',
Expand Down

0 comments on commit cfa3231

Please sign in to comment.