<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="generator" content="pandoc" /> <meta http-equiv="X-UA-Compatible" content="IE=EDGE" /> <meta name="author" content="Ruqian Lyu" /> <title>Crossover-identification-with-sgcocaller-and-comapr</title> <script src="site_libs/header-attrs-2.11/header-attrs.js"></script> <script src="site_libs/jquery-3.6.0/jquery-3.6.0.min.js"></script> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link href="site_libs/bootstrap-3.3.5/css/journal.min.css" rel="stylesheet" /> <script src="site_libs/bootstrap-3.3.5/js/bootstrap.min.js"></script> <script src="site_libs/bootstrap-3.3.5/shim/html5shiv.min.js"></script> <script src="site_libs/bootstrap-3.3.5/shim/respond.min.js"></script> <style>h1 {font-size: 34px;} h1.title {font-size: 38px;} h2 {font-size: 30px;} h3 {font-size: 24px;} h4 {font-size: 18px;} h5 {font-size: 16px;} h6 {font-size: 12px;} code {color: inherit; background-color: rgba(0, 0, 0, 0.04);} pre:not([class]) { background-color: white }</style> <script src="site_libs/jqueryui-1.11.4/jquery-ui.min.js"></script> <link href="site_libs/tocify-1.9.1/jquery.tocify.css" rel="stylesheet" /> <script src="site_libs/tocify-1.9.1/jquery.tocify.js"></script> <script src="site_libs/navigation-1.1/tabsets.js"></script> <script src="site_libs/navigation-1.1/codefolding.js"></script> <link href="site_libs/font-awesome-5.1.0/css/all.css" rel="stylesheet" /> <link href="site_libs/font-awesome-5.1.0/css/v4-shims.css" rel="stylesheet" /> <link rel="icon" href="https://github.com/workflowr/workflowr-assets/raw/master/img/reproducible.png"> <!-- Add a small amount of space between sections. --> <style type="text/css"> div.section { padding-top: 12px; } </style> <style type="text/css"> code{white-space: pre-wrap;} span.smallcaps{font-variant: small-caps;} span.underline{text-decoration: underline;} div.column{display: inline-block; vertical-align: top; width: 50%;} div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;} ul.task-list{list-style: none;} </style> <style type="text/css"> code { white-space: pre; } .sourceCode { overflow: visible; } </style> <style type="text/css" data-origin="pandoc"> pre > code.sourceCode { white-space: pre; position: relative; } pre > code.sourceCode > span { display: inline-block; line-height: 1.25; } pre > code.sourceCode > span:empty { height: 1.2em; } .sourceCode { overflow: visible; } code.sourceCode > span { color: inherit; text-decoration: inherit; } div.sourceCode { margin: 1em 0; } pre.sourceCode { margin: 0; } @media screen { div.sourceCode { overflow: auto; } } @media print { pre > code.sourceCode { white-space: pre-wrap; } pre > code.sourceCode > span { text-indent: -5em; padding-left: 5em; } } pre.numberSource code { counter-reset: source-line 0; } pre.numberSource code > span { position: relative; left: -4em; counter-increment: source-line; } pre.numberSource code > span > a:first-child::before { content: counter(source-line); position: relative; left: -1em; text-align: right; vertical-align: baseline; border: none; display: inline-block; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; padding: 0 4px; width: 4em; color: #aaaaaa; } pre.numberSource { margin-left: 3em; border-left: 1px solid #aaaaaa; padding-left: 4px; } div.sourceCode { } @media screen { pre > code.sourceCode > span > a:first-child::before { text-decoration: underline; } } code span.al { color: #ff0000; font-weight: bold; } /* Alert */ code span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Annotation */ code span.at { color: #7d9029; } /* Attribute */ code span.bn { color: #40a070; } /* BaseN */ code span.bu { } /* BuiltIn */ code span.cf { color: #007020; font-weight: bold; } /* ControlFlow */ code span.ch { color: #4070a0; } /* Char */ code span.cn { color: #880000; } /* Constant */ code span.co { color: #60a0b0; font-style: italic; } /* Comment */ code span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */ code span.do { color: #ba2121; font-style: italic; } /* Documentation */ code span.dt { color: #902000; } /* DataType */ code span.dv { color: #40a070; } /* DecVal */ code span.er { color: #ff0000; font-weight: bold; } /* Error */ code span.ex { } /* Extension */ code span.fl { color: #40a070; } /* Float */ code span.fu { color: #06287e; } /* Function */ code span.im { } /* Import */ code span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */ code span.kw { color: #007020; font-weight: bold; } /* Keyword */ code span.op { color: #666666; } /* Operator */ code span.ot { color: #007020; } /* Other */ code span.pp { color: #bc7a00; } /* Preprocessor */ code span.sc { color: #4070a0; } /* SpecialChar */ code span.ss { color: #bb6688; } /* SpecialString */ code span.st { color: #4070a0; } /* String */ code span.va { color: #19177c; } /* Variable */ code span.vs { color: #4070a0; } /* VerbatimString */ code span.wa { color: #60a0b0; font-weight: bold; font-style: italic; } /* Warning */ .sourceCode .row { width: 100%; } .sourceCode { overflow-x: auto; } .code-folding-btn { margin-right: -30px; } </style> <script> // apply pandoc div.sourceCode style to pre.sourceCode instead (function() { var sheets = document.styleSheets; for (var i = 0; i < sheets.length; i++) { if (sheets[i].ownerNode.dataset["origin"] !== "pandoc") continue; try { var rules = sheets[i].cssRules; } catch (e) { continue; } for (var j = 0; j < rules.length; j++) { var rule = rules[j]; // check if there is a div.sourceCode rule if (rule.type !== rule.STYLE_RULE || rule.selectorText !== "div.sourceCode") continue; var style = rule.style.cssText; // check if color or background-color is set if (rule.style.color === '' && rule.style.backgroundColor === '') continue; // replace div.sourceCode by a pre.sourceCode rule sheets[i].deleteRule(j); sheets[i].insertRule('pre.sourceCode{' + style + '}', j); } } })(); </script> <style type="text/css"> /* for pandoc --citeproc since 2.11 */ div.csl-bib-body { } div.csl-entry { clear: both; } .hanging div.csl-entry { margin-left:2em; text-indent:-2em; } div.csl-left-margin { min-width:2em; float:left; } div.csl-right-inline { margin-left:2em; padding-left:1em; } div.csl-indent { margin-left: 2em; } </style> <style type = "text/css"> .main-container { max-width: 940px; margin-left: auto; margin-right: auto; } img { max-width:100%; } .tabbed-pane { padding-top: 12px; } .html-widget { margin-bottom: 20px; } button.code-folding-btn:focus { outline: none; } summary { display: list-item; } pre code { padding: 0; } </style> <style type="text/css"> .dropdown-submenu { position: relative; } .dropdown-submenu>.dropdown-menu { top: 0; left: 100%; margin-top: -6px; margin-left: -1px; border-radius: 0 6px 6px 6px; } .dropdown-submenu:hover>.dropdown-menu { display: block; } .dropdown-submenu>a:after { display: block; content: " "; float: right; width: 0; height: 0; border-color: transparent; border-style: solid; border-width: 5px 0 5px 5px; border-left-color: #cccccc; margin-top: 5px; margin-right: -10px; } .dropdown-submenu:hover>a:after { border-left-color: #adb5bd; } .dropdown-submenu.pull-left { float: none; } .dropdown-submenu.pull-left>.dropdown-menu { left: -100%; margin-left: 10px; border-radius: 6px 0 6px 6px; } </style> <script type="text/javascript"> // manage active state of menu based on current page $(document).ready(function () { // active menu anchor href = window.location.pathname href = href.substr(href.lastIndexOf('/') + 1) if (href === "") href = "index.html"; var menuAnchor = $('a[href="' + href + '"]'); // mark it active menuAnchor.tab('show'); // if it's got a parent navbar menu mark it active as well menuAnchor.closest('li.dropdown').addClass('active'); // Navbar adjustments var navHeight = $(".navbar").first().height() + 15; var style = document.createElement('style'); var pt = "padding-top: " + navHeight + "px; "; var mt = "margin-top: -" + navHeight + "px; "; var css = ""; // offset scroll position for anchor links (for fixed navbar) for (var i = 1; i <= 6; i++) { css += ".section h" + i + "{ " + pt + mt + "}\n"; } style.innerHTML = "body {" + pt + "padding-bottom: 40px; }\n" + css; document.head.appendChild(style); }); </script> <!-- tabsets --> <style type="text/css"> .tabset-dropdown > .nav-tabs { display: inline-table; max-height: 500px; min-height: 44px; overflow-y: auto; border: 1px solid #ddd; border-radius: 4px; } .tabset-dropdown > .nav-tabs > li.active:before { content: ""; font-family: 'Glyphicons Halflings'; display: inline-block; padding: 10px; border-right: 1px solid #ddd; } .tabset-dropdown > .nav-tabs.nav-tabs-open > li.active:before { content: ""; border: none; } .tabset-dropdown > .nav-tabs.nav-tabs-open:before { content: ""; font-family: 'Glyphicons Halflings'; display: inline-block; padding: 10px; border-right: 1px solid #ddd; } .tabset-dropdown > .nav-tabs > li.active { display: block; } .tabset-dropdown > .nav-tabs > li > a, .tabset-dropdown > .nav-tabs > li > a:focus, .tabset-dropdown > .nav-tabs > li > a:hover { border: none; display: inline-block; border-radius: 4px; background-color: transparent; } .tabset-dropdown > .nav-tabs.nav-tabs-open > li { display: block; float: none; } .tabset-dropdown > .nav-tabs > li { display: none; } </style> <!-- code folding --> <style type="text/css"> .code-folding-btn { margin-bottom: 4px; } </style> <style type="text/css"> #TOC { margin: 25px 0px 20px 0px; } @media (max-width: 768px) { #TOC { position: relative; width: 100%; } } @media print { .toc-content { /* see https://github.com/w3c/csswg-drafts/issues/4434 */ float: right; } } .toc-content { padding-left: 30px; padding-right: 40px; } div.main-container { max-width: 1200px; } div.tocify { width: 20%; max-width: 260px; max-height: 85%; } @media (min-width: 768px) and (max-width: 991px) { div.tocify { width: 25%; } } @media (max-width: 767px) { div.tocify { width: 100%; max-width: none; } } .tocify ul, .tocify li { line-height: 20px; } .tocify-subheader .tocify-item { font-size: 0.90em; } .tocify .list-group-item { border-radius: 0px; } </style> </head> <body> <div class="container-fluid main-container"> <!-- setup 3col/9col grid for toc_float and main content --> <div class="row"> <div class="col-xs-12 col-sm-4 col-md-3"> <div id="TOC" class="tocify"> </div> </div> <div class="toc-content col-xs-12 col-sm-8 col-md-9"> <div class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="index.html">Crossover-calling-single-gamete-mouse</a> </div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li> <a href="index.html">Home</a> </li> <li> <a href="about.html">About</a> </li> <li> <a href="license.html">License</a> </li> </ul> <ul class="nav navbar-nav navbar-right"> <li> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing"> <span class="fa fa-github"></span> </a> </li> </ul> </div><!--/.nav-collapse --> </div><!--/.container --> </div><!--/.navbar --> <div id="header"> <div class="btn-group pull-right float-right"> <button type="button" class="btn btn-default btn-xs btn-secondary btn-sm dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span>Code</span> <span class="caret"></span></button> <ul class="dropdown-menu dropdown-menu-right" style="min-width: 50px;"> <li><a id="rmd-show-all-code" href="#">Show All Code</a></li> <li><a id="rmd-hide-all-code" href="#">Hide All Code</a></li> </ul> </div> <h1 class="title toc-ignore">Crossover-identification-with-sgcocaller-and-comapr</h1> <h4 class="author">Ruqian Lyu</h4> </div> <p> <button type="button" class="btn btn-default btn-workflowr btn-workflowr-report" data-toggle="collapse" data-target="#workflowr-report"> <span class="glyphicon glyphicon-list" aria-hidden="true"></span> workflowr <span class="glyphicon glyphicon-exclamation-sign text-danger" aria-hidden="true"></span> </button> </p> <div id="workflowr-report" class="collapse"> <ul class="nav nav-tabs"> <li class="active"> <a data-toggle="tab" href="#summary">Summary</a> </li> <li> <a data-toggle="tab" href="#checks"> Checks <span class="glyphicon glyphicon-exclamation-sign text-danger" aria-hidden="true"></span> </a> </li> <li> <a data-toggle="tab" href="#versions">Past versions</a> </li> </ul> <div class="tab-content"> <div id="summary" class="tab-pane fade in active"> <p> <strong>Last updated:</strong> 2022-01-10 </p> <p> <strong>Checks:</strong> <span class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span> 5 <span class="glyphicon glyphicon-exclamation-sign text-danger" aria-hidden="true"></span> 2 </p> <p> <strong>Knit directory:</strong> <code>Hinch2019/</code> <span class="glyphicon glyphicon-question-sign" aria-hidden="true" title="This is the local directory in which the code in this file was executed."> </span> </p> <p> This reproducible <a href="http://rmarkdown.rstudio.com">R Markdown</a> analysis was created with <a href="https://github.com/jdblischak/workflowr">workflowr</a> (version 1.6.2). The <em>Checks</em> tab describes the reproducibility checks that were applied when the results were created. The <em>Past versions</em> tab lists the development history. </p> <hr> </div> <div id="checks" class="tab-pane fade"> <div id="workflowr-checks" class="panel-group"> <div class="panel panel-default"> <div class="panel-heading"> <p class="panel-title"> <a data-toggle="collapse" data-parent="#workflowr-checks" href="#strongRMarkdownfilestronguncommittedchanges"> <span class="glyphicon glyphicon-exclamation-sign text-danger" aria-hidden="true"></span> <strong>R Markdown file:</strong> uncommitted changes </a> </p> </div> <div id="strongRMarkdownfilestronguncommittedchanges" class="panel-collapse collapse"> <div class="panel-body"> <p>The R Markdown file has unstaged changes. To know which version of the R Markdown file created these results, you’ll want to first commit it to the Git repo. If you’re still working on the analysis, you can ignore this warning. When you’re finished, you can run <code>wflow_publish</code> to commit the R Markdown file and build the HTML.</p> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <p class="panel-title"> <a data-toggle="collapse" data-parent="#workflowr-checks" href="#strongEnvironmentstrongempty"> <span class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span> <strong>Environment:</strong> empty </a> </p> </div> <div id="strongEnvironmentstrongempty" class="panel-collapse collapse"> <div class="panel-body"> <p>Great job! The global environment was empty. Objects defined in the global environment can affect the analysis in your R Markdown file in unknown ways. For reproduciblity it’s best to always run the code in an empty environment.</p> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <p class="panel-title"> <a data-toggle="collapse" data-parent="#workflowr-checks" href="#strongSeedstrongcodesetseed20220102code"> <span class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span> <strong>Seed:</strong> <code>set.seed(20220102)</code> </a> </p> </div> <div id="strongSeedstrongcodesetseed20220102code" class="panel-collapse collapse"> <div class="panel-body"> <p>The command <code>set.seed(20220102)</code> was run prior to running the code in the R Markdown file. Setting a seed ensures that any results that rely on randomness, e.g. subsampling or permutations, are reproducible.</p> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <p class="panel-title"> <a data-toggle="collapse" data-parent="#workflowr-checks" href="#strongSessioninformationstrongrecorded"> <span class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span> <strong>Session information:</strong> recorded </a> </p> </div> <div id="strongSessioninformationstrongrecorded" class="panel-collapse collapse"> <div class="panel-body"> <p>Great job! Recording the operating system, R version, and package versions is critical for reproducibility.</p> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <p class="panel-title"> <a data-toggle="collapse" data-parent="#workflowr-checks" href="#strongCachestrongnone"> <span class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span> <strong>Cache:</strong> none </a> </p> </div> <div id="strongCachestrongnone" class="panel-collapse collapse"> <div class="panel-body"> <p>Nice! There were no cached chunks for this analysis, so you can be confident that you successfully produced the results during this run.</p> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <p class="panel-title"> <a data-toggle="collapse" data-parent="#workflowr-checks" href="#strongFilepathsstrongabsolute"> <span class="glyphicon glyphicon-exclamation-sign text-danger" aria-hidden="true"></span> <strong>File paths:</strong> absolute </a> </p> </div> <div id="strongFilepathsstrongabsolute" class="panel-collapse collapse"> <div class="panel-body"> <p> Using absolute paths to the files within your workflowr project makes it difficult for you and others to run your code on a different machine. Change the absolute path(s) below to the suggested relative path(s) to make your code more reproducible. </p> <table class="table table-condensed table-hover"> <thead> <tr> <th style="text-align:left;"> absolute </th> <th style="text-align:left;"> relative </th> </tr> </thead> <tbody> <tr> <td style="text-align:left;"> /mnt/beegfs/mccarthy/scratch/general/Datasets/Hinch2019/ </td> <td style="text-align:left;"> . </td> </tr> </tbody> </table> </div> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <p class="panel-title"> <a data-toggle="collapse" data-parent="#workflowr-checks" href="#strongRepositoryversionstrongahrefhttpsgitlabsvieduaubiocellgenpublichinchsinglespermDNAseqprocessingtreec9092bedad3f751962d2c8a34dfad9068d146ca0targetblankc9092bea"> <span class="glyphicon glyphicon-ok text-success" aria-hidden="true"></span> <strong>Repository version:</strong> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/tree/c9092bedad3f751962d2c8a34dfad9068d146ca0" target="_blank">c9092be</a> </a> </p> </div> <div id="strongRepositoryversionstrongahrefhttpsgitlabsvieduaubiocellgenpublichinchsinglespermDNAseqprocessingtreec9092bedad3f751962d2c8a34dfad9068d146ca0targetblankc9092bea" class="panel-collapse collapse"> <div class="panel-body"> <p> Great! You are using Git for version control. Tracking code development and connecting the code version to the results is critical for reproducibility. </p> <p> The results in this page were generated with repository version <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/tree/c9092bedad3f751962d2c8a34dfad9068d146ca0" target="_blank">c9092be</a>. See the <em>Past versions</em> tab to see a history of the changes made to the R Markdown and HTML files. </p> <p> Note that you need to be careful to ensure that all relevant files for the analysis have been committed to Git prior to generating the results (you can use <code>wflow_publish</code> or <code>wflow_git_commit</code>). workflowr only checks the R Markdown file, but you know if there are other scripts or data files that it depends on. Below is the status of the Git repository when the results were generated: </p> <pre><code> Ignored files: Ignored: .Rhistory Ignored: .Rproj.user/ Untracked files: Untracked: .Renviron Untracked: .gitignore Untracked: .snakemake/ Untracked: Hinch2019.Rproj Untracked: Rplots.pdf Untracked: Snakefile_hc.log.out Untracked: Snakefile_hinch.log.out Untracked: Snakefile_plotDia.log.out Untracked: Snakefile_scale.log.out Untracked: Snakefile_sgcocaller.log.out Untracked: SraRunTable_hinch.txt Untracked: _workflowr.yml Untracked: analysis/figure/ Untracked: benchmarks/ Untracked: code/ Untracked: data/ Untracked: debugSwphase/ Untracked: e.nimq Untracked: envs/ Untracked: fastp.html Untracked: fastp.json Untracked: log/ Untracked: output/ Untracked: reduceSNPsRunPhase.log.out Untracked: references/ Untracked: runPhase.log.out Untracked: run_phase.snk Untracked: run_phase_reducedSNPs.snk Untracked: run_phase_usingEntireReads.snk Untracked: run_plot_diagnostic.snk Untracked: run_scalability.snk Untracked: run_swphase.snk Untracked: runsFilterHC.out Untracked: sampleNames.txt Untracked: sbatchTest.sh Untracked: sgcocaller/ Untracked: slurm-100266.out Untracked: slurm-100267.out Untracked: slurm-100326.out Untracked: srr_failed.txt Untracked: submit-runPhase.sh Untracked: submit-runPhaseEntireReads.sh Untracked: submit-runPhaseReduceSNPs.sh Untracked: submit-runPlot.sh Untracked: submit-runScale.sh Untracked: submit-runSgcocaller.sh Untracked: submit-runSwPhaseLargeBinsize.sh Untracked: submit-subsample.sh Untracked: submit-tagCBMerge.sh Untracked: success.txt Untracked: tagCBandMerge.snk Untracked: tagMergeCB.log.out Unstaged changes: Modified: analysis/Crossover-identification-with-sscocaller-and-comapr.Rmd Modified: analysis/index.Rmd Modified: analysis/rejy.bib Modified: run_alignment.snk Modified: run_sscocaller.snk Modified: run_vcalling.snk Modified: sampleNames_meta.txt Modified: submit-mergeBams.sh Modified: submit-runDenovoVC.sh Modified: submit-wgetSRAFastqdump.sh </code></pre> <p> Note that any generated files, e.g. HTML, png, CSS, etc., are not included in this status report because it is ok for generated content to have uncommitted changes. </p> </div> </div> </div> </div> <hr> </div> <div id="versions" class="tab-pane fade"> <p> These are the previous versions of the repository in which changes were made to the R Markdown (<code>analysis/Crossover-identification-with-sscocaller-and-comapr.Rmd</code>) and HTML (<code>public/Crossover-identification-with-sscocaller-and-comapr.html</code>) files. If you’ve configured a remote Git repository (see <code>?wflow_git_remote</code>), click on the hyperlinks in the table below to view the files as they were in that past version. </p> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> File </th> <th> Version </th> <th> Author </th> <th> Date </th> <th> Message </th> </tr> </thead> <tbody> <tr> <td> Rmd </td> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/5ccd8cb8fc4659b452d1a6f4449da2b5d03ae434/analysis/Crossover-identification-with-sscocaller-and-comapr.Rmd" target="_blank">5ccd8cb</a> </td> <td> rlyu </td> <td> 2021-12-17 </td> <td> update readme </td> </tr> <tr> <td> html </td> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/a5f11c9c9e71b4c9cdae10b3930a48a292825fe2/public/Crossover-identification-with-sscocaller-and-comapr.html" target="_blank">a5f11c9</a> </td> <td> rlyu </td> <td> 2021-05-25 </td> <td> update hinch dataset analysis report </td> </tr> <tr> <td> html </td> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/b017d7f95f384fe9c718236a1621b9e571f9a218/public/Crossover-identification-with-sscocaller-and-comapr.html" target="_blank">b017d7f</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> <td> update analysis rmd </td> </tr> <tr> <td> html </td> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/625fb5bbd8df452c3367fb6f53cf39530fe8c023/public/Crossover-identification-with-sscocaller-and-comapr.html" target="_blank">625fb5b</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> <td> add html </td> </tr> </tbody> </table> </div> <hr> </div> </div> </div> <div id="introduction" class="section level2"> <h2>Introduction</h2> <p>We will demonstrate the usage of <a href="https://gitlab.svi.edu.au/biocellgen-public/sgcocaller"><code>sgcocaller</code></a> and <a href="https://github.com/ruqianl/comapr"><code>comapr</code></a> for identifying and visualizing crossovers regions from single-sperm DNA sequencing dataset.</p> <p><code>sgcocaller</code>(<a href="https://gitlab.svi.edu.au/biocellgen-public/sgcocaller" class="uri">https://gitlab.svi.edu.au/biocellgen-public/sgcocaller</a>) applies a binomial Hidden Markov Model for inferring haplotypes of single sperm genomes from the aligned DNA reads in a BAM file. The inferred haplotype sequence can then be used for calling crossovers by identifying haplotype shifts (see <a href="https://github.com/ruqianl/comapr"><code>comapr</code></a> ).</p> </div> <div id="downloading-example-dataset" class="section level2"> <h2>Downloading example dataset</h2> <p>An individual mouse genetic map was constructed by DNA sequencing of 217 sperm cells from a F1 hybrid mouse (B6 X CAST) <span class="citation">(Hinch et al. 2019)</span>. We will apply <code>sgcocaller</code> on this dataset and it can be downloaded from GEO (Gene Expression Omnibus) with accession <a href="https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE125326">GSE125326</a></p> <p>The slurm submission script <code>submit-wgetSRAFastqdump.sh</code> at <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing.git">repo</a> can be used for downloading the <code>.sra</code> files and dumping them into paired fastq files for each sperm (including two bulk sperm samples).</p> </div> <div id="dataset-preprocessing" class="section level2"> <h2>Dataset preprocessing</h2> <p>The preprocessing steps include read filtering and mapping, subsample reads and append cell barcodes to reads, merge bams, and find informative SNP markers.</p> <div id="alignment" class="section level3"> <h3>1 Alignment</h3> <p>The downloaded fastq files for each sperm cells (and the bulk sperm samples) were aligned to mouse reference genome mm10. The workflow <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing.git"><code>run_alignment.snk</code></a> which is a <a href="https://snakemake.readthedocs.io/en/stable/">Snakemake</a> file that defined steps/rules including</p> <ul> <li>running <a href="https://github.com/OpenGene/fastp"><code>fastp</code></a> for filtering reads and adapter trimming</li> <li>running <a href="https://github.com/lh3/minimap2"><code>minimap2</code></a> for mapping reads to reference genome mm10</li> <li>running GATK MarkDuplicates</li> <li>running GATK AddOrReplaceReadGroup</li> <li>running sorting and indexing bam files using <code>samtools</code></li> </ul> </div> <div id="subsample-reads-and-append-cb-tag" class="section level3"> <h3>2 Subsample reads and append CB tag</h3> <p><code>sgcocaller</code> is designed to process DNA reads with CB (cell barcode) tags from all single sperm cells stored in one BAM file. And to reduce some processing burdens, the mapped reads for each sperm were de-duplicated and subsamples to a fraction of 0.5.</p> <p>In addition, before merging reads from each sperm, the CB (cell barcode, the SRR ID) tag was appended to each DNA read using <a href="https://github.com/ruqianl/appendCB">appendCB</a>. Refer to steps defined in <code>run_subsample.snk</code>.</p> </div> <div id="merge-single-sperm-bam-files-into-one-bam" class="section level3"> <h3>3 Merge single-sperm bam files into one Bam</h3> <p><code>samtools</code> was used for merge CB-taged reads from all single sperm to one BAM file. See <code>submit-mergeBams.sh</code>.</p> </div> <div id="find-informative-snp-markers" class="section level3"> <h3>4 Find informative SNP markers</h3> <p>The informative SNP markers are those SNPs which differ between the two mouse stains that were used to generate the F1 hybrid mouse (CAST and BL6). The following steps were applied which largely align with what has been described in the original paper <span class="citation">(Hinch et al. 2019)</span>.</p> <p>The bulk sperm sample <code>SRR8454653</code> was used for calling de no vo variants for this mouse individual using GATK HaplotypeCaller. Only the HET SNPs with <code>MQ>50</code> AND <code>DP>10</code> AND <code>DP<80</code> were kept. The SNPs were further filtered to only keep the positions which have been called as Homo_alternative <code>CAST_EiJ.mgp.v5.snps.dbSNP142.vcf.gz</code> downloaded from the dbsnp database from Mouse Genome Project<span class="citation">(Keane et al. 2011)</span>.</p> </div> </div> <div id="running-sgcocaller" class="section level2"> <h2>Running sgcocaller</h2> <p>With the DNA reads from each sperm were tagged and merged into one BAM file, we can run <code>sgcocaller</code> for inferring the haplotype states against the list of informative SNP markers for each chromosome in each sperm.</p> <p>The required input files are:</p> <pre><code>mergedBam = "output/alignment/mergedBam/mergedAll.bam", vcfRef="output/variants/denovoVar/SRR8454653.mkdup.sort.rg.filter.snps.castVar.vcf.gz", bcFile="output/alignment/mergedBam/mergedAll.bam.barcodes.txt"</code></pre> <p><code>run_sgcocaller.snk</code> defines the rule for running <code>sgcocaller</code> on each chromosome for sperm cells. The command line was:</p> <pre><code>sgcocaller --threads 4 --chrom "chr1" --chrName chr {input.mergedBam} \ {input.vcfRef} {input.bcFile} --maxTotalReads 150 --maxDP 10 \ sgcocaller/hinch/hinch_ </code></pre> </div> <div id="output-files" class="section level2"> <h2>Output files</h2> <p>The generated output files (for each chromosome, here showing chr1):</p> <ul> <li>hinch_chr1_altCount.mtx, sparse matrix file, containing the alternative allele counts (the CAST alleles)</li> <li>hinch_chr1_totalCount.mtx, sparse matrix file, containing the total allele counts (the CAST + BL6 alleles)</li> <li>hinch_chr1_vi.mtx, sparse matrix file, containing the inferred Viterbi state (haplotype state) for each chromosome against the list of SNP markers in "_snpAnnot.txt".</li> <li>hinch_chr1_viSegInfo.txt, txt file, containing the inferred Viterbi state segments information. Details below</li> <li>hinch_chr1_snpAnnot.txt, txt file, containing the row annotations (SNPs) for the above sparse matrices.</li> </ul> <p><em>Note</em>, the columns in these sparse matrices correspond to cells in the input <code>bcFile</code>.</p> <p>**_viSegInfo.txt** contains summary statistics of inferred Viterbi state segments.</p> <p>A Viterbi segment is defined by a list of consecutive SNPs having the same Viterbi state.</p> <p>The columns in the <code>*_viSegInfo.txt</code> are:</p> <ul> <li>ithSperm,</li> <li>Starting SNP position,</li> <li>Ending SNP position,</li> <li>the number of SNPs supporting the segment</li> <li>the log likelihood ratio of the Viterbi segment</li> <li>the inferred hidden state</li> </ul> <p><strong>log likelihood ratio</strong></p> <p>The loglikelihood ratio is calculated by taking the inferred log likelihood and subtract the reversed log likelihood.</p> <p>For example, the segment with two SNPs in the figure below: <img src="../public/meta_images/ratio_ll.png" /> The numbers in brackets indicating the (alternative allele counts, total allele counts) aligned to the two SNP positions.</p> <p>The inferred log likelihood can be expressed as:</p> <p><span class="math display">\[ inferredLogll = log(Trans_L)+log(dbinom(3,4,0.9))+log(dbinom(4,4,0.9))+log(Trans_R) \]</span> The reversed log likelihood is then:</p> <p><span class="math display">\[ reversedLogll = log(noTrans_L)+log(dbinom(3,4,0.1))+log(dbinom(4,4,0.1))+log(noTrans_R) \]</span> Hence the logllRatio:</p> <p><span class="math display">\[ logllRatio = inferredLogll - reversedLogll \]</span></p> <p>A larger <code>logllRatio</code> indicating we are more confident with the inferred Viterbi states for markers in the segment.</p> </div> <div id="diagnosic-plots" class="section level2"> <h2>Diagnosic plots</h2> <p>The output files from <code>sgcocaller</code> can be directly parsed through <code>readHapState</code> function. However, we have a look at some cell-level metrics and segment-level metrics before we parse the <code>sgcocaller</code> output files.</p> <div id="per-cell-qc" class="section level3"> <h3>Per cell QC</h3> <p>The function <code>perCellQC</code> generates cell-level metrics in a data.frame and the plots in a list.</p> <p>We first identify the relevant file paths:</p> <p><code>dataset_dir</code> is the ouput directory from running <code>sgcocaller</code> and <code>barcodeFile_path</code> points to the file containing the list of cell barcodes.</p> <div class="sourceCode" id="cb3"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb3-1"><a href="#cb3-1" aria-hidden="true" tabindex="-1"></a><span class="fu">suppressPackageStartupMessages</span>({</span> <span id="cb3-2"><a href="#cb3-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">library</span>(comapr)</span> <span id="cb3-3"><a href="#cb3-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">library</span>(ggplot2)</span> <span id="cb3-4"><a href="#cb3-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">library</span>(dplyr)</span> <span id="cb3-5"><a href="#cb3-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">library</span>(Gviz)</span> <span id="cb3-6"><a href="#cb3-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">library</span>(BiocParallel)</span> <span id="cb3-7"><a href="#cb3-7" aria-hidden="true" tabindex="-1"></a> <span class="fu">library</span>(SummarizedExperiment)</span> <span id="cb3-8"><a href="#cb3-8" aria-hidden="true" tabindex="-1"></a>})</span></code></pre></div> <div class="sourceCode" id="cb4"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb4-1"><a href="#cb4-1" aria-hidden="true" tabindex="-1"></a>path_dir <span class="ot"><-</span> <span class="st">"/mnt/beegfs/mccarthy/scratch/general/Datasets/Hinch2019/"</span></span> <span id="cb4-2"><a href="#cb4-2" aria-hidden="true" tabindex="-1"></a>dataset_dir <span class="ot"><-</span> <span class="fu">paste0</span>(path_dir,<span class="st">"output/sgcocaller/hinch/"</span>)</span> <span id="cb4-3"><a href="#cb4-3" aria-hidden="true" tabindex="-1"></a>barcodeFile_path <span class="ot"><-</span><span class="fu">paste0</span>(path_dir,<span class="st">"output/alignment/mergedBam/mergedAll.bam.barcodes.txt"</span>)</span></code></pre></div> <p>We can locate the files and list the files to have a look:</p> <div class="sourceCode" id="cb5"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb5-1"><a href="#cb5-1" aria-hidden="true" tabindex="-1"></a><span class="fu">list.files</span>(<span class="at">path=</span>dataset_dir)[<span class="dv">1</span><span class="sc">:</span><span class="dv">5</span>]</span></code></pre></div> <pre><code>[1] "hinch_chr1_altCount.mtx" "hinch_chr1_snpAnnot.txt" [3] "hinch_chr1_totalCount.mtx" "hinch_chr1_vi.mtx" [5] "hinch_chr1_viSegInfo.txt" </code></pre> <div class="sourceCode" id="cb7"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb7-1"><a href="#cb7-1" aria-hidden="true" tabindex="-1"></a>BiocParallel<span class="sc">::</span><span class="fu">register</span>(BiocParallel<span class="sc">::</span><span class="fu">MulticoreParam</span>(<span class="at">workers =</span> <span class="dv">4</span>))</span> <span id="cb7-2"><a href="#cb7-2" aria-hidden="true" tabindex="-1"></a><span class="co">#BiocParallel::register(BiocParallel::SerialParam())</span></span></code></pre></div> <p>Running <code>perCellChrQC</code> function to find the cell-level statistics:</p> <div class="sourceCode" id="cb8"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb8-1"><a href="#cb8-1" aria-hidden="true" tabindex="-1"></a>pcqc <span class="ot"><-</span> <span class="fu">perCellChrQC</span>(<span class="st">"hinch"</span>,</span> <span id="cb8-2"><a href="#cb8-2" aria-hidden="true" tabindex="-1"></a> <span class="at">chroms=</span><span class="fu">paste0</span>(<span class="st">"chr"</span>,<span class="dv">1</span><span class="sc">:</span><span class="dv">19</span>),</span> <span id="cb8-3"><a href="#cb8-3" aria-hidden="true" tabindex="-1"></a> <span class="at">path=</span>dataset_dir,</span> <span id="cb8-4"><a href="#cb8-4" aria-hidden="true" tabindex="-1"></a> <span class="at">barcodeFile=</span>barcodeFile_path)</span></code></pre></div> <p>The generated scatter plots for selected chromosomes:</p> <div class="sourceCode" id="cb9"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb9-1"><a href="#cb9-1" aria-hidden="true" tabindex="-1"></a>pcqc<span class="sc">$</span>plot</span></code></pre></div> <pre><code>Warning: Transformation introduced infinite values in continuous x-axis</code></pre> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-6-1.png" width="672" style="display: block; margin: auto;" /></p> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-unnamed-chunk-6-1"> Past versions of unnamed-chunk-6-1.png </button> </p> <div id="fig-unnamed-chunk-6-1" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/625fb5bbd8df452c3367fb6f53cf39530fe8c023/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-6-1.png" target="_blank">625fb5b</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> <p>X-axis plots the number of haplotype transitions (<code>nCORaw</code>) for each cell and Y-axis plots the number of total SNPs detected in a cell. A large <code>nCORaw</code> might indicate the cell being a diploid cell included by accident or doublets. Cells with a lower <code>totalSNPs</code> might indicate poor cell quality.</p> <p>A data.frame with cell-level metric is also returned:</p> <div class="sourceCode" id="cb11"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb11-1"><a href="#cb11-1" aria-hidden="true" tabindex="-1"></a>pcqc<span class="sc">$</span>cellQC</span></code></pre></div> <pre><code># A tibble: 3,686 × 4 Chrom totalSNP nCORaw barcode <fct> <int> <dbl> <chr> 1 chr1 217857 22 SRR8454655 2 chr10 158079 27 SRR8454655 3 chr11 141643 10 SRR8454655 4 chr12 141169 3 SRR8454655 5 chr13 140556 17 SRR8454655 6 chr14 127778 16 SRR8454655 7 chr15 112856 5 SRR8454655 8 chr16 121926 6 SRR8454655 9 chr17 111465 6 SRR8454655 10 chr18 118538 8 SRR8454655 # … with 3,676 more rows</code></pre> </div> <div id="persegchrqc" class="section level3"> <h3>perSegChrQC</h3> <p><code>PerSegQC</code> function visualises statistics of inferred haplotype state segments, which helps decide filtering thresholds for removing crossovers that do not have enough evidence by the data and the very close double crossovers which are biologically unlikely.</p> <div class="sourceCode" id="cb13"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb13-1"><a href="#cb13-1" aria-hidden="true" tabindex="-1"></a>psqc <span class="ot"><-</span> <span class="fu">perSegChrQC</span>(<span class="st">"hinch"</span>,<span class="at">chroms=</span><span class="fu">paste0</span>(<span class="st">"chr"</span>,<span class="dv">1</span>),</span> <span id="cb13-2"><a href="#cb13-2" aria-hidden="true" tabindex="-1"></a> <span class="at">path=</span>dataset_dir,</span> <span id="cb13-3"><a href="#cb13-3" aria-hidden="true" tabindex="-1"></a> <span class="at">barcodeFile=</span>barcodeFile_path,</span> <span id="cb13-4"><a href="#cb13-4" aria-hidden="true" tabindex="-1"></a> <span class="at">maxRawCO =</span> <span class="dv">30</span>)</span> <span id="cb13-5"><a href="#cb13-5" aria-hidden="true" tabindex="-1"></a>psqc<span class="sc">+</span><span class="fu">theme_classic</span>()</span></code></pre></div> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-8-1.png" width="672" style="display: block; margin: auto;" /></p> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-unnamed-chunk-8-1"> Past versions of unnamed-chunk-8-1.png </button> </p> <div id="fig-unnamed-chunk-8-1" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/625fb5bbd8df452c3367fb6f53cf39530fe8c023/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-8-1.png" target="_blank">625fb5b</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> </div> </div> <div id="parsing-files-using-comapr" class="section level2"> <h2>Parsing files using <code>comapr</code></h2> <p>Now we have some idea about the features of this dataset, we can read in the files from <code>sgcocaller</code> which can be directly parsed through <code>readHapState</code> function. This function returns a <code>RangedSummarizedExperiment</code> object with <code>rowRanges</code> containing SNP positions that have ever contributed to crossovers in a cell, while <code>colData</code> contains the cell annotations such as barcodes.</p> <p>The following filters have been applied:</p> <ul> <li>Segment level filters: <ul> <li>minSNP=30, the segment that results in one/two crossovers has to have more than 30 SNPs of support</li> <li>minlogllRatio=150, the segment that results in one/two crossovers has to have logllRatio larger than 150.</li> <li>bpDist=1e5, the segment that results in one/two crossovers has to have base pair distances larger than 1e5</li> </ul></li> <li>Cell level filters: <ul> <li>maxRawCO, the maximum number of raw crossovers (the number of state transitions from the _vi.mtx file) for a cell</li> <li>minCellSNP=200, there have to be more than 200 SNPs detected within a cell, otherwise this cell is removed.</li> </ul></li> </ul> <div class="sourceCode" id="cb14"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a>BiocParallel<span class="sc">::</span><span class="fu">register</span>(<span class="fu">SerialParam</span>())</span> <span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a>hinch_rse <span class="ot"><-</span> <span class="fu">readHapState</span>(<span class="at">sampleName =</span> <span class="st">"hinch"</span>,</span> <span id="cb14-3"><a href="#cb14-3" aria-hidden="true" tabindex="-1"></a> <span class="at">path =</span> dataset_dir,</span> <span id="cb14-4"><a href="#cb14-4" aria-hidden="true" tabindex="-1"></a> <span class="at">chrom=</span><span class="fu">paste0</span>(<span class="st">"chr"</span>,<span class="dv">1</span><span class="sc">:</span><span class="dv">19</span>),</span> <span id="cb14-5"><a href="#cb14-5" aria-hidden="true" tabindex="-1"></a> <span class="at">barcodeFile =</span> barcodeFile_path,</span> <span id="cb14-6"><a href="#cb14-6" aria-hidden="true" tabindex="-1"></a> <span class="at">minSNP =</span> <span class="dv">30</span>, <span class="at">minCellSNP =</span> <span class="dv">200</span>,</span> <span id="cb14-7"><a href="#cb14-7" aria-hidden="true" tabindex="-1"></a> <span class="at">maxRawCO =</span> <span class="dv">55</span>,</span> <span id="cb14-8"><a href="#cb14-8" aria-hidden="true" tabindex="-1"></a> <span class="at">minlogllRatio =</span> <span class="dv">150</span>,</span> <span id="cb14-9"><a href="#cb14-9" aria-hidden="true" tabindex="-1"></a> <span class="at">bpDist =</span> <span class="fl">1e5</span>)</span> <span id="cb14-10"><a href="#cb14-10" aria-hidden="true" tabindex="-1"></a><span class="co">#saveRDS(hinch_rse,file = "output/outputR/analysisRDS/hinch_rse.rds")</span></span></code></pre></div> <div class="sourceCode" id="cb15"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb15-1"><a href="#cb15-1" aria-hidden="true" tabindex="-1"></a>BiocParallel<span class="sc">::</span><span class="fu">register</span>(<span class="fu">SerialParam</span>())</span> <span id="cb15-2"><a href="#cb15-2" aria-hidden="true" tabindex="-1"></a>hinch_rse <span class="ot"><-</span> <span class="fu">readRDS</span>(<span class="at">file=</span><span class="st">"output/outputR/analysisRDS/hinch_rse.rds"</span>)</span></code></pre></div> <p>The <code>hinch_rse</code> object:</p> <div class="sourceCode" id="cb16"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb16-1"><a href="#cb16-1" aria-hidden="true" tabindex="-1"></a>hinch_rse</span></code></pre></div> <pre><code>class: RangedSummarizedExperiment dim: 33585 173 metadata(10): ithSperm Seg_start ... bp_dist barcode assays(1): vi_state rownames: NULL rowData names(0): colnames(173): SRR8454655 SRR8454656 ... SRR8454870 SRR8454871 colData names(1): barcodes</code></pre> <p>The <code>rowRanges</code> of <code>hinch_rse</code></p> <div class="sourceCode" id="cb18"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb18-1"><a href="#cb18-1" aria-hidden="true" tabindex="-1"></a>SummarizedExperiment<span class="sc">::</span><span class="fu">rowRanges</span>(hinch_rse)</span></code></pre></div> <pre><code>GRanges object with 33585 ranges and 0 metadata columns: seqnames ranges strand <Rle> <IRanges> <Rle> [1] chr1 3000258 * [2] chr1 3001490 * [3] chr1 3001712 * [4] chr1 3001745 * [5] chr1 3004324 * ... ... ... ... [33581] chr19 61324579 * [33582] chr19 61325233 * [33583] chr19 61325919 * [33584] chr19 61327767 * [33585] chr19 61330760 * ------- seqinfo: 19 sequences from an unspecified genome; no seqlengths</code></pre> <p>The <code>assay</code> slot contains the Viterbi state matrix (SNP by Cell):</p> <div class="sourceCode" id="cb20"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb20-1"><a href="#cb20-1" aria-hidden="true" tabindex="-1"></a>SummarizedExperiment<span class="sc">::</span><span class="fu">assay</span>(hinch_rse)[<span class="dv">1</span><span class="sc">:</span><span class="dv">5</span>,<span class="dv">1</span><span class="sc">:</span><span class="dv">5</span>]</span></code></pre></div> <pre><code>5 x 5 sparse Matrix of class "dgCMatrix" SRR8454655 SRR8454656 SRR8454657 SRR8454658 SRR8454660 [1,] . . . . . [2,] . 2 . . . [3,] . . . . . [4,] 2 . . . . [5,] . . . . .</code></pre> <p><strong>Note</strong> this matrix is more <code>sparse</code> which only contains the SNPs that contribute to crossovers in cells.</p> </div> <div id="samples-group-factor" class="section level2"> <h2>Samples group factor</h2> <p>We have sperm cells from only one individual in this dataset. However, to demonstrate the functions in <code>comapr</code> we split the cells into two groups.</p> <div class="sourceCode" id="cb22"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb22-1"><a href="#cb22-1" aria-hidden="true" tabindex="-1"></a><span class="do">## set the first 80 cells as group1 and rest as group2</span></span> <span id="cb22-2"><a href="#cb22-2" aria-hidden="true" tabindex="-1"></a></span> <span id="cb22-3"><a href="#cb22-3" aria-hidden="true" tabindex="-1"></a><span class="fu">colData</span>(hinch_rse)<span class="sc">$</span>sampleGroup <span class="ot"><-</span> <span class="fu">c</span>(<span class="fu">rep</span>(<span class="st">"Group1"</span>,<span class="fu">ceiling</span>(<span class="fu">ncol</span>(hinch_rse)<span class="sc">/</span><span class="dv">2</span>)),<span class="fu">rep</span>(<span class="st">"Group2"</span>,<span class="fu">ncol</span>(hinch_rse)<span class="sc">-</span><span class="fu">ceiling</span>(<span class="fu">ncol</span>(hinch_rse)<span class="sc">/</span><span class="dv">2</span>)))</span> <span id="cb22-4"><a href="#cb22-4" aria-hidden="true" tabindex="-1"></a></span> <span id="cb22-5"><a href="#cb22-5" aria-hidden="true" tabindex="-1"></a><span class="fu">colData</span>(hinch_rse)</span></code></pre></div> <pre><code>DataFrame with 173 rows and 2 columns barcodes sampleGroup <character> <character> SRR8454655 SRR8454655 Group1 SRR8454656 SRR8454656 Group1 SRR8454657 SRR8454657 Group1 SRR8454658 SRR8454658 Group1 SRR8454660 SRR8454660 Group1 ... ... ... SRR8454863 SRR8454863 Group2 SRR8454864 SRR8454864 Group2 SRR8454867 SRR8454867 Group2 SRR8454870 SRR8454870 Group2 SRR8454871 SRR8454871 Group2</code></pre> <p><em>Note</em> <code>combineHapState</code> can be applied of there are multiple sets of outputs from <code>sgcocaller</code>.</p> </div> <div id="count-crossovers-in-cells" class="section level2"> <h2>Count crossovers in cells</h2> <p>The function <code>countCOs</code> can then be executed to find the crossover intervals and the number of crossovers for each cell within each crossover interval.</p> <div class="sourceCode" id="cb24"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb24-1"><a href="#cb24-1" aria-hidden="true" tabindex="-1"></a>hinch_co_counts <span class="ot"><-</span> <span class="fu">countCOs</span>(hinch_rse)</span></code></pre></div> <p>The SNP intervals list in the rowRanges slot:</p> <div class="sourceCode" id="cb25"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb25-1"><a href="#cb25-1" aria-hidden="true" tabindex="-1"></a><span class="fu">rowRanges</span>(hinch_co_counts)</span></code></pre></div> <pre><code>GRanges object with 2534 ranges and 0 metadata columns: seqnames ranges strand <Rle> <IRanges> <Rle> [1] chr1 13416240-13419295 * [2] chr1 18858161-18861351 * [3] chr1 20068925-20069169 * [4] chr1 25464178-25472637 * [5] chr1 28213896-28218311 * ... ... ... ... [2530] chr19 60044638-60047624 * [2531] chr19 60069152-60070536 * [2532] chr19 60070538-60070663 * [2533] chr19 60070665-60074988 * [2534] chr19 60373837-60375859 * ------- seqinfo: 19 sequences from an unspecified genome; no seqlengths</code></pre> <p>The <code>assay</code> slot of <code>hinch_co_counts</code> contains the number of crossovers per cell per SNP interval:</p> <div class="sourceCode" id="cb27"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb27-1"><a href="#cb27-1" aria-hidden="true" tabindex="-1"></a><span class="fu">assay</span>(hinch_co_counts)[<span class="dv">1</span><span class="sc">:</span><span class="dv">5</span>,<span class="dv">1</span><span class="sc">:</span><span class="dv">5</span>]</span></code></pre></div> <pre><code>DataFrame with 5 rows and 5 columns SRR8454655 SRR8454656 SRR8454657 SRR8454658 SRR8454660 <numeric> <numeric> <numeric> <numeric> <numeric> 1 0 0 0 0 0 2 0 0 0 0 0 3 0 0 0 0 1 4 0 0 0 0 0 5 0 0 0 0 0</code></pre> <div class="sourceCode" id="cb29"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb29-1"><a href="#cb29-1" aria-hidden="true" tabindex="-1"></a><span class="fu">mean</span>(<span class="fu">colSums</span>(<span class="fu">as.matrix</span>(<span class="fu">assay</span>(hinch_co_counts))))</span></code></pre></div> <pre><code>[1] 12.03468</code></pre> </div> <div id="plot-crossover-counts" class="section level2"> <h2>Plot crossover counts</h2> <p>To get the number of crossovers per sperm cell, we just need to sum each column of the matrix in the <code>assay</code> slot. And the <code>plotCount</code> function plots the number of crossovers for each sperm.</p> <div class="sourceCode" id="cb31"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb31-1"><a href="#cb31-1" aria-hidden="true" tabindex="-1"></a><span class="fu">plotCount</span>(hinch_co_counts)<span class="sc">+</span><span class="fu">theme_classic</span>()<span class="sc">+</span></span> <span id="cb31-2"><a href="#cb31-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">scale_color_manual</span>(<span class="at">values =</span> <span class="fu">c</span>(<span class="st">"all"</span><span class="ot">=</span><span class="st">"red"</span>))<span class="sc">+</span><span class="fu">theme_classic</span>(<span class="at">base_size =</span> <span class="dv">25</span>)<span class="sc">+</span></span> <span id="cb31-3"><a href="#cb31-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme</span>(<span class="at">axis.text =</span> <span class="fu">element_text</span>(<span class="at">size =</span> <span class="dv">25</span>),</span> <span id="cb31-4"><a href="#cb31-4" aria-hidden="true" tabindex="-1"></a> <span class="at">axis.title =</span> <span class="fu">element_text</span>(<span class="at">size =</span><span class="dv">25</span>),</span> <span id="cb31-5"><a href="#cb31-5" aria-hidden="true" tabindex="-1"></a> <span class="at">legend.position =</span> <span class="st">"none"</span>,</span> <span id="cb31-6"><a href="#cb31-6" aria-hidden="true" tabindex="-1"></a> <span class="at">axis.text.x =</span> <span class="fu">element_blank</span>(),</span> <span id="cb31-7"><a href="#cb31-7" aria-hidden="true" tabindex="-1"></a> <span class="at">axis.ticks.x =</span> <span class="fu">element_blank</span>())<span class="sc">+</span><span class="fu">ylab</span>(<span class="st">"Crossover counts"</span>)<span class="sc">+</span><span class="fu">xlab</span>(<span class="st">"Mouse sperm cells"</span>)</span></code></pre></div> <pre><code>Scale for 'colour' is already present. Adding another scale for 'colour', which will replace the existing scale.</code></pre> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-19-1.png" width="1200" style="display: block; margin: auto;" /></p> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-unnamed-chunk-19-1"> Past versions of unnamed-chunk-19-1.png </button> </p> <div id="fig-unnamed-chunk-19-1" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/625fb5bbd8df452c3367fb6f53cf39530fe8c023/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-19-1.png" target="_blank">625fb5b</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> <p>Or we can plotCount for each sample group:</p> <div class="sourceCode" id="cb33"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb33-1"><a href="#cb33-1" aria-hidden="true" tabindex="-1"></a><span class="fu">plotCount</span>(hinch_co_counts, <span class="at">group_by =</span> <span class="st">"sampleGroup"</span>)</span></code></pre></div> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-20-1.png" width="672" style="display: block; margin: auto;" /></p> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-unnamed-chunk-20-1"> Past versions of unnamed-chunk-20-1.png </button> </p> <div id="fig-unnamed-chunk-20-1" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/625fb5bbd8df452c3367fb6f53cf39530fe8c023/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-20-1.png" target="_blank">625fb5b</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> <p>In addition, we can also plot the number of crossovers per chromosome (with mean number of crossovers and standard error bar):</p> <div class="sourceCode" id="cb34"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb34-1"><a href="#cb34-1" aria-hidden="true" tabindex="-1"></a><span class="fu">plotCount</span>(hinch_co_counts, ,<span class="at">by_chr =</span> <span class="cn">TRUE</span>)<span class="sc">+</span></span> <span id="cb34-2"><a href="#cb34-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme</span>(<span class="at">axis.text.x =</span> <span class="fu">element_text</span>(<span class="at">angle=</span><span class="dv">90</span>))</span></code></pre></div> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-21-1.png" width="1344" style="display: block; margin: auto;" /></p> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-unnamed-chunk-21-1"> Past versions of unnamed-chunk-21-1.png </button> </p> <div id="fig-unnamed-chunk-21-1" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/a5f11c9c9e71b4c9cdae10b3930a48a292825fe2/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-21-1.png" target="_blank">a5f11c9</a> </td> <td> rlyu </td> <td> 2021-05-25 </td> </tr> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/625fb5bbd8df452c3367fb6f53cf39530fe8c023/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-21-1.png" target="_blank">625fb5b</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> <p>We can also generate bar plot counts of number of crossovers for each chromosome. We can see that for fewer double crossovers were called for smaller chromosomes.</p> <div class="sourceCode" id="cb35"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb35-1"><a href="#cb35-1" aria-hidden="true" tabindex="-1"></a><span class="fu">plotCount</span>(hinch_co_counts,<span class="at">by_chr =</span> <span class="cn">TRUE</span>,</span> <span id="cb35-2"><a href="#cb35-2" aria-hidden="true" tabindex="-1"></a> <span class="at">plot_type =</span><span class="st">"hist"</span>)<span class="sc">+</span><span class="fu">theme_classic</span>(<span class="at">base_size =</span> <span class="dv">22</span>)<span class="sc">+</span><span class="fu">facet_wrap</span>(.<span class="sc">~</span>chr,<span class="at">ncol=</span><span class="dv">8</span>)</span></code></pre></div> <pre><code>`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.</code></pre> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-23-1.png" width="1152" style="display: block; margin: auto;" /></p> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-unnamed-chunk-23-1"> Past versions of unnamed-chunk-23-1.png </button> </p> <div id="fig-unnamed-chunk-23-1" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/b017d7f95f384fe9c718236a1621b9e571f9a218/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-23-1.png" target="_blank">b017d7f</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/625fb5bbd8df452c3367fb6f53cf39530fe8c023/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-23-1.png" target="_blank">625fb5b</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> </div> <div id="plot-snp-density-track" class="section level2"> <h2>Plot SNP density track</h2> <p>The informative SNP markers’ distributions along the chromosome affects the crossover resolutions, therefore it is helpful to visualize the SNP density distribution.</p> <p>We can generate the SNP density DataTrack with function <code>getSNPDensityTrack</code> which returns a <code>DataTrack</code> object from <code>Gviz</code> package.</p> <div class="sourceCode" id="cb37"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb37-1"><a href="#cb37-1" aria-hidden="true" tabindex="-1"></a><span class="do">## log=TRUE, the result after aggregation is returned on a log10 scale</span></span> <span id="cb37-2"><a href="#cb37-2" aria-hidden="true" tabindex="-1"></a></span> <span id="cb37-3"><a href="#cb37-3" aria-hidden="true" tabindex="-1"></a>snp_track_chr10 <span class="ot"><-</span> <span class="fu">getSNPDensityTrack</span>(<span class="at">chrom =</span> <span class="st">"chr10"</span>,</span> <span id="cb37-4"><a href="#cb37-4" aria-hidden="true" tabindex="-1"></a> <span class="at">path_loc =</span> dataset_dir,</span> <span id="cb37-5"><a href="#cb37-5" aria-hidden="true" tabindex="-1"></a> <span class="at">sampleName =</span> <span class="st">"hinch"</span>,</span> <span id="cb37-6"><a href="#cb37-6" aria-hidden="true" tabindex="-1"></a> <span class="at">nwindow =</span> <span class="dv">80</span>,</span> <span id="cb37-7"><a href="#cb37-7" aria-hidden="true" tabindex="-1"></a> <span class="at">log =</span> <span class="cn">TRUE</span>,</span> <span id="cb37-8"><a href="#cb37-8" aria-hidden="true" tabindex="-1"></a> <span class="at">plot_type =</span> <span class="st">"hist"</span>)</span></code></pre></div> <div class="sourceCode" id="cb38"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb38-1"><a href="#cb38-1" aria-hidden="true" tabindex="-1"></a><span class="fu">plotTracks</span>(snp_track_chr10)</span></code></pre></div> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-25-1.png" width="768" style="display: block; margin: auto;" /></p> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-unnamed-chunk-25-1"> Past versions of unnamed-chunk-25-1.png </button> </p> <div id="fig-unnamed-chunk-25-1" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/a5f11c9c9e71b4c9cdae10b3930a48a292825fe2/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-25-1.png" target="_blank">a5f11c9</a> </td> <td> rlyu </td> <td> 2021-05-25 </td> </tr> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/b017d7f95f384fe9c718236a1621b9e571f9a218/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-25-1.png" target="_blank">b017d7f</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/625fb5bbd8df452c3367fb6f53cf39530fe8c023/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-25-1.png" target="_blank">625fb5b</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> <div class="sourceCode" id="cb39"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb39-1"><a href="#cb39-1" aria-hidden="true" tabindex="-1"></a>snp_track_chr10 <span class="ot"><-</span> <span class="fu">setPar</span>(snp_track_chr10,<span class="st">"cex.axis"</span>,<span class="fl">1.5</span>)</span></code></pre></div> <pre><code>Note that the behaviour of the 'setPar' method has changed. You need to reassign the result to an object for the side effects to happen. Pass-by-reference semantic is no longer supported.</code></pre> <p>To change visualisation parameters we can use setPar:</p> <div class="sourceCode" id="cb41"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb41-1"><a href="#cb41-1" aria-hidden="true" tabindex="-1"></a>snp_track_chr10 <span class="ot"><-</span> <span class="fu">setPar</span>(snp_track_chr10,<span class="st">"background.title"</span>,<span class="st">"firebrick"</span>)</span></code></pre></div> <pre><code>Note that the behaviour of the 'setPar' method has changed. You need to reassign the result to an object for the side effects to happen. Pass-by-reference semantic is no longer supported.</code></pre> <div class="sourceCode" id="cb43"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb43-1"><a href="#cb43-1" aria-hidden="true" tabindex="-1"></a><span class="fu">plotTracks</span>(snp_track_chr10)</span></code></pre></div> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-26-1.png" width="768" style="display: block; margin: auto;" /></p> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-unnamed-chunk-26-1"> Past versions of unnamed-chunk-26-1.png </button> </p> <div id="fig-unnamed-chunk-26-1" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/b017d7f95f384fe9c718236a1621b9e571f9a218/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-26-1.png" target="_blank">b017d7f</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> <p>Change aggregation function to “sum”</p> <div class="sourceCode" id="cb44"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb44-1"><a href="#cb44-1" aria-hidden="true" tabindex="-1"></a>snp_track_chr10 <span class="ot"><-</span> <span class="fu">setPar</span>(snp_track_chr10,<span class="st">"aggregation"</span>,<span class="st">"sum"</span>)</span></code></pre></div> <pre><code>Note that the behaviour of the 'setPar' method has changed. You need to reassign the result to an object for the side effects to happen. Pass-by-reference semantic is no longer supported.</code></pre> <div class="sourceCode" id="cb46"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb46-1"><a href="#cb46-1" aria-hidden="true" tabindex="-1"></a><span class="fu">plotTracks</span>(snp_track_chr10)</span></code></pre></div> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-27-1.png" width="768" style="display: block; margin: auto;" /></p> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-unnamed-chunk-27-1"> Past versions of unnamed-chunk-27-1.png </button> </p> <div id="fig-unnamed-chunk-27-1" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/a5f11c9c9e71b4c9cdae10b3930a48a292825fe2/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-27-1.png" target="_blank">a5f11c9</a> </td> <td> rlyu </td> <td> 2021-05-25 </td> </tr> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/625fb5bbd8df452c3367fb6f53cf39530fe8c023/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-27-1.png" target="_blank">625fb5b</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> </div> <div id="plot-mean-dp-read-depth-across-cells-for-each-chromosome" class="section level2"> <h2>Plot Mean DP (read depth) across cells for each chromosome</h2> <div class="sourceCode" id="cb47"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb47-1"><a href="#cb47-1" aria-hidden="true" tabindex="-1"></a>meanDP_track_chr10 <span class="ot"><-</span> <span class="fu">getMeanDPTrack</span>(<span class="at">chrom =</span> <span class="st">"chr10"</span>,</span> <span id="cb47-2"><a href="#cb47-2" aria-hidden="true" tabindex="-1"></a> <span class="at">path_loc =</span> dataset_dir,</span> <span id="cb47-3"><a href="#cb47-3" aria-hidden="true" tabindex="-1"></a> <span class="at">nwindow =</span> <span class="dv">80</span>,</span> <span id="cb47-4"><a href="#cb47-4" aria-hidden="true" tabindex="-1"></a> <span class="at">sampleName =</span><span class="st">"hinch"</span>,</span> <span id="cb47-5"><a href="#cb47-5" aria-hidden="true" tabindex="-1"></a> <span class="at">barcodeFile=</span>barcodeFile_path,</span> <span id="cb47-6"><a href="#cb47-6" aria-hidden="true" tabindex="-1"></a> <span class="at">plot_type =</span> <span class="st">"hist"</span>,</span> <span id="cb47-7"><a href="#cb47-7" aria-hidden="true" tabindex="-1"></a> <span class="at">selectedBarcodes =</span> <span class="fu">colnames</span>(hinch_co_counts),</span> <span id="cb47-8"><a href="#cb47-8" aria-hidden="true" tabindex="-1"></a> <span class="at">snp_track =</span> snp_track_chr10,</span> <span id="cb47-9"><a href="#cb47-9" aria-hidden="true" tabindex="-1"></a> <span class="at">log =</span><span class="cn">TRUE</span>)</span></code></pre></div> <div class="sourceCode" id="cb48"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb48-1"><a href="#cb48-1" aria-hidden="true" tabindex="-1"></a><span class="fu">plotTracks</span>(meanDP_track_chr10)</span></code></pre></div> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-29-1.png" width="768" style="display: block; margin: auto;" /></p> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-unnamed-chunk-29-1"> Past versions of unnamed-chunk-29-1.png </button> </p> <div id="fig-unnamed-chunk-29-1" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/625fb5bbd8df452c3367fb6f53cf39530fe8c023/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-29-1.png" target="_blank">625fb5b</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> </div> <div id="visulise-the-raw-alternative-frequency-af-plot-with-crossover-region-highlighted" class="section level2"> <h2>Visulise the raw Alternative Frequency (AF) plot with crossover region highlighted</h2> <p>for the selected cell</p> <p>We can select a cell and visulise the raw Alternative Frequency (AF) plot with the called crossover region highlighted.</p> <div class="sourceCode" id="cb49"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb49-1"><a href="#cb49-1" aria-hidden="true" tabindex="-1"></a>cell_af <span class="ot"><-</span> <span class="fu">getCellAFTrack</span>(<span class="at">chrom =</span> <span class="st">"chr10"</span>,</span> <span id="cb49-2"><a href="#cb49-2" aria-hidden="true" tabindex="-1"></a> <span class="at">path_loc =</span> dataset_dir,</span> <span id="cb49-3"><a href="#cb49-3" aria-hidden="true" tabindex="-1"></a> <span class="at">sampleName =</span> <span class="st">"hinch"</span>,</span> <span id="cb49-4"><a href="#cb49-4" aria-hidden="true" tabindex="-1"></a> <span class="at">barcodeFile =</span> barcodeFile_path,</span> <span id="cb49-5"><a href="#cb49-5" aria-hidden="true" tabindex="-1"></a> <span class="at">nwindow =</span> <span class="dv">80</span>,</span> <span id="cb49-6"><a href="#cb49-6" aria-hidden="true" tabindex="-1"></a> <span class="at">snp_track =</span> snp_track_chr10,</span> <span id="cb49-7"><a href="#cb49-7" aria-hidden="true" tabindex="-1"></a> <span class="at">cellBarcode =</span> <span class="fu">colnames</span>(hinch_co_counts)[<span class="dv">1</span>],</span> <span id="cb49-8"><a href="#cb49-8" aria-hidden="true" tabindex="-1"></a> <span class="at">co_count =</span> hinch_co_counts,</span> <span id="cb49-9"><a href="#cb49-9" aria-hidden="true" tabindex="-1"></a> <span class="at">chunk =</span> 8000L)</span></code></pre></div> <p>Generate a Highlight track with the returned list object <code>cell_af</code></p> <div class="sourceCode" id="cb50"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb50-1"><a href="#cb50-1" aria-hidden="true" tabindex="-1"></a>changed_bgcolor <span class="ot"><-</span> cell_af<span class="sc">$</span>af_track</span> <span id="cb50-2"><a href="#cb50-2" aria-hidden="true" tabindex="-1"></a>changed_bgcolor <span class="ot"><-</span> <span class="fu">setPar</span>(changed_bgcolor, <span class="st">"background.title"</span>,<span class="st">"#4C5270"</span>)</span></code></pre></div> <pre><code>Note that the behaviour of the 'setPar' method has changed. You need to reassign the result to an object for the side effects to happen. Pass-by-reference semantic is no longer supported.</code></pre> <div class="sourceCode" id="cb52"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb52-1"><a href="#cb52-1" aria-hidden="true" tabindex="-1"></a>ht <span class="ot"><-</span> <span class="fu">HighlightTrack</span>(changed_bgcolor,</span> <span id="cb52-2"><a href="#cb52-2" aria-hidden="true" tabindex="-1"></a> <span class="at">range =</span> cell_af<span class="sc">$</span>co_range[<span class="fu">seqnames</span>(cell_af<span class="sc">$</span>co_range)<span class="sc">==</span><span class="st">"chr10"</span>],</span> <span id="cb52-3"><a href="#cb52-3" aria-hidden="true" tabindex="-1"></a> <span class="at">chromosome =</span> <span class="st">"chr10"</span>)</span> <span id="cb52-4"><a href="#cb52-4" aria-hidden="true" tabindex="-1"></a></span> <span id="cb52-5"><a href="#cb52-5" aria-hidden="true" tabindex="-1"></a><span class="fu">plotTracks</span>(ht,<span class="at">cex =</span> <span class="fl">1.5</span>)</span></code></pre></div> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-31-1.png" width="768" style="display: block; margin: auto;" /></p> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-unnamed-chunk-31-1"> Past versions of unnamed-chunk-31-1.png </button> </p> <div id="fig-unnamed-chunk-31-1" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/a5f11c9c9e71b4c9cdae10b3930a48a292825fe2/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-31-1.png" target="_blank">a5f11c9</a> </td> <td> rlyu </td> <td> 2021-05-25 </td> </tr> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/b017d7f95f384fe9c718236a1621b9e571f9a218/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-31-1.png" target="_blank">b017d7f</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/625fb5bbd8df452c3367fb6f53cf39530fe8c023/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-31-1.png" target="_blank">625fb5b</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> <p>Easily combined with <code>GenomeAxisTrack</code> and <code>IdeogramTrack</code></p> <div class="sourceCode" id="cb53"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb53-1"><a href="#cb53-1" aria-hidden="true" tabindex="-1"></a>gtrack <span class="ot"><-</span> <span class="fu">GenomeAxisTrack</span>()</span> <span id="cb53-2"><a href="#cb53-2" aria-hidden="true" tabindex="-1"></a>chr10_ideo <span class="ot"><-</span> <span class="fu">IdeogramTrack</span>(<span class="at">genome =</span> <span class="st">"mm10"</span>, <span class="at">chromosome =</span> <span class="st">"chr10"</span>)</span> <span id="cb53-3"><a href="#cb53-3" aria-hidden="true" tabindex="-1"></a><span class="fu">plotTracks</span>(<span class="fu">list</span>(chr10_ideo,gtrack, ht),<span class="at">cex.title =</span> <span class="fl">1.2</span>,</span> <span id="cb53-4"><a href="#cb53-4" aria-hidden="true" tabindex="-1"></a> <span class="at">cex.axis =</span> <span class="fl">1.5</span>,<span class="at">cex =</span> <span class="fl">1.5</span>)</span></code></pre></div> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-32-1.png" width="960" style="display: block; margin: auto;" /></p> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-unnamed-chunk-32-1"> Past versions of unnamed-chunk-32-1.png </button> </p> <div id="fig-unnamed-chunk-32-1" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/a5f11c9c9e71b4c9cdae10b3930a48a292825fe2/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-32-1.png" target="_blank">a5f11c9</a> </td> <td> rlyu </td> <td> 2021-05-25 </td> </tr> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/b017d7f95f384fe9c718236a1621b9e571f9a218/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-32-1.png" target="_blank">b017d7f</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/625fb5bbd8df452c3367fb6f53cf39530fe8c023/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-32-1.png" target="_blank">625fb5b</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> </div> <div id="plot-snp-density-along-with-crossover-counts" class="section level2"> <h2>Plot SNP density along with crossover counts</h2> <p>While one can get the DataTracks for the AF and the called crossover regions of a set of cells with <code>getAFTracks</code>, comapr also offers the function for plotting crossover counts for each cell or averaged crossover counts across sample groups.</p> <div class="sourceCode" id="cb54"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb54-1"><a href="#cb54-1" aria-hidden="true" tabindex="-1"></a>crossover_count_track <span class="ot"><-</span> <span class="fu">DataTrack</span>(<span class="at">range =</span> <span class="fu">rowRanges</span>(hinch_co_counts),</span> <span id="cb54-2"><a href="#cb54-2" aria-hidden="true" tabindex="-1"></a> <span class="at">genome =</span> <span class="st">"mm10"</span>,</span> <span id="cb54-3"><a href="#cb54-3" aria-hidden="true" tabindex="-1"></a> <span class="at">data =</span> <span class="fu">data.frame</span>(<span class="fu">assay</span>(hinch_co_counts)),</span> <span id="cb54-4"><a href="#cb54-4" aria-hidden="true" tabindex="-1"></a> <span class="at">name =</span> <span class="st">"expected crossover counts across SNP intervals"</span>,</span> <span id="cb54-5"><a href="#cb54-5" aria-hidden="true" tabindex="-1"></a> <span class="at">type =</span> <span class="st">"heatmap"</span>,</span> <span id="cb54-6"><a href="#cb54-6" aria-hidden="true" tabindex="-1"></a> <span class="at">groups =</span> hinch_co_counts<span class="sc">$</span>sampleGroup,</span> <span id="cb54-7"><a href="#cb54-7" aria-hidden="true" tabindex="-1"></a> <span class="at">col =</span> <span class="fu">c</span>(<span class="st">"red"</span>,<span class="st">"blue"</span>),</span> <span id="cb54-8"><a href="#cb54-8" aria-hidden="true" tabindex="-1"></a> <span class="co">#aggregateGroups = TRUE,</span></span> <span id="cb54-9"><a href="#cb54-9" aria-hidden="true" tabindex="-1"></a> <span class="at">aggregation =</span> mean,</span> <span id="cb54-10"><a href="#cb54-10" aria-hidden="true" tabindex="-1"></a> <span class="at">window =</span><span class="dv">80</span>)</span> <span id="cb54-11"><a href="#cb54-11" aria-hidden="true" tabindex="-1"></a></span> <span id="cb54-12"><a href="#cb54-12" aria-hidden="true" tabindex="-1"></a><span class="fu">plotTracks</span>(<span class="fu">list</span>(gtrack,snp_track_chr10,crossover_count_track),</span> <span id="cb54-13"><a href="#cb54-13" aria-hidden="true" tabindex="-1"></a> <span class="at">chromosome =</span> <span class="st">"chr10"</span>)</span></code></pre></div> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-33-1.png" width="768" style="display: block; margin: auto;" /></p> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-unnamed-chunk-33-1"> Past versions of unnamed-chunk-33-1.png </button> </p> <div id="fig-unnamed-chunk-33-1" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/a5f11c9c9e71b4c9cdae10b3930a48a292825fe2/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-33-1.png" target="_blank">a5f11c9</a> </td> <td> rlyu </td> <td> 2021-05-25 </td> </tr> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/b017d7f95f384fe9c718236a1621b9e571f9a218/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-33-1.png" target="_blank">b017d7f</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/625fb5bbd8df452c3367fb6f53cf39530fe8c023/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-33-1.png" target="_blank">625fb5b</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> <p><strong>Chromosome 10</strong></p> <div class="sourceCode" id="cb55"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb55-1"><a href="#cb55-1" aria-hidden="true" tabindex="-1"></a>gtrack <span class="ot"><-</span> <span class="fu">GenomeAxisTrack</span>(<span class="at">cex=</span><span class="fl">1.5</span>)</span> <span id="cb55-2"><a href="#cb55-2" aria-hidden="true" tabindex="-1"></a>snp_track_chr10 <span class="ot"><-</span> <span class="fu">setPar</span>(snp_track_chr10,<span class="st">"cex.axis"</span>,<span class="fl">1.5</span>)</span></code></pre></div> <pre><code>Note that the behaviour of the 'setPar' method has changed. You need to reassign the result to an object for the side effects to happen. Pass-by-reference semantic is no longer supported.</code></pre> <div class="sourceCode" id="cb57"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb57-1"><a href="#cb57-1" aria-hidden="true" tabindex="-1"></a>snp_track_chr10 <span class="ot"><-</span> <span class="fu">setPar</span>(snp_track_chr10,<span class="st">"cex.title"</span>,<span class="fl">1.5</span>)</span></code></pre></div> <pre><code>Note that the behaviour of the 'setPar' method has changed. You need to reassign the result to an object for the side effects to happen. Pass-by-reference semantic is no longer supported.</code></pre> <div class="sourceCode" id="cb59"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb59-1"><a href="#cb59-1" aria-hidden="true" tabindex="-1"></a><span class="co">#plotTracks(snp_track_chr10)</span></span> <span id="cb59-2"><a href="#cb59-2" aria-hidden="true" tabindex="-1"></a>crossover_count_track <span class="ot"><-</span> <span class="fu">DataTrack</span>(<span class="at">range =</span> <span class="fu">rowRanges</span>(hinch_co_counts),</span> <span id="cb59-3"><a href="#cb59-3" aria-hidden="true" tabindex="-1"></a> <span class="at">genome =</span> <span class="st">"mm10"</span>,</span> <span id="cb59-4"><a href="#cb59-4" aria-hidden="true" tabindex="-1"></a> <span class="at">data =</span> <span class="fu">data.frame</span>(<span class="fu">assay</span>(hinch_co_counts)),</span> <span id="cb59-5"><a href="#cb59-5" aria-hidden="true" tabindex="-1"></a> <span class="at">name =</span> <span class="st">"Mean</span><span class="sc">\n</span><span class="st">crossovers"</span>,</span> <span id="cb59-6"><a href="#cb59-6" aria-hidden="true" tabindex="-1"></a> <span class="at">type =</span> <span class="fu">c</span>(<span class="st">"heatmap"</span>),</span> <span id="cb59-7"><a href="#cb59-7" aria-hidden="true" tabindex="-1"></a> <span class="at">groups =</span> hinch_co_counts<span class="sc">$</span>sampleGroup,</span> <span id="cb59-8"><a href="#cb59-8" aria-hidden="true" tabindex="-1"></a> <span class="at">col =</span> <span class="fu">c</span>(<span class="st">"red"</span>,<span class="st">"blue"</span>),</span> <span id="cb59-9"><a href="#cb59-9" aria-hidden="true" tabindex="-1"></a> <span class="at">aggregateGroups =</span> <span class="cn">TRUE</span>,</span> <span id="cb59-10"><a href="#cb59-10" aria-hidden="true" tabindex="-1"></a> <span class="at">aggregation =</span> mean,</span> <span id="cb59-11"><a href="#cb59-11" aria-hidden="true" tabindex="-1"></a> <span class="at">window =</span><span class="dv">80</span>,<span class="at">cex.title=</span><span class="fl">1.5</span>,</span> <span id="cb59-12"><a href="#cb59-12" aria-hidden="true" tabindex="-1"></a> <span class="at">cex.axis =</span><span class="fl">1.5</span>,</span> <span id="cb59-13"><a href="#cb59-13" aria-hidden="true" tabindex="-1"></a> <span class="at">background.title =</span> <span class="st">"#F652A0"</span>)</span> <span id="cb59-14"><a href="#cb59-14" aria-hidden="true" tabindex="-1"></a></span> <span id="cb59-15"><a href="#cb59-15" aria-hidden="true" tabindex="-1"></a><span class="fu">plotTracks</span>(<span class="fu">list</span>(gtrack,snp_track_chr10,crossover_count_track),</span> <span id="cb59-16"><a href="#cb59-16" aria-hidden="true" tabindex="-1"></a> <span class="at">chromosome =</span> <span class="st">"chr10"</span>,<span class="at">sizes =</span> <span class="fu">c</span>(<span class="dv">1</span>,<span class="dv">2</span>,<span class="dv">2</span>),<span class="at">window =</span><span class="dv">50</span>)</span></code></pre></div> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-34-1.png" width="960" style="display: block; margin: auto;" /></p> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-unnamed-chunk-34-1"> Past versions of unnamed-chunk-34-1.png </button> </p> <div id="fig-unnamed-chunk-34-1" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/b017d7f95f384fe9c718236a1621b9e571f9a218/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-34-1.png" target="_blank">b017d7f</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> <p><strong>Chromosome 1</strong></p> <div class="sourceCode" id="cb60"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb60-1"><a href="#cb60-1" aria-hidden="true" tabindex="-1"></a>snp_track_chr1 <span class="ot"><-</span> <span class="fu">getSNPDensityTrack</span>(<span class="at">chrom =</span> <span class="st">"chr1"</span>,</span> <span id="cb60-2"><a href="#cb60-2" aria-hidden="true" tabindex="-1"></a> <span class="at">path_loc =</span> dataset_dir,</span> <span id="cb60-3"><a href="#cb60-3" aria-hidden="true" tabindex="-1"></a> <span class="at">sampleName =</span> <span class="st">"hinch"</span>,</span> <span id="cb60-4"><a href="#cb60-4" aria-hidden="true" tabindex="-1"></a> <span class="at">nwindow =</span> <span class="dv">80</span>,</span> <span id="cb60-5"><a href="#cb60-5" aria-hidden="true" tabindex="-1"></a> <span class="at">log =</span> <span class="cn">FALSE</span>,</span> <span id="cb60-6"><a href="#cb60-6" aria-hidden="true" tabindex="-1"></a> <span class="at">plot_type =</span> <span class="st">"hist"</span>)</span> <span id="cb60-7"><a href="#cb60-7" aria-hidden="true" tabindex="-1"></a></span> <span id="cb60-8"><a href="#cb60-8" aria-hidden="true" tabindex="-1"></a>snp_track_chr1 <span class="ot"><-</span> <span class="fu">setPar</span>(snp_track_chr1,<span class="st">"background.title"</span>,<span class="st">"firebrick"</span>)</span></code></pre></div> <pre><code>Note that the behaviour of the 'setPar' method has changed. You need to reassign the result to an object for the side effects to happen. Pass-by-reference semantic is no longer supported.</code></pre> <div class="sourceCode" id="cb62"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb62-1"><a href="#cb62-1" aria-hidden="true" tabindex="-1"></a><span class="fu">plotTracks</span>(<span class="fu">list</span>(gtrack,snp_track_chr1,crossover_count_track),</span> <span id="cb62-2"><a href="#cb62-2" aria-hidden="true" tabindex="-1"></a> <span class="at">chromosome =</span> <span class="st">"chr1"</span>)</span></code></pre></div> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-35-1.png" width="672" style="display: block; margin: auto;" /></p> </div> <div id="calculate-genetic-distances-from-crossover-rates" class="section level2"> <h2>Calculate Genetic distances from crossover rates</h2> <p>The raw crossover rates estimated from observed crossovers across SNP intervals for a group of samples are commonly converted into genetic distances in units of centiMorgans via mapping functions such as the Kosambi or the Haldane function.</p> <ul> <li><p>Haldane, cM =−0.5×ln(1−2r)×100,</p></li> <li><p>Kosambi, cM=0.25×ln ((1+2r)/(1−2r))×100,</p></li> </ul> <p>where r is the recombination fraction.</p> <p>The Haldane mapping function adds mathematical adjustments to the recombination fraction. It assumes that crossover events are random and independent along the chromosome, and the number of crossover events between two loci follows a Poisson distribution. Haldane’s mapping function adjusts underestimated crossover rate in larger intervals that are likely to have unobserved even number of crossovers. Kosambi’s mapping function was derived based on Haldane’s and takes consideration of crossover interference.</p> <p>We can calculate the genetic distances with the sperm dataset using <code>calGeneticDist</code> function:</p> <div class="sourceCode" id="cb63"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb63-1"><a href="#cb63-1" aria-hidden="true" tabindex="-1"></a><span class="co"># mapping_fun = "k" for applying the kosambi function</span></span> <span id="cb63-2"><a href="#cb63-2" aria-hidden="true" tabindex="-1"></a></span> <span id="cb63-3"><a href="#cb63-3" aria-hidden="true" tabindex="-1"></a>hinch_dist <span class="ot"><-</span> <span class="fu">calGeneticDist</span>(hinch_co_counts,</span> <span id="cb63-4"><a href="#cb63-4" aria-hidden="true" tabindex="-1"></a> <span class="at">mapping_fun =</span> <span class="st">"k"</span>)</span></code></pre></div> <p>The total genetic distances across the autosomes are then:</p> <div class="sourceCode" id="cb64"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb64-1"><a href="#cb64-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sum</span>(<span class="fu">rowData</span>(hinch_dist)<span class="sc">$</span>kosambi)</span></code></pre></div> <pre><code>[1] 1203.548</code></pre> <p>The genetic distances can also be calculated per sample group. It is useful for doing comparative analysis. We can also supply a <code>bin_size</code> parameter to get the genetic distances calcuated on binned chromosome intervals.</p> <div class="sourceCode" id="cb66"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb66-1"><a href="#cb66-1" aria-hidden="true" tabindex="-1"></a>hinch_dist_groups <span class="ot"><-</span> <span class="fu">calGeneticDist</span>(hinch_co_counts, </span> <span id="cb66-2"><a href="#cb66-2" aria-hidden="true" tabindex="-1"></a> <span class="at">group_by =</span> <span class="st">"sampleGroup"</span>,</span> <span id="cb66-3"><a href="#cb66-3" aria-hidden="true" tabindex="-1"></a> <span class="at">bin_size =</span> <span class="fl">1e7</span>)</span></code></pre></div> <p>The genetic distances per group can be derived as:</p> <div class="sourceCode" id="cb67"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb67-1"><a href="#cb67-1" aria-hidden="true" tabindex="-1"></a>Matrix<span class="sc">::</span><span class="fu">colSums</span>(<span class="fu">as.matrix</span>(<span class="fu">mcols</span>(hinch_dist_groups)))</span></code></pre></div> <pre><code> Group1 Group2 1225.525 1181.623 </code></pre> <div id="plot-genetic-distances" class="section level3"> <h3>Plot genetic distances</h3> <p>The genetic distances across chromosome bins can be visualized by <code>plotGeneticDist</code> function:</p> <div class="sourceCode" id="cb69"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb69-1"><a href="#cb69-1" aria-hidden="true" tabindex="-1"></a><span class="fu">plotGeneticDist</span>(hinch_dist_groups,<span class="at">chr =</span> <span class="st">"chr10"</span>)</span></code></pre></div> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-40-1.png" width="1950" style="display: block; margin: auto;" /></p> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-unnamed-chunk-40-1"> Past versions of unnamed-chunk-40-1.png </button> </p> <div id="fig-unnamed-chunk-40-1" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/a5f11c9c9e71b4c9cdae10b3930a48a292825fe2/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-40-1.png" target="_blank">a5f11c9</a> </td> <td> rlyu </td> <td> 2021-05-25 </td> </tr> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/b017d7f95f384fe9c718236a1621b9e571f9a218/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-40-1.png" target="_blank">b017d7f</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/625fb5bbd8df452c3367fb6f53cf39530fe8c023/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-40-1.png" target="_blank">625fb5b</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> <div class="sourceCode" id="cb70"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb70-1"><a href="#cb70-1" aria-hidden="true" tabindex="-1"></a><span class="fu">plotGeneticDist</span>(hinch_dist_groups,<span class="at">chr =</span> <span class="st">"chr1"</span>)<span class="sc">+</span><span class="fu">theme_classic</span>(<span class="at">base_size =</span> <span class="dv">25</span>)<span class="sc">+</span></span> <span id="cb70-2"><a href="#cb70-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">scale_color_manual</span>(<span class="at">values =</span> <span class="fu">c</span>(<span class="st">"Group1"</span><span class="ot">=</span><span class="st">"#122620"</span>,</span> <span id="cb70-3"><a href="#cb70-3" aria-hidden="true" tabindex="-1"></a> <span class="st">"Group2"</span> <span class="ot">=</span> <span class="st">"#D6AD60"</span> ))<span class="sc">+</span></span> <span id="cb70-4"><a href="#cb70-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme</span>(<span class="at">legend.position =</span> <span class="st">"top"</span>,</span> <span id="cb70-5"><a href="#cb70-5" aria-hidden="true" tabindex="-1"></a> <span class="at">plot.margin=</span><span class="fu">margin</span>(<span class="at">t =</span> <span class="fl">0.5</span>, <span class="at">r =</span> <span class="fl">1.5</span>, <span class="at">b =</span> <span class="dv">0</span>, <span class="at">l =</span> <span class="fl">0.5</span>, <span class="at">unit =</span> <span class="st">"cm"</span>))<span class="sc">+</span></span> <span id="cb70-6"><a href="#cb70-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">ylab</span>(<span class="st">"CentiMorgans per 10 Mb"</span>)</span></code></pre></div> <pre><code>Scale for 'colour' is already present. Adding another scale for 'colour', which will replace the existing scale.</code></pre> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-40-2.png" width="1950" style="display: block; margin: auto;" /></p> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-unnamed-chunk-40-2"> Past versions of unnamed-chunk-40-2.png </button> </p> <div id="fig-unnamed-chunk-40-2" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/b017d7f95f384fe9c718236a1621b9e571f9a218/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-40-2.png" target="_blank">b017d7f</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> <div class="sourceCode" id="cb72"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb72-1"><a href="#cb72-1" aria-hidden="true" tabindex="-1"></a>hinch_dist_groups_non_bin <span class="ot"><-</span> <span class="fu">calGeneticDist</span>(hinch_co_counts,</span> <span id="cb72-2"><a href="#cb72-2" aria-hidden="true" tabindex="-1"></a> <span class="at">group_by =</span> <span class="st">"sampleGroup"</span>)</span> <span id="cb72-3"><a href="#cb72-3" aria-hidden="true" tabindex="-1"></a>hinch_dist_groups_non_bin_gr <span class="ot"><-</span> <span class="fu">rowRanges</span>(hinch_dist_groups_non_bin)</span> <span id="cb72-4"><a href="#cb72-4" aria-hidden="true" tabindex="-1"></a><span class="fu">mcols</span>(hinch_dist_groups_non_bin_gr) <span class="ot"><-</span> <span class="fu">mcols</span>(hinch_dist_groups_non_bin_gr)<span class="sc">$</span>kosambi</span> <span id="cb72-5"><a href="#cb72-5" aria-hidden="true" tabindex="-1"></a></span> <span id="cb72-6"><a href="#cb72-6" aria-hidden="true" tabindex="-1"></a><span class="fu">plotGeneticDist</span>(hinch_dist_groups_non_bin_gr,<span class="at">chr =</span> <span class="st">"chr1"</span>,<span class="at">cumulative =</span> <span class="cn">TRUE</span>)<span class="sc">+</span></span> <span id="cb72-7"><a href="#cb72-7" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme_classic</span>(<span class="at">base_size =</span> <span class="dv">25</span>)<span class="sc">+</span></span> <span id="cb72-8"><a href="#cb72-8" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme</span>(<span class="at">legend.position =</span> <span class="st">"none"</span>,</span> <span id="cb72-9"><a href="#cb72-9" aria-hidden="true" tabindex="-1"></a> <span class="at">plot.margin=</span><span class="fu">margin</span>(<span class="at">t =</span> <span class="fl">0.5</span>, <span class="at">r =</span> <span class="fl">1.5</span>, <span class="at">b =</span> <span class="dv">0</span>, <span class="at">l =</span> <span class="fl">0.5</span>, <span class="at">unit =</span> <span class="st">"cm"</span>))<span class="sc">+</span></span> <span id="cb72-10"><a href="#cb72-10" aria-hidden="true" tabindex="-1"></a> <span class="fu">scale_color_manual</span>(<span class="at">values =</span> <span class="fu">c</span>(<span class="st">"Group1"</span><span class="ot">=</span><span class="st">"#122620"</span>,</span> <span id="cb72-11"><a href="#cb72-11" aria-hidden="true" tabindex="-1"></a> <span class="st">"Group2"</span> <span class="ot">=</span> <span class="st">"#D6AD60"</span> ))<span class="sc">+</span></span> <span id="cb72-12"><a href="#cb72-12" aria-hidden="true" tabindex="-1"></a> <span class="fu">ylab</span>(<span class="st">"Cumulative</span><span class="sc">\n</span><span class="st">centiMorgans"</span>)</span></code></pre></div> <pre><code>Scale for 'colour' is already present. Adding another scale for 'colour', which will replace the existing scale.</code></pre> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-41-1.png" width="2100" style="display: block; margin: auto;" /></p> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-unnamed-chunk-41-1"> Past versions of unnamed-chunk-41-1.png </button> </p> <div id="fig-unnamed-chunk-41-1" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/a5f11c9c9e71b4c9cdae10b3930a48a292825fe2/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-41-1.png" target="_blank">a5f11c9</a> </td> <td> rlyu </td> <td> 2021-05-25 </td> </tr> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/b017d7f95f384fe9c718236a1621b9e571f9a218/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-41-1.png" target="_blank">b017d7f</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/625fb5bbd8df452c3367fb6f53cf39530fe8c023/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-41-1.png" target="_blank">625fb5b</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> <div class="sourceCode" id="cb74"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb74-1"><a href="#cb74-1" aria-hidden="true" tabindex="-1"></a>non_group_gr <span class="ot"><-</span> <span class="fu">calGeneticDist</span>(hinch_co_counts,<span class="at">bin_size =</span> <span class="fl">1e7</span>)</span> <span id="cb74-2"><a href="#cb74-2" aria-hidden="true" tabindex="-1"></a><span class="co">#mcols(non_group_gr) <- mcols(non_group_gr)$kosambi</span></span> <span id="cb74-3"><a href="#cb74-3" aria-hidden="true" tabindex="-1"></a><span class="fu">colnames</span>(<span class="fu">mcols</span>(non_group_gr)) <span class="ot"><-</span> <span class="st">"allCells"</span></span> <span id="cb74-4"><a href="#cb74-4" aria-hidden="true" tabindex="-1"></a></span> <span id="cb74-5"><a href="#cb74-5" aria-hidden="true" tabindex="-1"></a><span class="fu">plotGeneticDist</span>(non_group_gr,<span class="at">chr =</span> <span class="st">"chr1"</span>)<span class="sc">+</span><span class="fu">theme_classic</span>(<span class="at">base_size =</span> <span class="dv">25</span>)<span class="sc">+</span></span> <span id="cb74-6"><a href="#cb74-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme</span>(<span class="at">legend.position =</span> <span class="st">"none"</span>,</span> <span id="cb74-7"><a href="#cb74-7" aria-hidden="true" tabindex="-1"></a> <span class="at">plot.margin=</span><span class="fu">margin</span>(<span class="at">t =</span> <span class="fl">0.5</span>, <span class="at">r =</span> <span class="fl">1.5</span>, <span class="at">b =</span> <span class="dv">0</span>, <span class="at">l =</span> <span class="fl">0.5</span>, <span class="at">unit =</span> <span class="st">"cm"</span>))<span class="sc">+</span></span> <span id="cb74-8"><a href="#cb74-8" aria-hidden="true" tabindex="-1"></a> <span class="fu">scale_color_manual</span>(<span class="at">values =</span><span class="fu">c</span>(<span class="st">"allCells"</span> <span class="ot">=</span> <span class="st">"darkblue"</span>))<span class="sc">+</span><span class="fu">ylab</span>(<span class="st">"CentiMorgans per 10 Mb"</span>)</span></code></pre></div> <pre><code>Scale for 'colour' is already present. Adding another scale for 'colour', which will replace the existing scale.</code></pre> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-42-1.png" width="1800" style="display: block; margin: auto;" /></p> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-unnamed-chunk-42-1"> Past versions of unnamed-chunk-42-1.png </button> </p> <div id="fig-unnamed-chunk-42-1" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/b017d7f95f384fe9c718236a1621b9e571f9a218/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-42-1.png" target="_blank">b017d7f</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> <div class="sourceCode" id="cb76"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb76-1"><a href="#cb76-1" aria-hidden="true" tabindex="-1"></a><span class="fu">plotGeneticDist</span>(hinch_dist_groups,<span class="at">chr =</span> <span class="fu">c</span>(<span class="st">"chr1"</span>,<span class="st">"chr2"</span>))</span></code></pre></div> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-43-1.png" width="672" style="display: block; margin: auto;" /></p> <div class="sourceCode" id="cb77"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb77-1"><a href="#cb77-1" aria-hidden="true" tabindex="-1"></a><span class="fu">plotGeneticDist</span>(hinch_dist_groups,<span class="at">chr =</span> <span class="fu">c</span>(<span class="st">"chr15"</span>,<span class="st">"chr16"</span>))</span></code></pre></div> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-43-2.png" width="672" style="display: block; margin: auto;" /></p> <p>We can also do cumulative centiMorgans plots and the whole genome plot:</p> <div class="sourceCode" id="cb78"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb78-1"><a href="#cb78-1" aria-hidden="true" tabindex="-1"></a><span class="fu">plotGeneticDist</span>(hinch_dist_groups,<span class="at">chr =</span> <span class="fu">c</span>(<span class="st">"chr15"</span>,<span class="st">"chr16"</span>),<span class="at">cumulative =</span> <span class="cn">TRUE</span>)</span></code></pre></div> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-44-1.png" width="768" style="display: block; margin: auto;" /></p> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-unnamed-chunk-44-1"> Past versions of unnamed-chunk-44-1.png </button> </p> <div id="fig-unnamed-chunk-44-1" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/a5f11c9c9e71b4c9cdae10b3930a48a292825fe2/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-44-1.png" target="_blank">a5f11c9</a> </td> <td> rlyu </td> <td> 2021-05-25 </td> </tr> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/b017d7f95f384fe9c718236a1621b9e571f9a218/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-44-1.png" target="_blank">b017d7f</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/625fb5bbd8df452c3367fb6f53cf39530fe8c023/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-44-1.png" target="_blank">625fb5b</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> <div class="sourceCode" id="cb79"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb79-1"><a href="#cb79-1" aria-hidden="true" tabindex="-1"></a><span class="fu">plotWholeGenome</span>(hinch_dist_groups)<span class="sc">+</span><span class="fu">theme_classic</span>(<span class="at">base_size =</span> <span class="dv">25</span>)<span class="sc">+</span></span> <span id="cb79-2"><a href="#cb79-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme</span>(<span class="at">axis.text.x =</span> <span class="fu">element_text</span>(<span class="at">angle =</span> <span class="dv">90</span>),</span> <span id="cb79-3"><a href="#cb79-3" aria-hidden="true" tabindex="-1"></a> <span class="at">legend.position =</span> <span class="st">"none"</span>)<span class="sc">+</span></span> <span id="cb79-4"><a href="#cb79-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">scale_color_manual</span>(<span class="at">values =</span> <span class="fu">c</span>(<span class="st">"Group1"</span><span class="ot">=</span><span class="st">"#122620"</span>,</span> <span id="cb79-5"><a href="#cb79-5" aria-hidden="true" tabindex="-1"></a> <span class="st">"Group2"</span> <span class="ot">=</span> <span class="st">"#D6AD60"</span> ))<span class="sc">+</span><span class="fu">xlab</span>(<span class="st">"Cumulative whole genome"</span>)<span class="sc">+</span></span> <span id="cb79-6"><a href="#cb79-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">ylab</span>(<span class="st">"Cumulative</span><span class="sc">\n</span><span class="st">centiMorgans"</span>)</span></code></pre></div> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-45-1.png" width="1152" style="display: block; margin: auto;" /></p> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-unnamed-chunk-45-1"> Past versions of unnamed-chunk-45-1.png </button> </p> <div id="fig-unnamed-chunk-45-1" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/b017d7f95f384fe9c718236a1621b9e571f9a218/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-45-1.png" target="_blank">b017d7f</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> <p>The two sample groups are similar by looking at the cumulative centiMorgan growth curves of the two.</p> </div> </div> <div id="group-comparison" class="section level2"> <h2>Group comparison</h2> <p>The calculated total genetic distances for the two groups show that Group1 has slightly larger total genetic distances resulted from more meiotic crossovers observed.</p> <p>To test whether the observed difference is statistically significant, we can apply Bootstrapping test to get confidence intervals of group differences and permutation testing for calculating a significance level.</p> <p><strong>Bootstrapping</strong></p> <div class="sourceCode" id="cb80"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb80-1"><a href="#cb80-1" aria-hidden="true" tabindex="-1"></a><span class="fu">set.seed</span>(<span class="dv">100</span>)</span> <span id="cb80-2"><a href="#cb80-2" aria-hidden="true" tabindex="-1"></a>bootsResult <span class="ot"><-</span> <span class="fu">bootstrapDist</span>(hinch_co_counts,</span> <span id="cb80-3"><a href="#cb80-3" aria-hidden="true" tabindex="-1"></a> <span class="at">group_by =</span> <span class="st">"sampleGroup"</span>,</span> <span id="cb80-4"><a href="#cb80-4" aria-hidden="true" tabindex="-1"></a> <span class="at">B =</span> <span class="dv">2000</span>)</span></code></pre></div> <p>The 95% confidence intervals for the group differences by bootstrapping is then:</p> <div class="sourceCode" id="cb81"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb81-1"><a href="#cb81-1" aria-hidden="true" tabindex="-1"></a><span class="fu">quantile</span>(bootsResult,<span class="fu">c</span>(<span class="fl">0.025</span>,<span class="fl">0.975</span>))</span></code></pre></div> <pre><code> 2.5% 97.5% -29.4546 116.5531 </code></pre> <p>which includes zero thus the observed difference is not significant at level of 0.05.</p> <p>The histogram of the bootstrapping results:</p> <div class="sourceCode" id="cb83"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb83-1"><a href="#cb83-1" aria-hidden="true" tabindex="-1"></a>btrp_quantile <span class="ot"><-</span> <span class="fu">quantile</span>(bootsResult,<span class="fu">c</span>(<span class="fl">0.025</span>,<span class="fl">0.975</span>))</span> <span id="cb83-2"><a href="#cb83-2" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplot</span>()<span class="sc">+</span><span class="fu">geom_histogram</span>(<span class="at">mapping =</span> <span class="fu">aes</span>(<span class="at">x =</span> bootsResult),</span> <span id="cb83-3"><a href="#cb83-3" aria-hidden="true" tabindex="-1"></a> <span class="at">fill =</span> <span class="st">"#7c7b89"</span>)<span class="sc">+</span><span class="fu">theme_classic</span>(<span class="at">base_size =</span> <span class="dv">18</span>)<span class="sc">+</span></span> <span id="cb83-4"><a href="#cb83-4" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_vline</span>(<span class="at">mapping =</span> <span class="fu">aes</span>(<span class="at">xintercept =</span> btrp_quantile[<span class="dv">1</span>],<span class="at">color =</span> <span class="st">"2.5%"</span>),<span class="at">size =</span><span class="fl">1.5</span>)<span class="sc">+</span></span> <span id="cb83-5"><a href="#cb83-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_vline</span>(<span class="at">mapping =</span> <span class="fu">aes</span>(<span class="at">xintercept =</span> btrp_quantile[<span class="dv">2</span>],</span> <span id="cb83-6"><a href="#cb83-6" aria-hidden="true" tabindex="-1"></a> <span class="at">color =</span> <span class="st">"97.5%"</span>),<span class="at">size =</span><span class="fl">1.5</span>)<span class="sc">+</span></span> <span id="cb83-7"><a href="#cb83-7" aria-hidden="true" tabindex="-1"></a> <span class="fu">scale_x_continuous</span>(<span class="at">breaks =</span> <span class="fu">c</span>( <span class="sc">-</span><span class="dv">100</span>,<span class="sc">-</span><span class="dv">50</span>, </span> <span id="cb83-8"><a href="#cb83-8" aria-hidden="true" tabindex="-1"></a> <span class="fu">round</span>(btrp_quantile[<span class="dv">1</span>],<span class="dv">2</span>),</span> <span id="cb83-9"><a href="#cb83-9" aria-hidden="true" tabindex="-1"></a> <span class="dv">0</span> , <span class="dv">50</span> , <span class="dv">75</span> ,</span> <span id="cb83-10"><a href="#cb83-10" aria-hidden="true" tabindex="-1"></a> <span class="fu">round</span>(btrp_quantile[<span class="dv">2</span>],<span class="dv">2</span>),</span> <span id="cb83-11"><a href="#cb83-11" aria-hidden="true" tabindex="-1"></a> <span class="dv">150</span>, <span class="dv">200</span>) , </span> <span id="cb83-12"><a href="#cb83-12" aria-hidden="true" tabindex="-1"></a> <span class="at">labels =</span> <span class="fu">c</span>( <span class="sc">-</span><span class="dv">100</span>,<span class="sc">-</span><span class="dv">50</span>, </span> <span id="cb83-13"><a href="#cb83-13" aria-hidden="true" tabindex="-1"></a> <span class="fu">round</span>(btrp_quantile[<span class="dv">1</span>],<span class="dv">2</span>),</span> <span id="cb83-14"><a href="#cb83-14" aria-hidden="true" tabindex="-1"></a> <span class="dv">0</span> , <span class="dv">50</span> , <span class="dv">75</span> ,</span> <span id="cb83-15"><a href="#cb83-15" aria-hidden="true" tabindex="-1"></a> <span class="fu">round</span>(btrp_quantile[<span class="dv">2</span>],<span class="dv">2</span>),</span> <span id="cb83-16"><a href="#cb83-16" aria-hidden="true" tabindex="-1"></a> <span class="dv">150</span>, <span class="dv">200</span>))<span class="sc">+</span></span> <span id="cb83-17"><a href="#cb83-17" aria-hidden="true" tabindex="-1"></a> <span class="fu">xlab</span>(<span class="st">"Bootstrapping results"</span>)<span class="sc">+</span></span> <span id="cb83-18"><a href="#cb83-18" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme_classic</span>(<span class="at">base_size =</span> <span class="dv">25</span>)<span class="sc">+</span></span> <span id="cb83-19"><a href="#cb83-19" aria-hidden="true" tabindex="-1"></a> <span class="fu">scale_color_manual</span>(<span class="at">values =</span> <span class="fu">c</span>(<span class="st">"97.5%"</span><span class="ot">=</span><span class="st">"#0b7fab"</span>,<span class="st">"2.5%"</span><span class="ot">=</span><span class="st">"#e9723d"</span>),</span> <span id="cb83-20"><a href="#cb83-20" aria-hidden="true" tabindex="-1"></a> <span class="at">name =</span> <span class="st">"Quantile"</span>)<span class="sc">+</span><span class="fu">ylab</span>(<span class="st">"Count"</span>)<span class="sc">+</span></span> <span id="cb83-21"><a href="#cb83-21" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme</span>(<span class="at">legend.position =</span> <span class="st">"top"</span>,</span> <span id="cb83-22"><a href="#cb83-22" aria-hidden="true" tabindex="-1"></a> <span class="at">axis.text.x =</span> <span class="fu">element_text</span>(<span class="at">angle =</span> <span class="dv">90</span>))</span></code></pre></div> <pre><code>`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.</code></pre> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/bootstrapExampleFig-1.png" width="1950" style="display: block; margin: auto;" /></p> <div class="sourceCode" id="cb85"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb85-1"><a href="#cb85-1" aria-hidden="true" tabindex="-1"></a><span class="do">## seq(from = -100, to = 200, by = 50)</span></span></code></pre></div> <div class="sourceCode" id="cb86"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb86-1"><a href="#cb86-1" aria-hidden="true" tabindex="-1"></a>dat <span class="ot"><-</span> <span class="fu">with</span>(<span class="fu">density</span>(bootsResult), <span class="fu">data.frame</span>(x, y))</span> <span id="cb86-2"><a href="#cb86-2" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplot</span>(dat,<span class="at">mapping =</span> <span class="fu">aes</span>(<span class="at">x =</span> x,<span class="at">y=</span>y))<span class="sc">+</span><span class="fu">geom_line</span>(<span class="at">fill =</span> <span class="st">"#7c7b89"</span>)<span class="sc">+</span></span> <span id="cb86-3"><a href="#cb86-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_area</span>(<span class="at">mapping =</span> <span class="fu">aes</span>(<span class="at">x =</span> <span class="fu">ifelse</span>(x <span class="sc">></span> btrp_quantile[<span class="dv">1</span>] <span class="sc">&</span></span> <span id="cb86-4"><a href="#cb86-4" aria-hidden="true" tabindex="-1"></a> x <span class="sc"><</span> btrp_quantile[<span class="dv">2</span>],</span> <span id="cb86-5"><a href="#cb86-5" aria-hidden="true" tabindex="-1"></a> x, <span class="cn">NA</span>)),</span> <span id="cb86-6"><a href="#cb86-6" aria-hidden="true" tabindex="-1"></a> <span class="at">fill =</span> <span class="st">"hotpink"</span>,<span class="at">alpha=</span><span class="fl">0.3</span>)<span class="sc">+</span><span class="fu">theme_classic</span>()<span class="sc">+</span></span> <span id="cb86-7"><a href="#cb86-7" aria-hidden="true" tabindex="-1"></a> <span class="fu">xlab</span>(<span class="st">"Bootstrapping results"</span>)</span></code></pre></div> <pre><code>Warning: Ignoring unknown parameters: fill</code></pre> <pre><code>Warning: Removed 253 rows containing missing values (position_stack).</code></pre> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-48-1.png" width="672" style="display: block; margin: auto;" /></p> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-unnamed-chunk-48-1"> Past versions of unnamed-chunk-48-1.png </button> </p> <div id="fig-unnamed-chunk-48-1" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/b017d7f95f384fe9c718236a1621b9e571f9a218/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-48-1.png" target="_blank">b017d7f</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> <p><strong>Permutation</strong></p> <p>We next apply permutation testing using the <code>permuteDist</code> function.</p> <div class="sourceCode" id="cb89"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb89-1"><a href="#cb89-1" aria-hidden="true" tabindex="-1"></a><span class="fu">set.seed</span>(<span class="dv">2021</span>)</span> <span id="cb89-2"><a href="#cb89-2" aria-hidden="true" tabindex="-1"></a>BiocParallel<span class="sc">::</span><span class="fu">register</span>(BiocParallel<span class="sc">::</span><span class="fu">SerialParam</span>())</span> <span id="cb89-3"><a href="#cb89-3" aria-hidden="true" tabindex="-1"></a>perms <span class="ot"><-</span> <span class="fu">permuteDist</span>(hinch_co_counts,<span class="at">group_by =</span> <span class="st">"sampleGroup"</span>,</span> <span id="cb89-4"><a href="#cb89-4" aria-hidden="true" tabindex="-1"></a> <span class="at">B=</span><span class="dv">2000</span>)</span> <span id="cb89-5"><a href="#cb89-5" aria-hidden="true" tabindex="-1"></a>perms<span class="sc">$</span>observed_diff</span></code></pre></div> <pre><code>[1] 43.90172</code></pre> <div class="sourceCode" id="cb91"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb91-1"><a href="#cb91-1" aria-hidden="true" tabindex="-1"></a>perms<span class="sc">$</span>nSample</span></code></pre></div> <pre><code>[1] 87 86</code></pre> <div class="sourceCode" id="cb93"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb93-1"><a href="#cb93-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sum</span>(<span class="fu">is.na</span>(perms<span class="sc">$</span>permutes))</span></code></pre></div> <pre><code>[1] 0</code></pre> <p>We can then use the <code>statmod::permp()</code> function <span class="citation">(Phipson and Smyth 2010)</span> to calculate an exact p-value for this set of permutation results:</p> <div class="sourceCode" id="cb95"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb95-1"><a href="#cb95-1" aria-hidden="true" tabindex="-1"></a>padjust <span class="ot"><-</span> statmod<span class="sc">::</span><span class="fu">permp</span>(<span class="at">x =</span> <span class="fu">sum</span>(perms<span class="sc">$</span>permutes<span class="sc">></span> perms<span class="sc">$</span>observed_diff),</span> <span id="cb95-2"><a href="#cb95-2" aria-hidden="true" tabindex="-1"></a> <span class="at">nperm =</span> <span class="dv">2000</span>,</span> <span id="cb95-3"><a href="#cb95-3" aria-hidden="true" tabindex="-1"></a> <span class="at">n1 =</span> perms<span class="sc">$</span>nSample[<span class="dv">1</span>],</span> <span id="cb95-4"><a href="#cb95-4" aria-hidden="true" tabindex="-1"></a> <span class="at">n2 =</span> perms<span class="sc">$</span>nSample[<span class="dv">2</span>],</span> <span id="cb95-5"><a href="#cb95-5" aria-hidden="true" tabindex="-1"></a> <span class="at">twosided =</span> F)</span> <span id="cb95-6"><a href="#cb95-6" aria-hidden="true" tabindex="-1"></a>padjust</span></code></pre></div> <pre><code>[1] 0.1149425</code></pre> <p>We can see that the calculated p-value was not significant.</p> <div class="sourceCode" id="cb97"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb97-1"><a href="#cb97-1" aria-hidden="true" tabindex="-1"></a><span class="fu">ggplot</span>()<span class="sc">+</span><span class="fu">geom_histogram</span>(<span class="at">mapping =</span> <span class="fu">aes</span>(<span class="at">x =</span> perms<span class="sc">$</span>permutes),</span> <span id="cb97-2"><a href="#cb97-2" aria-hidden="true" tabindex="-1"></a> <span class="at">fill =</span> <span class="st">"#7c7b89"</span>)<span class="sc">+</span><span class="fu">theme_classic</span>()<span class="sc">+</span></span> <span id="cb97-3"><a href="#cb97-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_vline</span>(<span class="at">mapping =</span> <span class="fu">aes</span>(<span class="at">xintercept =</span> perms<span class="sc">$</span>observed_diff,<span class="at">color =</span><span class="st">"observed difference"</span>),</span> <span id="cb97-4"><a href="#cb97-4" aria-hidden="true" tabindex="-1"></a> <span class="at">size =</span> <span class="fl">1.5</span>,)<span class="sc">+</span><span class="fu">theme_classic</span>(<span class="at">base_size =</span> <span class="dv">25</span>)<span class="sc">+</span></span> <span id="cb97-5"><a href="#cb97-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_text</span>(<span class="at">mapping =</span> <span class="fu">aes</span>(<span class="at">x=</span> <span class="dv">108</span>, <span class="at">y =</span> <span class="dv">180</span>,</span> <span id="cb97-6"><a href="#cb97-6" aria-hidden="true" tabindex="-1"></a> <span class="at">label =</span> <span class="fu">paste0</span>(<span class="st">"p-value = "</span>,<span class="fu">round</span>(padjust,<span class="dv">2</span>))),</span> <span id="cb97-7"><a href="#cb97-7" aria-hidden="true" tabindex="-1"></a> <span class="at">size =</span> <span class="dv">7</span>)<span class="sc">+</span><span class="fu">xlab</span>(<span class="st">"Permutation results"</span>)<span class="sc">+</span> </span> <span id="cb97-8"><a href="#cb97-8" aria-hidden="true" tabindex="-1"></a> <span class="fu">scale_color_manual</span>(<span class="at">values =</span> <span class="fu">c</span>(<span class="st">"observed difference"</span><span class="ot">=</span><span class="st">"black"</span>),</span> <span id="cb97-9"><a href="#cb97-9" aria-hidden="true" tabindex="-1"></a> <span class="at">name =</span> <span class="st">""</span>)<span class="sc">+</span><span class="fu">theme</span>(<span class="at">legend.position =</span> <span class="st">"top"</span>,</span> <span id="cb97-10"><a href="#cb97-10" aria-hidden="true" tabindex="-1"></a> <span class="at">axis.title.x =</span> <span class="fu">element_text</span>(<span class="at">margin =</span> <span class="fu">margin</span>(<span class="at">t =</span> <span class="dv">30</span>, <span class="at">r =</span> <span class="dv">20</span>, <span class="at">b =</span> <span class="dv">0</span>, <span class="at">l =</span> <span class="dv">0</span>)))<span class="sc">+</span><span class="fu">ylab</span>(<span class="st">"Count"</span>)</span></code></pre></div> <pre><code>`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.</code></pre> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/permutateResultExample-1.png" width="2100" style="display: block; margin: auto;" /></p> </div> <div id="filtered-out-sperm-cells" class="section level2"> <h2>Filtered out sperm cells</h2> <p>During the first step of constructing the RangedSummarizedExperiment object, some cells were filtered out due to 1, some chromsomes having too few SNPs (<200), 2, some chromsomes have been called with excessive amount of crossovers. Too many crossovers were called (biologically impossiable) is likely due to “doublet” cells, i.e DNA reads from two sperm cells were regarded as one cell, or the sperm cell’s homologous chromosomes were not separated properly in meiosis. For this particular dataset, it is more likely due to the second case.</p> <div id="plot-alternative-allele-frequence-tracks-for-chromsomes-with-excessive-number" class="section level3"> <h3>Plot alternative allele frequence tracks for chromsomes with excessive number</h3> <p>of crossovers</p> <div class="sourceCode" id="cb99"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb99-1"><a href="#cb99-1" aria-hidden="true" tabindex="-1"></a>filteredCells <span class="ot"><-</span> <span class="fu">read.table</span>(<span class="at">file =</span><span class="st">"output/hinch_filtered_barcodes_doublets.txt"</span>,</span> <span id="cb99-2"><a href="#cb99-2" aria-hidden="true" tabindex="-1"></a> <span class="at">header =</span>T)</span> <span id="cb99-3"><a href="#cb99-3" aria-hidden="true" tabindex="-1"></a><span class="fu">head</span>(filteredCells)</span></code></pre></div> <pre><code> Chrom totalSNP nCORaw barcode 1 chr10 249399 53 SRR8454765 2 chr12 163651 63 SRR8454806 3 chr6 187131 64 SRR8454806 4 chr8 177959 53 SRR8454806 5 chr5 145337 55 SRR8454823 6 chr10 109396 51 SRR8454677</code></pre> <div class="sourceCode" id="cb101"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb101-1"><a href="#cb101-1" aria-hidden="true" tabindex="-1"></a>cell_af_chr10 <span class="ot"><-</span> <span class="fu">getCellAFTrack</span>(<span class="at">chrom =</span> <span class="st">"chr10"</span>,</span> <span id="cb101-2"><a href="#cb101-2" aria-hidden="true" tabindex="-1"></a> <span class="at">path_loc =</span> dataset_dir,</span> <span id="cb101-3"><a href="#cb101-3" aria-hidden="true" tabindex="-1"></a> <span class="at">sampleName =</span> <span class="st">"hinch"</span>,</span> <span id="cb101-4"><a href="#cb101-4" aria-hidden="true" tabindex="-1"></a> <span class="at">barcodeFile =</span> barcodeFile_path,</span> <span id="cb101-5"><a href="#cb101-5" aria-hidden="true" tabindex="-1"></a> <span class="at">nwindow =</span> <span class="dv">300</span>,</span> <span id="cb101-6"><a href="#cb101-6" aria-hidden="true" tabindex="-1"></a> <span class="at">snp_track =</span> snp_track_chr10,</span> <span id="cb101-7"><a href="#cb101-7" aria-hidden="true" tabindex="-1"></a> <span class="at">cellBarcode =</span> <span class="st">"SRR8454765"</span>,</span> <span id="cb101-8"><a href="#cb101-8" aria-hidden="true" tabindex="-1"></a> <span class="at">co_count =</span> hinch_co_counts,</span> <span id="cb101-9"><a href="#cb101-9" aria-hidden="true" tabindex="-1"></a> <span class="at">chunk =</span> 8000L)</span> <span id="cb101-10"><a href="#cb101-10" aria-hidden="true" tabindex="-1"></a>cell_af_only <span class="ot"><-</span> cell_af_chr10<span class="sc">$</span>af_track</span> <span id="cb101-11"><a href="#cb101-11" aria-hidden="true" tabindex="-1"></a>cell_af_only <span class="ot"><-</span> <span class="fu">setPar</span>(cell_af_only, <span class="st">"background.title"</span>,<span class="st">"#4C5270"</span>)</span></code></pre></div> <pre><code>Note that the behaviour of the 'setPar' method has changed. You need to reassign the result to an object for the side effects to happen. Pass-by-reference semantic is no longer supported.</code></pre> <p>Generate a Highlight track with the returned list object <code>cell_af</code></p> <div class="sourceCode" id="cb103"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb103-1"><a href="#cb103-1" aria-hidden="true" tabindex="-1"></a>ht <span class="ot"><-</span> <span class="fu">HighlightTrack</span>(cell_af_only,</span> <span id="cb103-2"><a href="#cb103-2" aria-hidden="true" tabindex="-1"></a> <span class="at">range =</span> cell_af_chr10<span class="sc">$</span>co_range[<span class="fu">seqnames</span>(cell_af_chr10<span class="sc">$</span>co_range)<span class="sc">==</span><span class="st">"chr10"</span>],</span> <span id="cb103-3"><a href="#cb103-3" aria-hidden="true" tabindex="-1"></a> <span class="at">chromosome =</span> <span class="st">"chr10"</span>)</span> <span id="cb103-4"><a href="#cb103-4" aria-hidden="true" tabindex="-1"></a><span class="fu">plotTracks</span>(ht)</span></code></pre></div> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-53-1.png" width="768" style="display: block; margin: auto;" /></p> </div> </div> <div id="match-with-crossovers-called-in-the-original-paper" class="section level2"> <h2>Match with crossovers called in the original paper</h2> <p>The cell’s crossover ranges can be found by <code>getCellCORange</code> function:</p> <div class="sourceCode" id="cb104"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb104-1"><a href="#cb104-1" aria-hidden="true" tabindex="-1"></a>called_co_cell <span class="ot"><-</span> <span class="fu">getCellCORange</span>(<span class="at">co_count =</span> hinch_co_counts,</span> <span id="cb104-2"><a href="#cb104-2" aria-hidden="true" tabindex="-1"></a> <span class="at">cellBarcode =</span> <span class="fu">colnames</span>(hinch_co_counts)[<span class="dv">1</span>])</span></code></pre></div> <p>We now compare the crossovers called by <code>ssocaller</code> and <code>comapr</code> with the crossovers positions identified in the original paper <span class="citation">(Hinch et al. 2019)</span>.</p> <p>We first collect the crossover regions for each cell:</p> <div class="sourceCode" id="cb105"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb105-1"><a href="#cb105-1" aria-hidden="true" tabindex="-1"></a>called_co_df <span class="ot"><-</span> <span class="fu">lapply</span>(<span class="fu">colnames</span>(hinch_co_counts), <span class="cf">function</span>(srr){</span> <span id="cb105-2"><a href="#cb105-2" aria-hidden="true" tabindex="-1"></a> </span> <span id="cb105-3"><a href="#cb105-3" aria-hidden="true" tabindex="-1"></a> called_co_cell <span class="ot"><-</span> <span class="fu">getCellCORange</span>(<span class="at">co_count =</span> hinch_co_counts,</span> <span id="cb105-4"><a href="#cb105-4" aria-hidden="true" tabindex="-1"></a> <span class="at">cellBarcode =</span> srr)</span> <span id="cb105-5"><a href="#cb105-5" aria-hidden="true" tabindex="-1"></a> called_co_df <span class="ot"><-</span> <span class="fu">as.data.frame</span>(called_co_cell)</span> <span id="cb105-6"><a href="#cb105-6" aria-hidden="true" tabindex="-1"></a> called_co_df<span class="sc">$</span>SRR <span class="ot"><-</span> srr</span> <span id="cb105-7"><a href="#cb105-7" aria-hidden="true" tabindex="-1"></a> called_co_df</span> <span id="cb105-8"><a href="#cb105-8" aria-hidden="true" tabindex="-1"></a></span> <span id="cb105-9"><a href="#cb105-9" aria-hidden="true" tabindex="-1"></a></span> <span id="cb105-10"><a href="#cb105-10" aria-hidden="true" tabindex="-1"></a>})</span> <span id="cb105-11"><a href="#cb105-11" aria-hidden="true" tabindex="-1"></a>called_co_df <span class="ot"><-</span> <span class="fu">do.call</span>(<span class="st">"rbind"</span>,called_co_df)</span></code></pre></div> <div class="sourceCode" id="cb106"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb106-1"><a href="#cb106-1" aria-hidden="true" tabindex="-1"></a><span class="fu">head</span>(called_co_df)</span></code></pre></div> <pre><code> seqnames start end width strand SRR 1 chr2 152092358 152096706 4349 * SRR8454655 2 chr3 127265735 127268073 2339 * SRR8454655 3 chr5 100598558 100604496 5939 * SRR8454655 4 chr5 148434132 148435557 1426 * SRR8454655 5 chr6 39274873 39300625 25753 * SRR8454655 6 chr6 121425933 121426008 76 * SRR8454655</code></pre> <div class="sourceCode" id="cb108"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb108-1"><a href="#cb108-1" aria-hidden="true" tabindex="-1"></a>called_co_df<span class="sc">$</span>chr <span class="ot"><-</span> called_co_df<span class="sc">$</span>seqnames</span></code></pre></div> <p>The published crossover positions from <span class="citation">(Hinch et al. 2019)</span> was downloaded from GEO with GSE125326:</p> <div class="sourceCode" id="cb109"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb109-1"><a href="#cb109-1" aria-hidden="true" tabindex="-1"></a>pub_co <span class="ot"><-</span> <span class="fu">read.table</span>(<span class="at">file =</span><span class="st">"references/publishedCrossovers.txt"</span>)</span> <span id="cb109-2"><a href="#cb109-2" aria-hidden="true" tabindex="-1"></a>pub_co<span class="sc">$</span>chr <span class="ot"><-</span> <span class="fu">paste0</span>(<span class="st">"chr"</span>,pub_co<span class="sc">$</span>chr)</span> <span id="cb109-3"><a href="#cb109-3" aria-hidden="true" tabindex="-1"></a>pub_co <span class="ot"><-</span> pub_co[pub_co<span class="sc">$</span>chr<span class="sc">!=</span><span class="st">"chrX"</span>,]</span> <span id="cb109-4"><a href="#cb109-4" aria-hidden="true" tabindex="-1"></a>merged_df <span class="ot"><-</span> <span class="fu">merge</span>(called_co_df, pub_co, <span class="at">by.x =</span><span class="fu">c</span>(<span class="st">"SRR"</span>,<span class="st">"chr"</span>), </span> <span id="cb109-5"><a href="#cb109-5" aria-hidden="true" tabindex="-1"></a> <span class="at">suffixes =</span> <span class="fu">c</span>(<span class="st">".called"</span>,<span class="st">".pub"</span>))</span></code></pre></div> <p>The number of crossovers called for each cell are highly concordant. The differences in number of crossovers called per cell are plotted in histogram down below. and we can see that our approach is more conservative. However, one can adjust the filtering thresholds mentioned at the start of this section to be less conservative.</p> <div class="sourceCode" id="cb110"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb110-1"><a href="#cb110-1" aria-hidden="true" tabindex="-1"></a>sgcocaller_cos <span class="ot"><-</span> called_co_df <span class="sc">%>%</span> <span class="fu">group_by</span>(SRR) <span class="sc">%>%</span> <span class="fu">summarise</span>(<span class="at">COs_sgcocaller =</span> <span class="fu">n</span>())</span> <span id="cb110-2"><a href="#cb110-2" aria-hidden="true" tabindex="-1"></a></span> <span id="cb110-3"><a href="#cb110-3" aria-hidden="true" tabindex="-1"></a>hinch_cos <span class="ot"><-</span> pub_co <span class="sc">%>%</span> <span class="fu">group_by</span>(SRR) <span class="sc">%>%</span> <span class="fu">summarise</span>(<span class="at">COs_hinch =</span> <span class="fu">n</span>())</span> <span id="cb110-4"><a href="#cb110-4" aria-hidden="true" tabindex="-1"></a></span> <span id="cb110-5"><a href="#cb110-5" aria-hidden="true" tabindex="-1"></a>sgcocaller_cos <span class="sc">%>%</span> <span class="fu">left_join</span>(hinch_cos) <span class="sc">%>%</span></span> <span id="cb110-6"><a href="#cb110-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">ggplot</span>()<span class="sc">+</span><span class="fu">geom_histogram</span>(<span class="at">mapping =</span> </span> <span id="cb110-7"><a href="#cb110-7" aria-hidden="true" tabindex="-1"></a> <span class="fu">aes</span>(<span class="at">x=</span> (COs_sgcocaller <span class="sc">-</span> COs_hinch)))<span class="sc">+</span><span class="fu">theme_classic</span>()</span></code></pre></div> <pre><code>Joining, by = "SRR"</code></pre> <pre><code>`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.</code></pre> <div class="figure" style="text-align: center"> <img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/codiff-1.png" alt="Differences in number of crossovers called by the two methods" width="576" /> <p class="caption"> Differences in number of crossovers called by the two methods </p> </div> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-codiff-1"> Past versions of codiff-1.png </button> </p> <div id="fig-codiff-1" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/a5f11c9c9e71b4c9cdae10b3930a48a292825fe2/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/codiff-1.png" target="_blank">a5f11c9</a> </td> <td> rlyu </td> <td> 2021-05-25 </td> </tr> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/b017d7f95f384fe9c718236a1621b9e571f9a218/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/codiff-1.png" target="_blank">b017d7f</a> </td> <td> rlyu </td> <td> 2021-05-17 </td> </tr> </tbody> </table> </div> </div> <div class="sourceCode" id="cb113"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb113-1"><a href="#cb113-1" aria-hidden="true" tabindex="-1"></a>sgcocaller_cos <span class="sc">%>%</span> <span class="fu">left_join</span>(hinch_cos) <span class="sc">%>%</span></span> <span id="cb113-2"><a href="#cb113-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">ggplot</span>()<span class="sc">+</span><span class="fu">geom_jitter</span>(<span class="at">mapping =</span> </span> <span id="cb113-3"><a href="#cb113-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">aes</span>(<span class="at">x=</span> (COs_sgcocaller <span class="sc">-</span> COs_hinch), <span class="at">y =</span><span class="st">"diff"</span>),</span> <span id="cb113-4"><a href="#cb113-4" aria-hidden="true" tabindex="-1"></a> <span class="at">width =</span> <span class="fl">0.3</span>)<span class="sc">+</span></span> <span id="cb113-5"><a href="#cb113-5" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme_classic</span>()</span></code></pre></div> <pre><code>Joining, by = "SRR"</code></pre> <div class="figure" style="text-align: center"> <img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/codiff-2.png" alt="Differences in number of crossovers called by the two methods" width="576" /> <p class="caption"> Differences in number of crossovers called by the two methods </p> </div> <p> <button type="button" class="btn btn-default btn-xs btn-workflowr btn-workflowr-fig" data-toggle="collapse" data-target="#fig-codiff-2"> Past versions of codiff-2.png </button> </p> <div id="fig-codiff-2" class="collapse"> <div class="table-responsive"> <table class="table table-condensed table-hover"> <thead> <tr> <th> Version </th> <th> Author </th> <th> Date </th> </tr> </thead> <tbody> <tr> <td> <a href="https://gitlab.svi.edu.au/biocellgen-public/hinch-single-sperm-DNA-seq-processing/blob/a5f11c9c9e71b4c9cdae10b3930a48a292825fe2/public/figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/codiff-2.png" target="_blank">a5f11c9</a> </td> <td> rlyu </td> <td> 2021-05-25 </td> </tr> </tbody> </table> </div> </div> <div class="sourceCode" id="cb115"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb115-1"><a href="#cb115-1" aria-hidden="true" tabindex="-1"></a>sgcocaller_cos <span class="sc">%>%</span> <span class="fu">left_join</span>(hinch_cos) <span class="sc">%>%</span> </span> <span id="cb115-2"><a href="#cb115-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(<span class="at">diff =</span> <span class="fu">as.character</span>(<span class="fu">abs</span>(COs_sgcocaller<span class="sc">-</span>COs_hinch))) <span class="sc">%>%</span> <span class="fu">ggplot</span>()<span class="sc">+</span></span> <span id="cb115-3"><a href="#cb115-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">geom_jitter</span>(<span class="at">mapping =</span> <span class="fu">aes</span>(<span class="at">x =</span> COs_sgcocaller,</span> <span id="cb115-4"><a href="#cb115-4" aria-hidden="true" tabindex="-1"></a> <span class="at">y=</span> COs_hinch,</span> <span id="cb115-5"><a href="#cb115-5" aria-hidden="true" tabindex="-1"></a> <span class="at">color =</span> diff,<span class="at">shape =</span> diff),<span class="at">size =</span><span class="fl">2.5</span>)<span class="sc">+</span></span> <span id="cb115-6"><a href="#cb115-6" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme_classic</span>(<span class="at">base_size =</span> <span class="dv">25</span>)<span class="sc">+</span><span class="fu">scale_colour_viridis_d</span>()<span class="sc">+</span><span class="fu">ylab</span>(<span class="st">"COs_published"</span>)<span class="sc">+</span></span> <span id="cb115-7"><a href="#cb115-7" aria-hidden="true" tabindex="-1"></a> <span class="co"># scale_color_manual(</span></span> <span id="cb115-8"><a href="#cb115-8" aria-hidden="true" tabindex="-1"></a> <span class="co"># values = c("0"="#58c8c9","1"="#48a3a4","2"="#367a7a","4"="#235050"))+</span></span> <span id="cb115-9"><a href="#cb115-9" aria-hidden="true" tabindex="-1"></a> <span class="fu">theme</span>(<span class="at">legend.position =</span> <span class="fu">c</span>(<span class="fl">0.5</span>, <span class="dv">1</span>),</span> <span id="cb115-10"><a href="#cb115-10" aria-hidden="true" tabindex="-1"></a> <span class="at">legend.direction =</span> <span class="st">"horizontal"</span>)</span></code></pre></div> <pre><code>Joining, by = "SRR"</code></pre> <div class="figure" style="text-align: center"> <img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/codiff-3.png" alt="Differences in number of crossovers called by the two methods" width="576" /> <p class="caption"> Differences in number of crossovers called by the two methods </p> </div> <div class="sourceCode" id="cb117"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb117-1"><a href="#cb117-1" aria-hidden="true" tabindex="-1"></a><span class="co"># ggplot(data = hinch_cos,</span></span> <span id="cb117-2"><a href="#cb117-2" aria-hidden="true" tabindex="-1"></a><span class="co"># mapping = aes(x = "Hinch Published",</span></span> <span id="cb117-3"><a href="#cb117-3" aria-hidden="true" tabindex="-1"></a><span class="co"># y = COs_hinch)) + geom_boxplot()+ geom_jitter()+</span></span> <span id="cb117-4"><a href="#cb117-4" aria-hidden="true" tabindex="-1"></a><span class="co"># theme_classic()</span></span> <span id="cb117-5"><a href="#cb117-5" aria-hidden="true" tabindex="-1"></a><span class="co"># </span></span> <span id="cb117-6"><a href="#cb117-6" aria-hidden="true" tabindex="-1"></a><span class="co"># ggplot(data = hinch_cos,</span></span> <span id="cb117-7"><a href="#cb117-7" aria-hidden="true" tabindex="-1"></a><span class="co"># mapping = aes( x = COs_hinch)) + geom_histogram(stat = "count")+</span></span> <span id="cb117-8"><a href="#cb117-8" aria-hidden="true" tabindex="-1"></a><span class="co"># theme_classic()</span></span> <span id="cb117-9"><a href="#cb117-9" aria-hidden="true" tabindex="-1"></a><span class="co"># ggplot(data = sgcocaller_cos,</span></span> <span id="cb117-10"><a href="#cb117-10" aria-hidden="true" tabindex="-1"></a><span class="co"># mapping = aes( x = COs_sgcocaller)) + geom_histogram(stat = "count")+</span></span> <span id="cb117-11"><a href="#cb117-11" aria-hidden="true" tabindex="-1"></a><span class="co"># theme_classic()</span></span></code></pre></div> <p>The cells with discrepancy in number of crossovers called:</p> <div class="sourceCode" id="cb118"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb118-1"><a href="#cb118-1" aria-hidden="true" tabindex="-1"></a>sgcocaller_cos <span class="sc">%>%</span> <span class="fu">left_join</span>(hinch_cos) <span class="sc">%>%</span> <span class="fu">filter</span>(COs_sgcocaller <span class="sc">!=</span> COs_hinch)</span></code></pre></div> <pre><code>Joining, by = "SRR"</code></pre> <pre><code># A tibble: 7 × 3 SRR COs_sgcocaller COs_hinch <chr> <int> <int> 1 SRR8454715 11 15 2 SRR8454799 11 13 3 SRR8454804 11 13 4 SRR8454819 11 12 5 SRR8454825 11 15 6 SRR8454838 13 14 7 SRR8454863 9 10</code></pre> <p>We can find the cell which has the largest difference in the number of crossovers called by the two methods:</p> <div class="sourceCode" id="cb121"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb121-1"><a href="#cb121-1" aria-hidden="true" tabindex="-1"></a>sgcocaller_cos <span class="sc">%>%</span> <span class="fu">left_join</span>(hinch_cos) <span class="sc">%>%</span> </span> <span id="cb121-2"><a href="#cb121-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">mutate</span>(<span class="at">diff =</span> (COs_hinch <span class="sc">-</span> COs_sgcocaller)) <span class="sc">%>%</span> </span> <span id="cb121-3"><a href="#cb121-3" aria-hidden="true" tabindex="-1"></a> <span class="fu">filter</span>(diff<span class="sc">></span><span class="dv">3</span>)</span></code></pre></div> <pre><code>Joining, by = "SRR"</code></pre> <pre><code># A tibble: 2 × 4 SRR COs_sgcocaller COs_hinch diff <chr> <int> <int> <int> 1 SRR8454715 11 15 4 2 SRR8454825 11 15 4</code></pre> <p>We can then list the cells and chrs that have different number of crossovers called by the two methods for cell <code>SRR8454715</code>:</p> <div class="sourceCode" id="cb124"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb124-1"><a href="#cb124-1" aria-hidden="true" tabindex="-1"></a>sgcocaller_cos <span class="ot"><-</span> called_co_df <span class="sc">%>%</span> <span class="fu">group_by</span>(SRR,chr) <span class="sc">%>%</span> <span class="fu">summarise</span>(<span class="at">ChrCOs_sgcocaller =</span> <span class="fu">n</span>())</span></code></pre></div> <pre><code>`summarise()` has grouped output by 'SRR'. You can override using the `.groups` argument.</code></pre> <div class="sourceCode" id="cb126"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb126-1"><a href="#cb126-1" aria-hidden="true" tabindex="-1"></a>hinch_cos <span class="ot"><-</span> pub_co <span class="sc">%>%</span> <span class="fu">group_by</span>(SRR,chr) <span class="sc">%>%</span> <span class="fu">summarise</span>(<span class="at">ChrCOs_hinch =</span> <span class="fu">n</span>())</span></code></pre></div> <pre><code>`summarise()` has grouped output by 'SRR'. You can override using the `.groups` argument.</code></pre> <div class="sourceCode" id="cb128"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb128-1"><a href="#cb128-1" aria-hidden="true" tabindex="-1"></a>hinch_cos <span class="sc">%>%</span> <span class="fu">full_join</span>(sgcocaller_cos) <span class="sc">%>%</span> <span class="fu">filter</span>(SRR <span class="sc">==</span> <span class="st">"SRR8454715"</span>)</span></code></pre></div> <pre><code>Joining, by = c("SRR", "chr")</code></pre> <pre><code># A tibble: 11 × 4 # Groups: SRR [1] SRR chr ChrCOs_hinch ChrCOs_sgcocaller <chr> <chr> <int> <int> 1 SRR8454715 chr1 1 1 2 SRR8454715 chr10 1 1 3 SRR8454715 chr12 1 1 4 SRR8454715 chr18 2 NA 5 SRR8454715 chr19 1 1 6 SRR8454715 chr2 1 1 7 SRR8454715 chr3 1 1 8 SRR8454715 chr6 1 1 9 SRR8454715 chr7 3 1 10 SRR8454715 chr8 2 2 11 SRR8454715 chr9 1 1</code></pre> <p>And then plot the alternative allele frequencies for the chromosomes that do not have the same number of crossovers called:</p> <div class="sourceCode" id="cb131"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb131-1"><a href="#cb131-1" aria-hidden="true" tabindex="-1"></a>cell <span class="ot"><-</span> <span class="st">"SRR8454715"</span></span> <span id="cb131-2"><a href="#cb131-2" aria-hidden="true" tabindex="-1"></a></span> <span id="cb131-3"><a href="#cb131-3" aria-hidden="true" tabindex="-1"></a>SRR8454715_af <span class="ot"><-</span> <span class="fu">getCellAFTrack</span>(<span class="at">chrom =</span> <span class="st">"chr7"</span>,</span> <span id="cb131-4"><a href="#cb131-4" aria-hidden="true" tabindex="-1"></a> <span class="at">path_loc =</span> dataset_dir,<span class="at">sampleName =</span> <span class="st">"hinch"</span>,</span> <span id="cb131-5"><a href="#cb131-5" aria-hidden="true" tabindex="-1"></a> <span class="at">barcodeFile =</span> barcodeFile_path,</span> <span id="cb131-6"><a href="#cb131-6" aria-hidden="true" tabindex="-1"></a> <span class="at">co_count =</span> hinch_co_counts,</span> <span id="cb131-7"><a href="#cb131-7" aria-hidden="true" tabindex="-1"></a> <span class="at">nwindow =</span> <span class="dv">500</span>,</span> <span id="cb131-8"><a href="#cb131-8" aria-hidden="true" tabindex="-1"></a> <span class="at">chunk =</span> 50000L,</span> <span id="cb131-9"><a href="#cb131-9" aria-hidden="true" tabindex="-1"></a> <span class="at">cellBarcode =</span> cell)</span></code></pre></div> <div class="sourceCode" id="cb132"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb132-1"><a href="#cb132-1" aria-hidden="true" tabindex="-1"></a>pub_co_range <span class="ot"><-</span> <span class="fu">GRanges</span>(<span class="at">seqnames =</span> pub_co[pub_co<span class="sc">$</span>SRR<span class="sc">==</span>cell,]<span class="sc">$</span>chr,</span> <span id="cb132-2"><a href="#cb132-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">IRanges</span>(<span class="at">start =</span> pub_co[pub_co<span class="sc">$</span>SRR<span class="sc">==</span>cell,]<span class="sc">$</span>crossover_breakpoint_leftpos,</span> <span id="cb132-3"><a href="#cb132-3" aria-hidden="true" tabindex="-1"></a> <span class="at">end =</span> pub_co[pub_co<span class="sc">$</span>SRR<span class="sc">==</span>cell,]<span class="sc">$</span>crossover_breakpoint_rightpos))</span></code></pre></div> <p>Two extra crossovers on chromosome 17 were called from the original paper:</p> <div class="sourceCode" id="cb133"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb133-1"><a href="#cb133-1" aria-hidden="true" tabindex="-1"></a>pub_co_chr7 <span class="ot"><-</span> <span class="fu">AnnotationTrack</span>(pub_co_range[<span class="fu">seqnames</span>(pub_co_range)<span class="sc">==</span><span class="st">"chr7"</span>],</span> <span id="cb133-2"><a href="#cb133-2" aria-hidden="true" tabindex="-1"></a> <span class="at">name =</span> <span class="st">"chr7 published CO ranges"</span>)</span> <span id="cb133-3"><a href="#cb133-3" aria-hidden="true" tabindex="-1"></a>pub_co_chr7 <span class="ot"><-</span> <span class="fu">setPar</span>(pub_co_chr7,<span class="st">"background.title"</span>,<span class="st">"lightblue"</span>)</span></code></pre></div> <pre><code>Note that the behaviour of the 'setPar' method has changed. You need to reassign the result to an object for the side effects to happen. Pass-by-reference semantic is no longer supported.</code></pre> <div class="sourceCode" id="cb135"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb135-1"><a href="#cb135-1" aria-hidden="true" tabindex="-1"></a>SRR8454715_af_ht <span class="ot"><-</span> <span class="fu">HighlightTrack</span>(<span class="at">trackList =</span> <span class="fu">list</span>(gtrack, SRR8454715_af<span class="sc">$</span>af_track,</span> <span id="cb135-2"><a href="#cb135-2" aria-hidden="true" tabindex="-1"></a> pub_co_chr7),</span> <span id="cb135-3"><a href="#cb135-3" aria-hidden="true" tabindex="-1"></a> <span class="at">range =</span> SRR8454715_af<span class="sc">$</span>co_range[<span class="fu">seqnames</span>(SRR8454715_af<span class="sc">$</span>co_range)<span class="sc">==</span><span class="st">"chr7"</span>])</span> <span id="cb135-4"><a href="#cb135-4" aria-hidden="true" tabindex="-1"></a><span class="fu">plotTracks</span>(SRR8454715_af_ht)</span></code></pre></div> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-64-1.png" width="1152" style="display: block; margin: auto;" /></p> <div class="sourceCode" id="cb136"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb136-1"><a href="#cb136-1" aria-hidden="true" tabindex="-1"></a>SRR8454715_af_chr18 <span class="ot"><-</span> <span class="fu">getCellAFTrack</span>(<span class="at">chrom =</span> <span class="st">"chr18"</span>,</span> <span id="cb136-2"><a href="#cb136-2" aria-hidden="true" tabindex="-1"></a> <span class="at">path_loc =</span> dataset_dir,<span class="at">sampleName =</span> <span class="st">"hinch"</span>,</span> <span id="cb136-3"><a href="#cb136-3" aria-hidden="true" tabindex="-1"></a> <span class="at">barcodeFile =</span> barcodeFile_path,</span> <span id="cb136-4"><a href="#cb136-4" aria-hidden="true" tabindex="-1"></a> <span class="at">co_count =</span> hinch_co_counts,</span> <span id="cb136-5"><a href="#cb136-5" aria-hidden="true" tabindex="-1"></a> <span class="at">nwindow =</span> <span class="dv">300</span>,</span> <span id="cb136-6"><a href="#cb136-6" aria-hidden="true" tabindex="-1"></a> <span class="at">chunk =</span> 50000L,</span> <span id="cb136-7"><a href="#cb136-7" aria-hidden="true" tabindex="-1"></a> <span class="at">cellBarcode =</span> cell)</span></code></pre></div> <p>Two extra crossovers on chromosome 18 were called from the original paper:</p> <div class="sourceCode" id="cb137"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb137-1"><a href="#cb137-1" aria-hidden="true" tabindex="-1"></a>pub_co_chr18 <span class="ot"><-</span> <span class="fu">AnnotationTrack</span>(pub_co_range[<span class="fu">seqnames</span>(pub_co_range)<span class="sc">==</span><span class="st">"chr18"</span>],</span> <span id="cb137-2"><a href="#cb137-2" aria-hidden="true" tabindex="-1"></a> <span class="at">name =</span> <span class="st">"chr18 published CO ranges"</span>)</span> <span id="cb137-3"><a href="#cb137-3" aria-hidden="true" tabindex="-1"></a>pub_co_chr18 <span class="ot"><-</span> <span class="fu">setPar</span>(pub_co_chr18,<span class="st">"background.title"</span>,<span class="st">"lightblue"</span>)</span></code></pre></div> <pre><code>Note that the behaviour of the 'setPar' method has changed. You need to reassign the result to an object for the side effects to happen. Pass-by-reference semantic is no longer supported.</code></pre> <div class="sourceCode" id="cb139"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb139-1"><a href="#cb139-1" aria-hidden="true" tabindex="-1"></a>SRR8454715_af_ht <span class="ot"><-</span> <span class="fu">HighlightTrack</span>(<span class="at">trackList =</span> </span> <span id="cb139-2"><a href="#cb139-2" aria-hidden="true" tabindex="-1"></a> <span class="fu">list</span>(gtrack, SRR8454715_af_chr18<span class="sc">$</span>af_track,</span> <span id="cb139-3"><a href="#cb139-3" aria-hidden="true" tabindex="-1"></a> pub_co_chr18),</span> <span id="cb139-4"><a href="#cb139-4" aria-hidden="true" tabindex="-1"></a> <span class="at">range =</span> SRR8454715_af_chr18<span class="sc">$</span>co_range[<span class="fu">seqnames</span>(SRR8454715_af_chr18<span class="sc">$</span>co_range)<span class="sc">==</span><span class="st">"chr18"</span>])</span> <span id="cb139-5"><a href="#cb139-5" aria-hidden="true" tabindex="-1"></a><span class="fu">plotTracks</span>(SRR8454715_af_ht)</span></code></pre></div> <p><img src="figure/Crossover-identification-with-sscocaller-and-comapr.Rmd/unnamed-chunk-66-1.png" width="1152" style="display: block; margin: auto;" /></p> <p>It is justifiable that <code>comapr</code> classify these 4 crossovers as false positives.</p> </div> <div id="summary" class="section level2"> <h2>Summary</h2> <p>We have demonstrated the application of <code>sgcocaller</code> to find the haplotype states for the list of cell barcodes against the list of informative SNP markers using a binomial Hidden Markov Model. We have also showed the functionality of <code>comapr</code> for downstream analyses including cell quality control, finding crossover intervals, visualising crossover regions, calculating genetic distances and resampling testings for sample group comparisons. In addition, the tunable filtering parameters for calling crossovers enable <code>comapr</code> to be applied for datasets with different coverages.</p> </div> <div id="session-info" class="section level2"> <h2>Session info</h2> <div class="sourceCode" id="cb140"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb140-1"><a href="#cb140-1" aria-hidden="true" tabindex="-1"></a><span class="fu">sessionInfo</span>()</span></code></pre></div> <pre><code>R version 4.1.0 (2021-05-18) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Red Hat Enterprise Linux 8.4 (Ootpa) Matrix products: default BLAS/LAPACK: /usr/lib64/libopenblasp-r0.3.12.so locale: [1] LC_CTYPE=en_AU.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_AU.UTF-8 LC_COLLATE=en_AU.UTF-8 [5] LC_MONETARY=en_AU.UTF-8 LC_MESSAGES=en_AU.UTF-8 [7] LC_PAPER=en_AU.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_AU.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] grid parallel stats4 stats graphics grDevices utils [8] datasets methods base other attached packages: [1] SummarizedExperiment_1.22.0 Biobase_2.52.0 [3] MatrixGenerics_1.4.3 matrixStats_0.61.0 [5] BiocParallel_1.26.2 Gviz_1.36.2 [7] GenomicRanges_1.44.0 GenomeInfoDb_1.28.4 [9] IRanges_2.26.0 S4Vectors_0.30.1 [11] BiocGenerics_0.38.0 dplyr_1.0.7 [13] ggplot2_3.3.5 comapr_0.99.37 loaded via a namespace (and not attached): [1] backports_1.2.1 circlize_0.4.13 Hmisc_4.5-0 [4] workflowr_1.6.2 BiocFileCache_2.0.0 plyr_1.8.6 [7] lazyeval_0.2.2 splines_4.1.0 digest_0.6.28 [10] foreach_1.5.1 ensembldb_2.16.4 htmltools_0.5.2 [13] fansi_0.5.0 magrittr_2.0.1 checkmate_2.0.0 [16] memoise_2.0.0 BSgenome_1.60.0 cluster_2.1.2 [19] Biostrings_2.60.2 prettyunits_1.1.1 jpeg_0.1-9 [22] colorspace_2.0-2 blob_1.2.2 rappdirs_0.3.3 [25] xfun_0.26 crayon_1.4.1 RCurl_1.98-1.5 [28] jsonlite_1.7.2 survival_3.2-11 VariantAnnotation_1.38.0 [31] iterators_1.0.13 glue_1.4.2 gtable_0.3.0 [34] zlibbioc_1.38.0 XVector_0.32.0 DelayedArray_0.18.0 [37] shape_1.4.6 scales_1.1.1 DBI_1.1.1 [40] Rcpp_1.0.7 viridisLite_0.4.0 progress_1.2.2 [43] htmlTable_2.2.1 foreign_0.8-81 bit_4.0.4 [46] Formula_1.2-4 htmlwidgets_1.5.4 httr_1.4.2 [49] RColorBrewer_1.1-2 ellipsis_0.3.2 pkgconfig_2.0.3 [52] XML_3.99-0.8 farver_2.1.0 nnet_7.3-16 [55] dbplyr_2.1.1 utf8_1.2.2 labeling_0.4.2 [58] tidyselect_1.1.1 rlang_0.4.11 reshape2_1.4.4 [61] later_1.3.0 AnnotationDbi_1.54.1 munsell_0.5.0 [64] tools_4.1.0 cachem_1.0.6 cli_3.0.1 [67] generics_0.1.0 RSQLite_2.2.8 evaluate_0.14 [70] stringr_1.4.0 fastmap_1.1.0 yaml_2.2.1 [73] knitr_1.36 bit64_4.0.5 fs_1.5.0 [76] purrr_0.3.4 KEGGREST_1.32.0 AnnotationFilter_1.16.0 [79] whisker_0.4 xml2_1.3.2 biomaRt_2.48.3 [82] compiler_4.1.0 rstudioapi_0.13 plotly_4.9.4.1 [85] filelock_1.0.2 curl_4.3.2 png_0.1-7 [88] statmod_1.4.36 tibble_3.1.4 stringi_1.7.4 [91] highr_0.9 GenomicFeatures_1.44.2 lattice_0.20-44 [94] ProtGenerics_1.24.0 Matrix_1.3-3 vctrs_0.3.8 [97] pillar_1.6.3 lifecycle_1.0.1 jquerylib_0.1.4 [100] GlobalOptions_0.1.2 data.table_1.14.2 bitops_1.0-7 [103] httpuv_1.6.3 rtracklayer_1.52.1 R6_2.5.1 [106] BiocIO_1.2.0 latticeExtra_0.6-29 promises_1.2.0.1 [109] gridExtra_2.3 codetools_0.2-18 dichromat_2.0-0 [112] assertthat_0.2.1 rprojroot_2.0.2 rjson_0.2.20 [115] withr_2.4.2 GenomicAlignments_1.28.0 Rsamtools_2.8.0 [118] GenomeInfoDbData_1.2.6 hms_1.1.1 rpart_4.1-15 [121] tidyr_1.1.4 rmarkdown_2.11 git2r_0.28.0 [124] biovizBase_1.40.0 base64enc_0.1-3 restfulr_0.0.13 </code></pre> </div> <div id="references" class="section level2"> <h2>References</h2> <div id="refs" class="references csl-bib-body hanging-indent"> <div id="ref-Hinch2019-dt" class="csl-entry"> Hinch, Anjali G, Gang Zhang, Philipp W Becker, Daniela Moralli, Robert Hinch, Benjamin Davies, Rory Bowden, and Peter Donnelly. 2019. <span>“Factors Influencing Meiotic Recombination Revealed by Whole-Genome Sequencing of Single Sperm.”</span> <em>Science</em> 363 (6433). </div> <div id="ref-Keane2011-be" class="csl-entry"> Keane, Thomas M, Leo Goodstadt, Petr Danecek, Michael A White, Kim Wong, Binnaz Yalcin, Andreas Heger, et al. 2011. <span>“Mouse Genomic Variation and Its Effect on Phenotypes and Gene Regulation.”</span> <em>Nature</em> 477 (7364): 289–94. </div> <div id="ref-Phipson2010-xi" class="csl-entry"> Phipson, Belinda, and Gordon K Smyth. 2010. <span>“Permutation p-Values Should Never Be Zero: Calculating Exact p-Values When Permutations Are Randomly Drawn.”</span> <em>Stat. Appl. Genet. Mol. Biol.</em> 9 (October): Article39. </div> </div> <br> <p> <button type="button" class="btn btn-default btn-workflowr btn-workflowr-sessioninfo" data-toggle="collapse" data-target="#workflowr-sessioninfo" style="display: block;"> <span class="glyphicon glyphicon-wrench" aria-hidden="true"></span> Session information </button> </p> <div id="workflowr-sessioninfo" class="collapse"> <div class="sourceCode" id="cb142"><pre class="sourceCode r"><code class="sourceCode r"><span id="cb142-1"><a href="#cb142-1" aria-hidden="true" tabindex="-1"></a>devtools<span class="sc">::</span><span class="fu">session_info</span>()</span></code></pre></div> <pre><code>─ Session info ─────────────────────────────────────────────────────────────── setting value version R version 4.1.0 (2021-05-18) os Red Hat Enterprise Linux 8.4 (Ootpa) system x86_64, linux-gnu ui X11 language (EN) collate en_AU.UTF-8 ctype en_AU.UTF-8 tz Australia/Melbourne date 2022-01-10 ─ Packages ─────────────────────────────────────────────────────────────────── package * version date lib source AnnotationDbi 1.54.1 2021-06-08 [1] Bioconductor AnnotationFilter 1.16.0 2021-05-19 [1] Bioconductor assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.1.0) backports 1.2.1 2020-12-09 [1] CRAN (R 4.1.0) base64enc 0.1-3 2015-07-28 [1] CRAN (R 4.1.0) Biobase * 2.52.0 2021-05-19 [1] Bioconductor BiocFileCache 2.0.0 2021-05-19 [1] Bioconductor BiocGenerics * 0.38.0 2021-05-19 [1] Bioconductor BiocIO 1.2.0 2021-05-19 [1] Bioconductor BiocParallel * 1.26.2 2021-08-22 [1] Bioconductor biomaRt 2.48.3 2021-08-15 [1] Bioconductor Biostrings 2.60.2 2021-08-05 [1] Bioconductor biovizBase 1.40.0 2021-05-19 [1] Bioconductor bit 4.0.4 2020-08-04 [1] CRAN (R 4.1.0) bit64 4.0.5 2020-08-30 [1] CRAN (R 4.1.0) bitops 1.0-7 2021-04-24 [1] CRAN (R 4.1.0) blob 1.2.2 2021-07-23 [1] CRAN (R 4.1.0) BSgenome 1.60.0 2021-05-19 [1] Bioconductor cachem 1.0.6 2021-08-19 [1] CRAN (R 4.1.0) callr 3.7.0 2021-04-20 [1] CRAN (R 4.1.0) checkmate 2.0.0 2020-02-06 [1] CRAN (R 4.1.0) circlize 0.4.13 2021-06-09 [1] CRAN (R 4.1.0) cli 3.0.1 2021-07-17 [1] CRAN (R 4.1.0) cluster 2.1.2 2021-04-17 [2] CRAN (R 4.1.0) codetools 0.2-18 2020-11-04 [2] CRAN (R 4.1.0) colorspace 2.0-2 2021-06-24 [1] CRAN (R 4.1.0) comapr * 0.99.37 2021-11-28 [1] Github (ruqianl/comapr@aad1b6a) crayon 1.4.1 2021-02-08 [1] CRAN (R 4.1.0) curl 4.3.2 2021-06-23 [1] CRAN (R 4.1.0) data.table 1.14.2 2021-09-27 [1] CRAN (R 4.1.0) DBI 1.1.1 2021-01-15 [1] CRAN (R 4.1.0) dbplyr 2.1.1 2021-04-06 [1] CRAN (R 4.1.0) DelayedArray 0.18.0 2021-05-19 [1] Bioconductor desc 1.4.0 2021-09-28 [1] CRAN (R 4.1.0) devtools 2.4.2 2021-06-07 [1] CRAN (R 4.1.0) dichromat 2.0-0 2013-01-24 [1] CRAN (R 4.1.0) digest 0.6.28 2021-09-23 [1] CRAN (R 4.1.0) dplyr * 1.0.7 2021-06-18 [1] CRAN (R 4.1.0) ellipsis 0.3.2 2021-04-29 [1] CRAN (R 4.1.0) ensembldb 2.16.4 2021-08-05 [1] Bioconductor evaluate 0.14 2019-05-28 [1] CRAN (R 4.1.0) fansi 0.5.0 2021-05-25 [1] CRAN (R 4.1.0) farver 2.1.0 2021-02-28 [1] CRAN (R 4.1.0) fastmap 1.1.0 2021-01-25 [1] CRAN (R 4.1.0) filelock 1.0.2 2018-10-05 [1] CRAN (R 4.1.0) foreach 1.5.1 2020-10-15 [1] CRAN (R 4.1.0) foreign 0.8-81 2020-12-22 [2] CRAN (R 4.1.0) Formula 1.2-4 2020-10-16 [1] CRAN (R 4.1.0) fs 1.5.0 2020-07-31 [1] CRAN (R 4.1.0) generics 0.1.0 2020-10-31 [1] CRAN (R 4.1.0) GenomeInfoDb * 1.28.4 2021-09-05 [1] Bioconductor GenomeInfoDbData 1.2.6 2021-09-30 [1] Bioconductor GenomicAlignments 1.28.0 2021-05-19 [1] Bioconductor GenomicFeatures 1.44.2 2021-08-26 [1] Bioconductor GenomicRanges * 1.44.0 2021-05-19 [1] Bioconductor ggplot2 * 3.3.5 2021-06-25 [1] CRAN (R 4.1.0) git2r 0.28.0 2021-01-10 [1] CRAN (R 4.1.0) GlobalOptions 0.1.2 2020-06-10 [1] CRAN (R 4.1.0) glue 1.4.2 2020-08-27 [1] CRAN (R 4.1.0) gridExtra 2.3 2017-09-09 [1] CRAN (R 4.1.0) gtable 0.3.0 2019-03-25 [1] CRAN (R 4.1.0) Gviz * 1.36.2 2021-07-04 [1] Bioconductor highr 0.9 2021-04-16 [1] CRAN (R 4.1.0) Hmisc 4.5-0 2021-02-28 [1] CRAN (R 4.1.0) hms 1.1.1 2021-09-26 [1] CRAN (R 4.1.0) htmlTable 2.2.1 2021-05-18 [1] CRAN (R 4.1.0) htmltools 0.5.2 2021-08-25 [1] CRAN (R 4.1.0) htmlwidgets 1.5.4 2021-09-08 [1] CRAN (R 4.1.0) httpuv 1.6.3 2021-09-09 [1] CRAN (R 4.1.0) httr 1.4.2 2020-07-20 [1] CRAN (R 4.1.0) IRanges * 2.26.0 2021-05-19 [1] Bioconductor iterators 1.0.13 2020-10-15 [1] CRAN (R 4.1.0) jpeg 0.1-9 2021-07-24 [1] CRAN (R 4.1.0) jquerylib 0.1.4 2021-04-26 [1] CRAN (R 4.1.0) jsonlite 1.7.2 2020-12-09 [1] CRAN (R 4.1.0) KEGGREST 1.32.0 2021-05-19 [1] Bioconductor knitr 1.36 2021-09-29 [1] CRAN (R 4.1.0) labeling 0.4.2 2020-10-20 [1] CRAN (R 4.1.0) later 1.3.0 2021-08-18 [1] CRAN (R 4.1.0) lattice 0.20-44 2021-05-02 [2] CRAN (R 4.1.0) latticeExtra 0.6-29 2019-12-19 [1] CRAN (R 4.1.0) lazyeval 0.2.2 2019-03-15 [1] CRAN (R 4.1.0) lifecycle 1.0.1 2021-09-24 [1] CRAN (R 4.1.0) magrittr 2.0.1 2020-11-17 [1] CRAN (R 4.1.0) Matrix 1.3-3 2021-05-04 [2] CRAN (R 4.1.0) MatrixGenerics * 1.4.3 2021-08-26 [1] Bioconductor matrixStats * 0.61.0 2021-09-17 [1] CRAN (R 4.1.0) memoise 2.0.0 2021-01-26 [1] CRAN (R 4.1.0) munsell 0.5.0 2018-06-12 [1] CRAN (R 4.1.0) nnet 7.3-16 2021-05-03 [2] CRAN (R 4.1.0) pillar 1.6.3 2021-09-26 [1] CRAN (R 4.1.0) pkgbuild 1.2.0 2020-12-15 [1] CRAN (R 4.1.0) pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.1.0) pkgload 1.2.2 2021-09-11 [1] CRAN (R 4.1.0) plotly 4.9.4.1 2021-06-18 [1] CRAN (R 4.1.0) plyr 1.8.6 2020-03-03 [1] CRAN (R 4.1.0) png 0.1-7 2013-12-03 [1] CRAN (R 4.1.0) prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.1.0) processx 3.5.2 2021-04-30 [1] CRAN (R 4.1.0) progress 1.2.2 2019-05-16 [1] CRAN (R 4.1.0) promises 1.2.0.1 2021-02-11 [1] CRAN (R 4.1.0) ProtGenerics 1.24.0 2021-05-19 [1] Bioconductor ps 1.6.0 2021-02-28 [1] CRAN (R 4.1.0) purrr 0.3.4 2020-04-17 [1] CRAN (R 4.1.0) R6 2.5.1 2021-08-19 [1] CRAN (R 4.1.0) rappdirs 0.3.3 2021-01-31 [1] CRAN (R 4.1.0) RColorBrewer 1.1-2 2014-12-07 [1] CRAN (R 4.1.0) Rcpp 1.0.7 2021-07-07 [1] CRAN (R 4.1.0) RCurl 1.98-1.5 2021-09-17 [1] CRAN (R 4.1.0) remotes 2.4.1 2021-09-29 [1] CRAN (R 4.1.0) reshape2 1.4.4 2020-04-09 [1] CRAN (R 4.1.0) restfulr 0.0.13 2017-08-06 [1] CRAN (R 4.1.0) rjson 0.2.20 2018-06-08 [1] CRAN (R 4.1.0) rlang 0.4.11 2021-04-30 [1] CRAN (R 4.1.0) rmarkdown 2.11 2021-09-14 [1] CRAN (R 4.1.0) rpart 4.1-15 2019-04-12 [2] CRAN (R 4.1.0) rprojroot 2.0.2 2020-11-15 [1] CRAN (R 4.1.0) Rsamtools 2.8.0 2021-05-19 [1] Bioconductor RSQLite 2.2.8 2021-08-21 [1] CRAN (R 4.1.0) rstudioapi 0.13 2020-11-12 [1] CRAN (R 4.1.0) rtracklayer 1.52.1 2021-08-15 [1] Bioconductor S4Vectors * 0.30.1 2021-09-26 [1] Bioconductor scales 1.1.1 2020-05-11 [1] CRAN (R 4.1.0) sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.1.0) shape 1.4.6 2021-05-19 [1] CRAN (R 4.1.0) statmod 1.4.36 2021-05-10 [1] CRAN (R 4.1.0) stringi 1.7.4 2021-08-25 [1] CRAN (R 4.1.0) stringr 1.4.0 2019-02-10 [1] CRAN (R 4.1.0) SummarizedExperiment * 1.22.0 2021-05-19 [1] Bioconductor survival 3.2-11 2021-04-26 [2] CRAN (R 4.1.0) testthat 3.0.4 2021-07-01 [1] CRAN (R 4.1.0) tibble 3.1.4 2021-08-25 [1] CRAN (R 4.1.0) tidyr 1.1.4 2021-09-27 [1] CRAN (R 4.1.0) tidyselect 1.1.1 2021-04-30 [1] CRAN (R 4.1.0) usethis 2.0.1 2021-02-10 [1] CRAN (R 4.1.0) utf8 1.2.2 2021-07-24 [1] CRAN (R 4.1.0) VariantAnnotation 1.38.0 2021-05-19 [1] Bioconductor vctrs 0.3.8 2021-04-29 [1] CRAN (R 4.1.0) viridisLite 0.4.0 2021-04-13 [1] CRAN (R 4.1.0) whisker 0.4 2019-08-28 [1] CRAN (R 4.1.0) withr 2.4.2 2021-04-18 [1] CRAN (R 4.1.0) workflowr 1.6.2 2020-04-30 [1] CRAN (R 4.1.0) xfun 0.26 2021-09-14 [1] CRAN (R 4.1.0) XML 3.99-0.8 2021-09-17 [1] CRAN (R 4.1.0) xml2 1.3.2 2020-04-23 [1] CRAN (R 4.1.0) XVector 0.32.0 2021-05-19 [1] Bioconductor yaml 2.2.1 2020-02-01 [1] CRAN (R 4.1.0) zlibbioc 1.38.0 2021-05-19 [1] Bioconductor [1] /mnt/beegfs/mccarthy/scratch/general/rlyu/Software/R/Rlib/4.1.0/yeln [2] /opt/R/4.1.0/lib/R/library</code></pre> </div> </div> <!-- Adjust MathJax settings so that all math formulae are shown using TeX fonts only; see http://docs.mathjax.org/en/latest/configuration.html. This will make the presentation more consistent at the cost of the webpage sometimes taking slightly longer to load. Note that this only works because the footer is added to webpages before the MathJax javascript. --> <script type="text/x-mathjax-config"> MathJax.Hub.Config({ "HTML-CSS": { availableFonts: ["TeX"] } }); </script> </div> </div> </div> <script> // add bootstrap table styles to pandoc tables function bootstrapStylePandocTables() { $('tr.odd').parent('tbody').parent('table').addClass('table table-condensed'); } $(document).ready(function () { bootstrapStylePandocTables(); }); </script> <!-- tabsets --> <script> $(document).ready(function () { window.buildTabsets("TOC"); }); $(document).ready(function () { $('.tabset-dropdown > .nav-tabs > li').click(function () { $(this).parent().toggleClass('nav-tabs-open'); }); }); </script> <!-- code folding --> <script> $(document).ready(function () { window.initializeCodeFolding("hide" === "show"); }); </script> <script> $(document).ready(function () { // temporarily add toc-ignore selector to headers for the consistency with Pandoc $('.unlisted.unnumbered').addClass('toc-ignore') // move toc-ignore selectors from section div to header $('div.section.toc-ignore') .removeClass('toc-ignore') .children('h1,h2,h3,h4,h5').addClass('toc-ignore'); // establish options var options = { selectors: "h1,h2,h3", theme: "bootstrap3", context: '.toc-content', hashGenerator: function (text) { return text.replace(/[.\\/?&!#<>]/g, '').replace(/\s/g, '_'); }, ignoreSelector: ".toc-ignore", scrollTo: 0 }; options.showAndHide = true; options.smoothScroll = true; // tocify var toc = $("#TOC").tocify(options).data("toc-tocify"); }); </script> <!-- dynamically load mathjax for compatibility with self-contained --> <script> (function () { var script = document.createElement("script"); script.type = "text/javascript"; script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"; document.getElementsByTagName("head")[0].appendChild(script); })(); </script> </body> </html>