<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>Raymond Parcon</title>
<link>https://rayparcon.com/blog/blog.html</link>
<atom:link href="https://rayparcon.com/blog/blog.xml" rel="self" type="application/rss+xml"/>
<description>Thoughts, notes, and small discoveries from a Ph.D. student exploring fungi, genomes, research, and everything in between
</description>
<image>
<url>https://rayparcon.com/../about/ray.jpg</url>
<title>Raymond Parcon</title>
<link>https://rayparcon.com/blog/blog.html</link>
</image>
<generator>quarto-1.9.38</generator>
<lastBuildDate>Thu, 09 Jul 2026 00:00:00 GMT</lastBuildDate>
<item>
  <title>Moving Files and Navigating SMS Lab Filesystems in Sapelo2</title>
  <dc:creator>Raymond Parcon</dc:creator>
  <link>https://rayparcon.com/blog/for_smslab/nav_filesystems.html</link>
  <description><![CDATA[ 




<section id="overview" class="level2">
<h2 class="anchored" data-anchor-id="overview">Overview</h2>
<p>This guide introduces basic command-line navigation and file movement on Sapelo2 for users working in the SMS Lab filesystem. It covers how to log in using PuTTY, move around the <code>/home/</code>, <code>/work/</code>, <code>/scratch/</code>, and <code>/project/</code> directories, and safely copy or back up files using the transfer node.</p>
<p>The examples below use <code>username</code> as a placeholder. Replace it with your own UGA MyID.</p>
<hr>
</section>
<section id="essential-linux-commands" class="level2">
<h2 class="anchored" data-anchor-id="essential-linux-commands">1. Essential Linux Commands</h2>
<table class="caption-top table">
<thead>
<tr class="header">
<th>Command</th>
<th>Purpose</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>pwd</code></td>
<td>Prints the current directory you are in</td>
</tr>
<tr class="even">
<td><code>ls -l</code></td>
<td>Lists files and directories in long format</td>
</tr>
<tr class="odd">
<td><code>cd</code></td>
<td>Changes directory</td>
</tr>
<tr class="even">
<td><code>mkdir</code></td>
<td>Creates a new directory</td>
</tr>
<tr class="odd">
<td><code>mv</code></td>
<td>Moves or renames files and directories</td>
</tr>
</tbody>
</table>
<section id="check-your-current-location-with-pwd" class="level3">
<h3 class="anchored" data-anchor-id="check-your-current-location-with-pwd">Check your current location with <code>pwd</code></h3>
<p>After logging in, use:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb1-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">pwd</span></span></code></pre></div></div>
<p>Example:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb2-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">username@ss-sub1</span> ~$ pwd</span>
<span id="cb2-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">/home/username</span></span></code></pre></div></div>
<p>This shows that you are currently in your home directory.</p>
</section>
<section id="list-files-with-ls--l" class="level3">
<h3 class="anchored" data-anchor-id="list-files-with-ls--l">List files with <code>ls -l</code></h3>
<p>To view the files and directories in your current location:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ls</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-l</span></span></code></pre></div></div>
<p>This shows file permissions, ownership, size, date modified, and file or directory names.</p>
</section>
<section id="change-directories-with-cd" class="level3">
<h3 class="anchored" data-anchor-id="change-directories-with-cd">Change directories with <code>cd</code></h3>
<p>To move into another directory, use:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb4-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> /path/to/directory</span></code></pre></div></div>
<p>For example, to access the SMS Lab work directory:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb5" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb5-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> /work/smslab/directory-name</span></code></pre></div></div>
<p>After changing directories, confirm your location:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb6" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb6-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">pwd</span></span></code></pre></div></div>
</section>
<section id="create-a-directory-with-mkdir" class="level3">
<h3 class="anchored" data-anchor-id="create-a-directory-with-mkdir">Create a directory with <code>mkdir</code></h3>
<p>To create a new directory:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb7-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mkdir</span> new_directory_name</span></code></pre></div></div>
<p>For example:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb8-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mkdir</span> genome_assembly_backup</span></code></pre></div></div>
</section>
<section id="move-or-rename-files-with-mv" class="level3">
<h3 class="anchored" data-anchor-id="move-or-rename-files-with-mv">Move or rename files with <code>mv</code></h3>
<p>To move a file into another directory:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb9-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> file.txt /work/smslab/directory-name/</span></code></pre></div></div>
<p>To rename a file:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb10-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> old_name.txt new_name.txt</span></code></pre></div></div>
<p>To move a directory:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb11-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mv</span> old_directory /work/smslab/directory-name/</span></code></pre></div></div>
<hr>
</section>
</section>
<section id="logging-in-to-sapelo2-with-putty" class="level2">
<h2 class="anchored" data-anchor-id="logging-in-to-sapelo2-with-putty">2. Logging in to Sapelo2 with PuTTY</h2>
<p>Open PuTTY and enter the appropriate server address in the <strong>Host Name</strong> field.</p>
<section id="sapelo2-login-node" class="level3">
<h3 class="anchored" data-anchor-id="sapelo2-login-node">Sapelo2 login node</h3>
<p>Use this when you are working interactively, submitting jobs, checking files, or preparing scripts.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb12-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">username@sapelo2.gacrc.uga.edu</span></span></code></pre></div></div>
<p>Most routine work begins here.</p>
</section>
<section id="transfer-node" class="level3">
<h3 class="anchored" data-anchor-id="transfer-node">Transfer node</h3>
<p>Use this when moving large files between filesystems or when working with storage locations such as <code>/project/</code>.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb13-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">username@xfer.gacrc.uga.edu</span></span></code></pre></div></div>
<p>The transfer node is intended for file movement, not for running computational jobs.</p>
<hr>
</section>
</section>
<section id="starting-in-the-home-directory" class="level2">
<h2 class="anchored" data-anchor-id="starting-in-the-home-directory">3. Starting in the Home Directory</h2>
<p>After logging in to Sapelo2, you usually start in your home directory.</p>
<p>Example:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb14-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">username@ss-sub1</span> ~$ pwd</span>
<span id="cb14-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">/home/username</span></span></code></pre></div></div>
<p>Your home directory is useful for small scripts, configuration files, and lightweight work. Large datasets and computational outputs should usually be stored in <code>/work/</code>, <code>/scratch/</code>, or <code>/project/</code>, depending on the purpose.</p>
<hr>
</section>
<section id="navigating-to-the-sms-lab-work-directory" class="level2">
<h2 class="anchored" data-anchor-id="navigating-to-the-sms-lab-work-directory">4. Navigating to the SMS Lab Work Directory</h2>
<p>To move into the SMS Lab work directory:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb15-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> /work/smslab/directory-name</span></code></pre></div></div>
<p>Then confirm your location:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb16-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">pwd</span></span></code></pre></div></div>
<p>Example:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb17" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb17-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">pwd</span></span>
<span id="cb17-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">/work/smslab/directory-name</span></span></code></pre></div></div>
<p>You can also list the contents of the directory:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb18-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ls</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-l</span></span></code></pre></div></div>
<hr>
</section>
<section id="navigating-to-scratch" class="level2">
<h2 class="anchored" data-anchor-id="navigating-to-scratch">5. Navigating to Scratch</h2>
<p>The same navigation commands apply to the <code>/scratch/</code> directory.</p>
<p>For example:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb19-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> /scratch/username</span></code></pre></div></div>
<p>Then confirm your location:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb20-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">pwd</span></span></code></pre></div></div>
<div class="callout callout-style-default callout-warning callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Warning
</div>
</div>
<div class="callout-body-container callout-body">
<p>The <code>/scratch/</code> filesystem is intended for temporary files and active computational work. Files that have not been accessed or modified for more than 30 days, as per GACRC guidelines, may be automatically deleted. Do not treat <code>/scratch/</code> as permanent storage.</p>


</div>
</div>
</section>

 ]]></description>
  <category>Linux</category>
  <category>Sapelo2</category>
  <category>SMSLab</category>
  <guid>https://rayparcon.com/blog/for_smslab/nav_filesystems.html</guid>
  <pubDate>Thu, 09 Jul 2026 00:00:00 GMT</pubDate>
