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

add --extreme_ploidies flag #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions exec/smudgeplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def plot(self):
argparser.add_argument('-L', help='The lower boundary used when dumping kmers (default min(total_pair_cov) / 2).', type=int, default=0)
argparser.add_argument('-n', help='The expected haploid coverage (default estimated from data).', type=float, default=0)
argparser.add_argument('-t', '--title', help='name printed at the top of the smudgeplot (default none).', default='')
argparser.add_argument('-e', '--extreme_ploidies', help='Allow very high ploidies, at the cost of speed.', action='store_true')
# argparser.add_argument('-m', '-method', help='The algorithm for annotation of smudges (default \'local_aggregation\')', default='local_aggregation')
argparser.add_argument('-nbins', help='The number of nbins used for smudgeplot matrix (nbins x nbins) (default autodetection).', type=int, default=0)
argparser.add_argument('-k', help='The length of the kmer.', default=21)
Expand Down Expand Up @@ -337,6 +338,8 @@ def main():
plot_args += " -n " + str(args.n)
if args.title:
plot_args += " -t \"" + args.title + "\""
if args.extreme_ploidies:
plot_args += " -e "
if args.nbins != 0:
plot_args += " -nbins " + str(args.nbins)
if args.homozygous:
Expand Down
3 changes: 2 additions & 1 deletion exec/smudgeplot_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ parser$add_argument("-nbins", type = "integer",
help="the number of nbins used for smudgeplot matrix (nbins x nbins) [default autodetection]")
parser$add_argument("-k", "--kmer_size", type = "integer", default = 21,
help="The kmer size used to calculate kmer spectra [default 21]")
parser$add_argument("-e", "--extreme_ploidies", action="store_true", help="Expect extremely high ploidies at the cost of speed.")

args <- parser$parse_args()

Expand Down Expand Up @@ -68,7 +69,7 @@ smudge_summary$n_subset_est <- round(estimate_1n_coverage_1d_subsets(total_pair_

draft_n <- ifelse(length(args$n_cov) == 0, smudge_summary$n_subset_est, args$n_cov)

ymax <- min(10*draft_n, max(total_pair_cov))
ymax <- ifelse(args$extreme_ploidies, max(total_pair_cov), min(10*draft_n, max(total_pair_cov)))
ymin <- min(total_pair_cov) - 1

smudge_warn(args$output, "\n#############")
Expand Down