4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
# File 'lib/finishm/assemble.rb', line 4
def add_options(optparse_object, options)
optparse_object.banner = "\nUsage: finishm assemble --assemble-from <node_shorthand> --output-contigs <output.fa> <assembly_definition>
Assemble
\n\n"
options.merge!({
:output_pathspec => false,
:progressbar => true,
:min_contig_size => 500,
:bubbly => false,
:max_tip_length => Bio::AssemblyGraphAlgorithms::BubblyAssembler::DEFAULT_MAX_TIP_LENGTH,
:max_bubble_length => Bio::AssemblyGraphAlgorithms::BubblyAssembler::DEFAULT_MAX_BUBBLE_LENGTH,
:bubble_node_count_limit => Bio::AssemblyGraphAlgorithms::BubblyAssembler::DEFAULT_BUBBLE_NODE_COUNT_LIMIT,
:min_confirming_recoherence_kmer_reads => Bio::AssemblyGraphAlgorithms::SingleEndedAssembler::DEFAULT_MIN_CONFIRMING_RECOHERENCE_READS,
})
optparse_object.separator "\nRequired arguments:\n\n"
optparse_object.on("--output-contigs PATH", "Output found paths to this file in fasta format [required]") do |arg|
options[:output_trails_file] = arg
end
optparse_object.separator "\nThere must be some definition of reads too:\n\n" Bio::FinishM::ReadInput.new.add_options(optparse_object, options)
optparse_object.separator "\nOptional arguments:\n\n"
optparse_object.on("--assemble-from SHORTHAND", "Specify the node and direction to start assembing from e.g. '3s' to start forward from node 3, '4e' to start reverse from node 4 [default: assemble the entire graph]") do |arg|
unless arg.match(/^\d+[se]+/)
raise "Unable to parse node shorthand #{arg}"
end
options[:initial_node_shorthand] = arg
end
optparse_object.on("--recoherence-kmer LENGTH", Integer, "When paths diverge, try to rescue by using a bigger kmer of this length [default: none]") do |arg|
options[:recoherence_kmer] = arg
end
optparse_object.on("--recoherence-min-reads NUM", Integer, "Number of reads required to agree with recoherence [default: #{options[:min_confirming_recoherence_kmer_reads] } (when --recoherence-kmer is specified)]") do |arg|
options[:min_confirming_recoherence_kmer_reads] = arg
end
optparse_object.on("--max-tip-length LENGTH", Integer, "Maximum length of 'tip' in assembly graph to ignore [default: #{options[:max_tip_length] }]") do |arg|
options[:max_tip_length] = arg
end
optparse_object.on("--bubbly", "Assemble with the bubbly method [default: #{options[:bubbly] }]") do
options[:bubbly] = true
end
optparse_object.on("--max-bubble-size NUM", Integer, "Max bubble size available for bubbly method [default: #{options[:max_bubble_length] }]") do |arg|
options[:max_bubble_length] = arg
end
optparse_object.on("--max-bubble-complexity NUM", Integer, "Max number of nodes in a bubble to explore before giving up (0 for infinite) [default: #{options[:bubble_node_count_limit] }]") do |arg|
if arg == 0
options[:bubble_node_count_limit] = nil
else
options[:bubble_node_count_limit] = arg
end
end
optparse_object.on("--output-pathspec", "Give the sequence of nodes used in the path in the output contig file [default: #{options[:output_pathspec] }]") do
options[:output_pathspec] = true
end
optparse_object.on("--output-contig-stats FILE", "Output stats about each contig to this file [default: don't output anything]") do |arg|
options[:output_stats] = arg
end
optparse_object.on("--no-progressbar", "Don't show a progress bar [default: do show one unless --assemble-from is specified]") do
options[:progressbar] = false
end
optparse_object.on("--min-contig-length LENGTH",Integer,"Don't print contigs shorter than this [default: #{options[:min_contig_size] }]") do |arg|
options[:min_contig_size] = arg
end
optparse_object.on("--min-starting-node-coverage COVERAGE",Float,"Only start exploring from nodes with at least this much coverage [default: start from all nodes]") do |arg|
options[:min_coverage_of_start_nodes] = arg
end
optparse_object.on("--min-starting-node-length LENGTH",Integer,"Only start exploring from nodes with at least this length [default: start from all nodes]") do |arg|
options[:min_length_of_start_nodes] = arg
end
optparse_object.on("--max-coverage-at-fork COVERAGE",Float,"When reached a fork, don't take paths with more than this much coverage [default: not applied]") do |arg|
options[:max_coverage_at_fork] = arg
end
optparse_object.on("--badformat FILE", "Output contigs in badformat file") do |arg|
options[:output_badformat_file] = arg
end
optparse_object.on("--debug", "Build the graph, then drop to a pry console. [default: #{options[:debug] }]") do
options[:debug] = true
end
Bio::FinishM::GraphGenerator.new.add_options optparse_object, options
end
|