</item>
<item>
  <title>How to Run STRUCTURE on HPC (Sapelo2) Using Structure_threader and Visualize Results Using R</title>
  <dc:creator>Raymond Parcon</dc:creator>
  <link>https://rayparcon.com/blog/2026-06-27-structure-hpc/</link>
  <description><![CDATA[ 




<section id="background" class="level2">
<h2 class="anchored" data-anchor-id="background">Background</h2>
<p><strong>STRUCTURE</strong> is a powerful tool for inferring population structure from multilocus genotype data, including single-nucleotide polymorphisms (SNPs). However, getting STRUCTURE to run efficiently is not always straightforward. It can be computationally intensive, requires careful data preparation and parameter selection, and often involves long processing times. As the number of samples, markers, and model parameters increases, the computational demand also increases substantially. In some cases, analyses can take weeks or even months to complete.</p>
<p>As someone still learning population genomics and bioinformatics back then, I quickly found myself facing this challenge. I needed to find a practical way to run STRUCTURE more efficiently using the high-performance computing cluster at the University of Georgia. Fortunately, I came across Structure_threader, a tool designed to help parallelize STRUCTURE runs. Even then, the process involved a considerable amount of troubleshooting.</p>
<p>By documenting this workflow, I hope to show the key steps I learned along the way and provide a practical guide for running STRUCTURE with the help of Structure_threader in an HPC environment. My goal is not to cover every possible scenario, but to lay out the basics clearly enough to make the process more approachable and efficient for anyone who may find themselves in the same situation I was before.</p>
</section>
<section id="workflow" class="level2">
<h2 class="anchored" data-anchor-id="workflow">Workflow</h2>
<p>I will describe how to run a model-based Bayesian population structure analysis using <strong>STRUCTURE</strong> through <strong>Structure_threader</strong> on the University of Georgia Sapelo2 high-performance computing environment. The workflow assumes that filtered SNPs are available in variant call format (<code>.vcf</code>) and will be converted to STRUCTURE format (<code>.str</code>) using <strong>PGDSpider</strong>.</p>
<p>The example below follows the analysis settings I used for my SNP dataset:</p>
<ul>
<li>STRUCTURE version: <code>2.3.4</code></li>
<li>Structure_threader version: <code>1.3.10</code></li>
<li>Input format: haploid STRUCTURE file (<code>.str</code>)</li>
<li>Burn-in: <code>500000</code></li>
<li>MCMC iterations after burn-in: <code>1000000</code></li>
<li>Maximum number of populations tested: <code>K = 25</code></li>
<li>Replicates per K: <code>10</code></li>
<li>HPC environment: UGA Sapelo2</li>
</ul>
</section>
<section id="required-files" class="level2">
<h2 class="anchored" data-anchor-id="required-files">Required files</h2>
<p>Before running Structure_threader, place the following files in the same HPC working directory:</p>
<table class="caption-top table">
<colgroup>
<col style="width: 30%">
<col style="width: 40%">
<col style="width: 30%">
</colgroup>
<thead>
<tr class="header">
<th>File</th>
<th style="text-align: right;">Required filename?</th>
<th>Purpose</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>*.str</code></td>
<td style="text-align: right;">No</td>
<td>STRUCTURE-formatted SNP input file</td>
</tr>
<tr class="even">
<td><code>mainparams</code></td>
<td style="text-align: right;">Yes</td>
<td>Main STRUCTURE configuration file</td>
</tr>
<tr class="odd">
<td><code>extraparams</code></td>
<td style="text-align: right;">Yes</td>
<td>Extra STRUCTURE configuration file</td>
</tr>
<tr class="even">
<td><code>strthreader.sh</code></td>
<td style="text-align: right;">No</td>
<td>SLURM job script used to run Structure_threader</td>
</tr>
</tbody>
</table>
<div class="callout callout-style-default callout-warning callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Warning
</div>
</div>
<div class="callout-body-container callout-body">
<p>The files <code>mainparams</code> and <code>extraparams</code> should keep these exact filenames. STRUCTURE expects them by name in the working directory.</p>
</div>
</div>
</section>
<section id="step-1.-convert-vcf-to-structure-format-using-pgdspider" class="level2">
<h2 class="anchored" data-anchor-id="step-1.-convert-vcf-to-structure-format-using-pgdspider">Step 1. Convert VCF to STRUCTURE format using PGDSpider</h2>
<p>Use <a href="https://software.bioinformatics.unibe.ch/pgdspider/"><strong>PGDSpider</strong></a> to convert the filtered SNP VCF file to STRUCTURE format.</p>
<section id="pgdspider-vcf-parser-settings" class="level3">
<h3 class="anchored" data-anchor-id="pgdspider-vcf-parser-settings">PGDSpider VCF parser settings</h3>
<p>Use the following settings for a haploid SNP dataset:</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th>PGDSpider VCF parser question</th>
<th>Recommended answer</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Is the dataset haploid?</td>
<td><code>Yes</code></td>
</tr>
<tr class="even">
<td>Exclude loci with only missing data?</td>
<td><code>No</code></td>
</tr>
<tr class="odd">
<td>Is <code>PL</code> or <code>GL</code> given in the genotype field?</td>
<td><code>Yes</code></td>
</tr>
<tr class="even">
<td>Include non-polymorphic SNPs?</td>
<td><code>No</code></td>
</tr>
<tr class="odd">
<td>Select population definition file?</td>
<td>Use a population map file</td>
</tr>
</tbody>
</table>
<p>The population definition file should be a plain text file with one isolate per line:</p>
<pre class="text"><code>isolate001 GA
isolate002 GA
isolate003 MS
isolate004 AL</code></pre>
<p>The required format is:</p>
<pre class="text"><code>isolate&lt;whitespace&gt;population</code></pre>
</section>
<section id="pgdspider-structure-writer-settings" class="level3">
<h3 class="anchored" data-anchor-id="pgdspider-structure-writer-settings">PGDSpider STRUCTURE writer settings</h3>
<table class="caption-top table">
<thead>
<tr class="header">
<th>PGDSpider STRUCTURE writer question</th>
<th>Recommended answer</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>Compatible with fastSTRUCTURE format?</td>
<td><code>No</code></td>
</tr>
<tr class="even">
<td>Include inter-marker distances?</td>
<td><code>No</code></td>
</tr>
<tr class="odd">
<td>Data type</td>
<td><code>SNP</code></td>
</tr>
</tbody>
</table>
<p>The fastSTRUCTURE-compatible option should be set to <code>No</code> because this workflow uses haploid STRUCTURE input for STRUCTURE version 2.3.4.</p>
</section>
</section>
<section id="step-2.-transfer-the-.str-file-to-sapelo2" class="level2">
<h2 class="anchored" data-anchor-id="step-2.-transfer-the-.str-file-to-sapelo2">Step 2. Transfer the <code>.str</code> file to Sapelo2</h2>
<p>After conversion, transfer the <code>.str</code> file to the HPC working directory using FTP servers or <code>scp</code></p>
<p>After logging in to Sapelo2, make the file UNIX-readable:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb3" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb3-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> /full/path/to/working/directory</span>
<span id="cb3-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">dos2unix</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span>filename<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span>.str</span></code></pre></div></div>
<p>If <code>mainparams</code>, <code>extraparams</code>, or the SLURM script were edited on Windows, also run:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb4" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb4-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">dos2unix</span> mainparams extraparams strthreader.sh</span></code></pre></div></div>
</section>
<section id="step-3.-prepare-mainparams" class="level2">
<h2 class="anchored" data-anchor-id="step-3.-prepare-mainparams">Step 3. Prepare <code>mainparams</code></h2>
<p>There are two acceptable ways to prepare <code>mainparams</code>.</p>
<section id="option-a.-generate-mainparams-using-the-structure-graphical-interface" class="level3">
<h3 class="anchored" data-anchor-id="option-a.-generate-mainparams-using-the-structure-graphical-interface">Option A. Generate <code>mainparams</code> using the STRUCTURE graphical interface</h3>
<ol type="1">
<li>Open STRUCTURE locally.</li>
<li>Create a new project using the <code>.str</code> file.</li>
<li>Check the <code>.str</code> file in a text editor before importing.</li>
<li>Confirm the following:
<ul>
<li>the missing genotype value is correct, usually <code>-9</code> or <code>0</code>;</li>
<li>there is a row of marker names, if exported that way by PGDSpider;</li>
<li>data for each individual are stored in a single line;</li>
<li>individual IDs are included;</li>
<li>putative population origin is included.</li>
</ul></li>
<li>Export or copy the generated <code>mainparams</code>.</li>
<li>Upload <code>mainparams</code> to the HPC working directory.</li>
<li>Modify <code>mainparams</code> if needed.</li>
</ol>
</section>
<section id="option-b.-copy-an-existing-mainparams-and-edit-dataset-specific-values" class="level3">
<h3 class="anchored" data-anchor-id="option-b.-copy-an-existing-mainparams-and-edit-dataset-specific-values">Option B. Copy an existing <code>mainparams</code> and edit dataset-specific values</h3>
<p>Edit at least the following fields:</p>
<pre class="text"><code>#define NUMINDS    178
#define NUMLOCI    3470
#define PLOIDY     1
#define MISSING    -9
#define ONEROWPERIND 1
#define LABEL      1
#define POPDATA    1
#define MARKERNAMES 1
#define MAPDISTANCES 0
#define MAXPOPS    25
#define BURNIN     500000
#define NUMREPS    1000000</code></pre>
<p>Adjust these values for each dataset:</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th>Field</th>
<th>Meaning</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>NUMINDS</code></td>
<td>Number of isolates or individuals</td>
</tr>
<tr class="even">
<td><code>NUMLOCI</code></td>
<td>Number of SNP loci</td>
</tr>
<tr class="odd">
<td><code>PLOIDY</code></td>
<td>Use <code>1</code> for haploid data</td>
</tr>
<tr class="even">
<td><code>MISSING</code></td>
<td>Missing genotype code in the <code>.str</code> file</td>
</tr>
<tr class="odd">
<td><code>MAXPOPS</code></td>
<td>Maximum number of populations tested</td>
</tr>
<tr class="even">
<td><code>BURNIN</code></td>
<td>Burn-in iterations</td>
</tr>
<tr class="odd">
<td><code>NUMREPS</code></td>
<td>MCMC iterations after burn-in</td>
</tr>
</tbody>
</table>
<div class="callout callout-style-default callout-important callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Important
</div>
</div>
<div class="callout-body-container callout-body">
<p>The <code>MAXPOPS</code> value in <code>mainparams</code> must match the <code>-K</code> value in the Structure_threader command. For example, if <code>MAXPOPS</code> is <code>25</code>, use <code>-K 25</code>.</p>
</div>
</div>
</section>
</section>
<section id="step-4.-prepare-extraparams" class="level2">
<h2 class="anchored" data-anchor-id="step-4.-prepare-extraparams">Step 4. Prepare <code>extraparams</code></h2>
<p>Use the default <code>extraparams</code> file unless there is a specific reason to modify the STRUCTURE model. In this workflow, all remaining STRUCTURE parameters are left at their default settings.</p>
<p>Place <code>extraparams</code> in the same HPC working directory as:</p>
<pre class="text"><code>mainparams
&lt;filename&gt;.str
strthreader.sh</code></pre>
</section>
<section id="step-5.-create-the-structure_threader-slurm-script" class="level2">
<h2 class="anchored" data-anchor-id="step-5.-create-the-structure_threader-slurm-script">Step 5. Create the Structure_threader SLURM script</h2>
<p>Save the following script as <code>strthreader.sh</code>.</p>
<p>Revise the user-specific paths, email address, dataset name, CPU count, memory, and runtime as needed.</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb7" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb7-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#!/bin/bash</span></span>
<span id="cb7-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#SBATCH --job-name=StructureThreader</span></span>
<span id="cb7-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#SBATCH --partition=batch</span></span>
<span id="cb7-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#SBATCH --ntasks=1</span></span>
<span id="cb7-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#SBATCH --cpus-per-task=64</span></span>
<span id="cb7-6"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#SBATCH --mem=15G</span></span>
<span id="cb7-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#SBATCH --time=7-00:00:00</span></span>
<span id="cb7-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#SBATCH --output=/home/yourUGAMyID/logs/structure/%x_%j.out</span></span>
<span id="cb7-9"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#SBATCH --error=/home/yourUGAMyID/logs/structure/%x_%j.err</span></span>
<span id="cb7-10"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#SBATCH --mail-user=yourUGAMyID@uga.edu</span></span>
<span id="cb7-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">#SBATCH --mail-type=ALL</span></span>
<span id="cb7-12"></span>
<span id="cb7-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -------------------------</span></span>
<span id="cb7-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># User-defined variables</span></span>
<span id="cb7-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -------------------------</span></span>
<span id="cb7-16"></span>
<span id="cb7-17"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">WORKDIR</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"/full/path/to/working/directory"</span></span>
<span id="cb7-18"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">DATASET</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;filename&gt;"</span></span>
<span id="cb7-19"></span>
<span id="cb7-20"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">MAXK</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>25</span>
<span id="cb7-21"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">REPS</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span>10</span>
<span id="cb7-22"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">THREADS</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${SLURM_CPUS_PER_TASK}</span></span>
<span id="cb7-23"></span>
<span id="cb7-24"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">INPUT_STR</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${WORKDIR}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${DATASET}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">.str"</span></span>
<span id="cb7-25"><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">OUTDIR</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${DATASET}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">_results_</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${MAXK}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">pop"</span></span>
<span id="cb7-26"></span>
<span id="cb7-27"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -------------------------</span></span>
<span id="cb7-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Load modules</span></span>
<span id="cb7-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -------------------------</span></span>
<span id="cb7-30"></span>
<span id="cb7-31"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">ml</span> structure_threader/1.3.10-foss-2022a</span>
<span id="cb7-32"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">ml</span> Structure/2.3.4-GCC-11.3.0</span>
<span id="cb7-33"></span>
<span id="cb7-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -------------------------</span></span>
<span id="cb7-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Run Structure_threader</span></span>
<span id="cb7-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># -------------------------</span></span>
<span id="cb7-37"></span>
<span id="cb7-38"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${WORKDIR}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span></span>
<span id="cb7-39"></span>
<span id="cb7-40"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">structure_threader</span> run <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-41">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-K</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${MAXK}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-42">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-R</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${REPS}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-43">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-t</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${THREADS}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-44">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-i</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${INPUT_STR}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-45">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-o</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${OUTDIR}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-46">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-st</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${EBROOTSTRUCTURE}</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">/bin/structure"</span> <span class="dt" style="color: #AD0000;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb7-47">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--log</span> 1</span></code></pre></div></div>
<section id="meaning-of-key-structure_threader-arguments" class="level3">
<h3 class="anchored" data-anchor-id="meaning-of-key-structure_threader-arguments">Meaning of key Structure_threader arguments</h3>
<table class="caption-top table">
<thead>
<tr class="header">
<th>Argument</th>
<th>Meaning</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td><code>-K 25</code></td>
<td>Test K values from 1 to 25</td>
</tr>
<tr class="even">
<td><code>-R 10</code></td>
<td>Run 10 replicate STRUCTURE analyses per K</td>
</tr>
<tr class="odd">
<td><code>-t 64</code></td>
<td>Use 64 parallel threads</td>
</tr>
<tr class="even">
<td><code>-i</code></td>
<td>Input <code>.str</code> file</td>
</tr>
<tr class="odd">
<td><code>-o</code></td>
<td>Output directory name</td>
</tr>
<tr class="even">
<td><code>-st</code></td>
<td>Absolute path to the STRUCTURE executable</td>
</tr>
<tr class="odd">
<td><code>--log 1</code></td>
<td>Write Structure_threader log information</td>
</tr>
</tbody>
</table>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p>The number of threads should be consistent across the SLURM request and Structure_threader command. If <code>#SBATCH --cpus-per-task=64</code>, then Structure_threader should also use <code>-t 64</code> or <code>THREADS=${SLURM_CPUS_PER_TASK}</code>.</p>
</div>
</div>
</section>
</section>
<section id="step-6.-check-the-working-directory-before-submission" class="level2">
<h2 class="anchored" data-anchor-id="step-6.-check-the-working-directory-before-submission">Step 6. Check the working directory before submission</h2>
<p>From the working directory, run:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb8" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb8-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">pwd</span></span>
<span id="cb8-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ls</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-lh</span></span></code></pre></div></div>
<p>Confirm that these files are present:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb9" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb9-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ls</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-lh</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span>filename<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span>.str mainparams extraparams strthreader.sh</span></code></pre></div></div>
<p>Check the relevant STRUCTURE settings:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb10" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb10-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">grep</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-E</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NUMINDS|NUMLOCI|PLOIDY|MISSING|MAXPOPS|BURNIN|NUMREPS"</span> mainparams</span></code></pre></div></div>
<p>Check that the log directory exists:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb11" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb11-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mkdir</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-p</span> /home/yourUGAMyID/logs/structure</span></code></pre></div></div>
<p>Check that the modules are available:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb12" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb12-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">ml</span> spider structure_threader</span>
<span id="cb12-2"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">ml</span> spider structure</span></code></pre></div></div>
</section>
<section id="step-7.-submit-the-job" class="level2">
<h2 class="anchored" data-anchor-id="step-7.-submit-the-job">Step 7. Submit the job</h2>
<p>Submit the Structure_threader job with:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb13" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb13-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">sbatch</span> strthreader.sh</span></code></pre></div></div>
<p>Check the job status:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb14" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb14-1"><span class="ex" style="color: null;
background-color: null;
font-style: inherit;">squeue</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">--me</span></span></code></pre></div></div>
<p>Check log files while the job is running or after it finishes:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb15" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb15-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tail</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-f</span> /home/yourUGAMyID/logs/structure/StructureThreader_JOBID.out</span>
<span id="cb15-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tail</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-f</span> /home/yourUGAMyID/logs/structure/StructureThreader_JOBID.err</span></code></pre></div></div>
<p>The <code>JOBID</code> is automatically generated based on SLURM job number.</p>
</section>
<section id="step-8.-inspect-output-files" class="level2">
<h2 class="anchored" data-anchor-id="step-8.-inspect-output-files">Step 8. Inspect output files</h2>
<p>After the run finishes, check the output directory:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb16" style="background: #f1f3f5;"><pre class="sourceCode bash code-with-copy"><code class="sourceCode bash"><span id="cb16-1"><span class="bu" style="color: null;
background-color: null;
font-style: inherit;">cd</span> /full/path/to/working/directory</span>
<span id="cb16-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ls</span> <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">-lh</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${DATASET}</span>_results_<span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">${MAXK}</span>pop</span></code></pre></div></div>
<p>A complete run should contain output files for each K value and replicate. With <code>-K 25</code> and <code>-R 10</code>, the expected number of STRUCTURE runs is:</p>
<pre class="text"><code>25 K values × 10 replicates = 250 STRUCTURE runs</code></pre>
<p>If some runs failed, check:</p>
<ol type="1">
<li>the SLURM <code>.err</code> file;</li>
<li>the Structure_threader log;</li>
<li>whether <code>MAXPOPS</code> in <code>mainparams</code> matches <code>-K</code>;</li>
<li>whether <code>NUMINDS</code>, <code>NUMLOCI</code>, <code>PLOIDY</code>, and <code>MISSING</code> are correct;</li>
<li>whether the <code>.str</code> file has UNIX line endings.</li>
</ol>
</section>
<section id="step-9.-transfer-results-for-visualization" class="level2">
<h2 class="anchored" data-anchor-id="step-9.-transfer-results-for-visualization">Step 9. Transfer results for visualization</h2>
<p>After the run completes, transfer the files in the output directory to the local machine for visualization in RStudio using FTP servers or <code>scp</code></p>
</section>
<section id="step-10.-visualize-structure-results-using-r" class="level2">
<h2 class="anchored" data-anchor-id="step-10.-visualize-structure-results-using-r">Step 10. Visualize STRUCTURE results using R</h2>
<p>Install and load the required R packages:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb18" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb18-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">install.packages</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ggplot2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"reshape2"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"gridExtra"</span>))</span>
<span id="cb18-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">install.packages</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pophelper"</span>)</span></code></pre></div></div>
<p>Load packages:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb19" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb19-1"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(pophelper)</span>
<span id="cb19-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(ggplot2)</span>
<span id="cb19-3"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(reshape2)</span>
<span id="cb19-4"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">library</span>(gridExtra)</span></code></pre></div></div>
<p>Read STRUCTURE output files:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb20" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb20-1">outdir <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"&lt;filename&gt;_results_25pop"</span></span>
<span id="cb20-2"></span>
<span id="cb20-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Adjust the pattern depending on the exact output filenames.</span></span>
<span id="cb20-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Keep only STRUCTURE result files, not SLURM logs or Structure_threader logs.</span></span>
<span id="cb20-5">structure_files <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">list.files</span>(</span>
<span id="cb20-6">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">path =</span> outdir,</span>
<span id="cb20-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">full.names =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb20-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">recursive =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span></span>
<span id="cb20-9">)</span>
<span id="cb20-10"></span>
<span id="cb20-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Read STRUCTURE Q matrices.</span></span>
<span id="cb20-12">qlist <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">readQ</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">files =</span> structure_files)</span></code></pre></div></div>
<p>Summarize and plot Q matrices:</p>
<div class="code-copy-outer-scaffold"><div class="sourceCode" id="cb21" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb21-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Summarize runs by K.</span></span>
<span id="cb21-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summariseQ</span>(qlist)</span>
<span id="cb21-3"></span>
<span id="cb21-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Plot individual ancestry coefficients.</span></span>
<span id="cb21-5"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">plotQ</span>(</span>
<span id="cb21-6">  qlist,</span>
<span id="cb21-7">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">imgoutput =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"join"</span>,</span>
<span id="cb21-8">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">returnplot =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb21-9">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">exportplot =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">TRUE</span>,</span>
<span id="cb21-10">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">basesize =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>,</span>
<span id="cb21-11">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">showindlab =</span> <span class="cn" style="color: #8f5902;
background-color: null;
font-style: inherit;">FALSE</span>,</span>
<span id="cb21-12">  <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">splab =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">paste0</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"K="</span>, <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">sapply</span>(qlist, ncol))</span>
<span id="cb21-13">)</span></code></pre></div></div>
<p>If isolate labels or population labels are available, import metadata and use them to order or annotate individuals before plotting.</p>
</section>
<section id="common-problems-and-fixes" class="level2">
<h2 class="anchored" data-anchor-id="common-problems-and-fixes">Common problems and fixes</h2>
<table class="caption-top table">
<colgroup>
<col style="width: 33%">
<col style="width: 33%">
<col style="width: 33%">
</colgroup>
<thead>
<tr class="header">
<th>Problem</th>
<th>Likely cause</th>
<th>Fix</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td>STRUCTURE fails immediately</td>
<td><code>mainparams</code> or <code>extraparams</code> missing</td>
<td>Confirm both files are in the working directory</td>
</tr>
<tr class="even">
<td>K values do not run as expected</td>
<td><code>MAXPOPS</code> and <code>-K</code> do not match</td>
<td>Set both to the same maximum K</td>
</tr>
<tr class="odd">
<td>Threading does not work correctly</td>
<td>SLURM CPUs and <code>-t</code> differ</td>
<td>Use <code>THREADS=${SLURM_CPUS_PER_TASK}</code></td>
</tr>
<tr class="even">
<td>Input file is unreadable</td>
<td>Windows line endings</td>
<td>Run <code>dos2unix *.str mainparams extraparams strthreader.sh</code></td>
</tr>
<tr class="odd">
<td>Wrong number of individuals or loci</td>
<td>Incorrect <code>NUMINDS</code> or <code>NUMLOCI</code></td>
<td>Recheck <code>.str</code> file and edit <code>mainparams</code></td>
</tr>
<tr class="even">
<td>Missing data interpreted incorrectly</td>
<td>Incorrect <code>MISSING</code> value</td>
<td>Confirm whether missing genotypes are coded as <code>-9</code> or <code>0</code></td>
</tr>
<tr class="odd">
<td>Job stops due to wall time</td>
<td>Runtime too short</td>
<td>Increase <code>#SBATCH --time</code></td>
</tr>
<tr class="even">
<td>Job stops due to memory</td>
<td>Memory too low</td>
<td>Increase <code>#SBATCH --mem</code></td>
</tr>
</tbody>
</table>
</section>
<section id="minimal-final-checklist" class="level2">
<h2 class="anchored" data-anchor-id="minimal-final-checklist">Minimal final checklist</h2>
<p>Before submitting:</p>
<ul>
<li>The <code>.vcf</code> file has been converted to <code>.str</code> using the haploid PGDSpider settings.</li>
<li>The <code>.str</code> file is in the HPC working directory.</li>
<li><code>dos2unix</code> has been run on input and configuration files.</li>
<li><code>mainparams</code> is present and correctly edited.</li>
<li><code>extraparams</code> is present.</li>
<li><code>MAXPOPS</code> in <code>mainparams</code> matches <code>-K</code> in the Structure_threader command.</li>
<li><code>#SBATCH --cpus-per-task</code> matches the Structure_threader thread count.</li>
<li>The STRUCTURE executable path is provided using <code>${EBROOTSTRUCTURE}/bin/structure</code>.</li>
<li>The output and error log directories exist.</li>
<li>The job is submitted using <code>sbatch strthreader.sh</code>.</li>
</ul>
<p>There you have it. I hope this workflow saves you some time and frustration in figuring out how to run STRUCTURE in an HPC environment. Please do not forget to cite the brilliant minds behind the software, modules, and R packages mentioned here. Proper citation is one small but important way we can acknowledge and thank the people who develop and maintain these tools for the research community. 😊</p>


</section>

 ]]></description>
  <category>STRUCTURE</category>
  <category>Population Genomics</category>
  <category>HPC</category>
  <category>Bioinformatics</category>
  <guid>https://rayparcon.com/blog/2026-06-27-structure-hpc/</guid>
  <pubDate>Sat, 27 Jun 2026 00:00:00 GMT</pubDate>
  <media:content url="https://rayparcon.com/blog/2026-06-27-structure-hpc/featured.png" medium="image" type="image/png" height="23" width="144"/>
</item>
<item>
  <title>Honored to have been recognized in Georgia Association of Plant Pathologists 2026 Meeting</title>
  <dc:creator>Ray Parcon</dc:creator>
  <link>https://rayparcon.com/blog/2026-05-13-gapp/</link>
  <description><![CDATA[ 




<p>I’m honored to be recognized as the top oral presenter among the amazing presentations at the recently concluded Georgia Association of Plant Pathologists 2026 Meeting. I’m also proud to have shared the moment with my lab mate, Sai, who also won in the poster category. Our hearts are full to represent the research that we do, and the support and encouragement we receive from the Smith lab. 🔬🧬</p>
<div class="post-image">
<p><img src="https://rayparcon.com/blog/2026-05-13-gapp/featured.png" class="img-fluid" alt="Ray doing an oral presentation"></p>
</div>
<p>I’m especially grateful to my advisors, Dr.&nbsp;Shavannor Smith and Dr.&nbsp;James Buck for their encouragement and for trusting me with this research to be able to share it, and to the UGA Department of Plant Pathology for fostering events like this where we can connect with our peers and share ideas.</p>
<p>And finally, to my colleagues and friends who have made the experience amazing! To have shared with them the beach sands of Cumberland and Jekyll Islands playing the Filipino game ‘patintero,’ drinking probably one too many Bahama Mama 🍹, and simply making the whole experience so unforgettable! 😍</p>
<p>Cheers to agriculture! 👨🏽‍🌾🌱</p>



 ]]></description>
  <category>Academic</category>
  <category>Talk</category>
  <category>Awards</category>
  <guid>https://rayparcon.com/blog/2026-05-13-gapp/</guid>
  <pubDate>Wed, 13 May 2026 00:00:00 GMT</pubDate>
  <media:content url="https://rayparcon.com/blog/2026-05-13-gapp/featured.png" medium="image" type="image/png" height="115" width="144"/>
</item>
<item>
  <title>Had a great time doing my first research oral presentation</title>
  <dc:creator>Ray Parcon</dc:creator>
  <link>https://rayparcon.com/blog/2026-03-11-aps-sd/</link>
  <description><![CDATA[ 




<div class="post-image">
<p><img src="https://rayparcon.com/blog/2026-03-11-aps-sd/featured.png" class="img-fluid" alt="Ray doing an oral presentation"></p>
</div>
<p>I’m grateful for the opportunity to share my research and the work I’m doing at the 2026 American Phytopathological Society Southern Division Meeting in Athens, Georgia.</p>
<p>Being surrounded by people who share the same passion for plant pathology makes the experience even more meaningful. It’s inspiring to know that the research we do has the potential to make a real impact, especially for the communities and the growers who rely on it the most. 👨🏽‍🌾🌱</p>
<p>I’m also deeply thankful for the support and mentorship of my advisors, who inspire me to keep growing and to take on new challenges. 💪🏽</p>



 ]]></description>
  <category>Academic</category>
  <category>Talk</category>
  <guid>https://rayparcon.com/blog/2026-03-11-aps-sd/</guid>
  <pubDate>Wed, 11 Mar 2026 00:00:00 GMT</pubDate>
  <media:content url="https://rayparcon.com/blog/2026-03-11-aps-sd/featured.png" medium="image" type="image/png" height="111" width="144"/>
</item>
<item>
  <title>From Science Fair to International Conferences</title>
  <dc:creator>Ray Parcon</dc:creator>
  <link>https://rayparcon.com/blog/2025-08-06-soy-aps/</link>
  <description><![CDATA[ 




<p>I vividly remember how I kept on wishing to win in our science high school fair, hoping for a chance to present our little science project at regional level. Having earned the opportunity twice, it was one of the few moments that gave me a sense of being good at something, in a time when all I carried was self-doubt.</p>
<p>That kid, proud and grateful for making into regionals, had no idea he would one day share his passion for research on an international stage, beside scientists he once thought only exist in textbooks.</p>
<div class="post-image">
<p><img src="https://rayparcon.com/blog/2025-08-06-soy-aps/featured.png" class="img-fluid" alt="Ray standing beside his poster"></p>
</div>
<p>I’m incredibly thankful for the opportunity to attend my first and second national scientific conferences to present my PhD research,</p>
<p>🧬 <strong>Soy 2025: 19th Biennial Conference on Molecular &amp; Cellular Biology of Soybean</strong> 📅 July 23–26, 2025 🏫 University of Wisconsin–Madison 📍 Madison, Wisconsin</p>
<p>🌱 <strong>Plant Health 2025: International Annual Meeting of the American Phytopathological Society</strong> 📅 August 2–5, 2025 🌺 Hawaii Convention Center 📍 Honolulu, Hawaii</p>
<p>I’m deeply grateful to my research mentors, Dr.&nbsp;Shavannor Smith and Dr.&nbsp;James Buck, for their encouragement and support, to UGA Plant Pathology Department for defraying Plant Health 2025 registration, and to the UGA Graduate School for awarding me an International Travel Grant. These moments only strengthen my drive to pursue meaningful, translatable research for the benefit of the growers and the agricultural community. 🌱🔬🧬</p>
<p>Cheers! 🍻</p>



 ]]></description>
  <category>Academic</category>
  <category>Poster</category>
  <guid>https://rayparcon.com/blog/2025-08-06-soy-aps/</guid>
  <pubDate>Wed, 06 Aug 2025 00:00:00 GMT</pubDate>
  <media:content url="https://rayparcon.com/blog/2025-08-06-soy-aps/featured.png" medium="image" type="image/png" height="121" width="144"/>
</item>
<item>
  <title>Stoked to be awarded with the Graduate School 2025 Summer Research Grant</title>
  <dc:creator>Ray Parcon</dc:creator>
  <link>https://rayparcon.com/blog/2025-04-11-summer-grant/</link>
  <description><![CDATA[ 




<div class="post-image">
<p><img src="https://rayparcon.com/blog/2025-04-11-summer-grant/featured.jpg" class="img-fluid" alt="Ray standing in a greenhouse with soybean plants"></p>
</div>
<p>I am grateful to receive funding support from the Graduate School for my research this summer! Definitely a motivation to believe in and continue the work. A timely, great news as my virulence phenotyping assays are underway!</p>



 ]]></description>
  <category>Grants</category>
  <category>Academic</category>
  <category>Awards</category>
  <guid>https://rayparcon.com/blog/2025-04-11-summer-grant/</guid>
  <pubDate>Fri, 11 Apr 2025 00:00:00 GMT</pubDate>
  <media:content url="https://rayparcon.com/blog/2025-04-11-summer-grant/featured.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>Excited to share my research with the public for the first time!</title>
  <dc:creator>Ray Parcon</dc:creator>
  <link>https://rayparcon.com/blog/2025-03-04-gapp/</link>
  <description><![CDATA[ 




<div class="post-image">
<p><img src="https://rayparcon.com/blog/2025-03-04-gapp/featured.jpg" class="img-fluid" alt="Ray standing beside his poster"></p>
</div>
<p>I had the opportunity to be one of the poster presenters at the recently concluded GAPP 2025. Listening to plenary speakers about their research was informative and inspiring, and talking to fellow plant pathologists about my research was exciting and fun!</p>



 ]]></description>
  <category>Academic</category>
  <category>Poster</category>
  <guid>https://rayparcon.com/blog/2025-03-04-gapp/</guid>
  <pubDate>Tue, 04 Mar 2025 00:00:00 GMT</pubDate>
  <media:content url="https://rayparcon.com/blog/2025-03-04-gapp/featured.jpg" medium="image" type="image/jpeg"/>
</item>
</channel>
</rss>
