<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Owner]]></title>
	<link>https://bioinformaticsonline.com/snippets/owner/lege?offset=0</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/owner/lege?offset=0" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/45197/onliner-to-convert-minimap2-to-paf</guid>
	<pubDate>Wed, 03 Jun 2026 07:03:26 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/45197/onliner-to-convert-minimap2-to-paf</link>
	<title><![CDATA[Onliner to convert minimap2 to PAF]]></title>
	<description><![CDATA[<code>awk -v OFS=&quot;\t&quot; -v ref_species=&quot;species1&quot; -v query_species=&quot;species2&quot; &#039;{ print $6, $8, $9, $1, $3, $4, $5, ref_species, query_species }&#039; mypaf.paf &gt; synPlotter.tsv</code>]]></description>
	<dc:creator>LEGE</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/44753/python-script-to-split-a-dna-sequence-into-words-of-varying-lengths</guid>
	<pubDate>Thu, 02 Jan 2025 11:31:22 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/44753/python-script-to-split-a-dna-sequence-into-words-of-varying-lengths</link>
	<title><![CDATA[Python script to split a DNA sequence into words of varying lengths]]></title>
	<description><![CDATA[<code># Script to split a DNA sequence into words of varying lengths
def split_dna_into_words(dna_sequence, min_length, max_length):
    &quot;&quot;&quot;
    Splits a DNA sequence into words of lengths ranging from min_length to max_length.

    Parameters:
        dna_sequence (str): The DNA sequence to split (e.g., &quot;ATGCGTAC&quot;).
        min_length (int): The minimum length of each word.
        max_length (int): The maximum length of each word.

    Returns:
        dict: A dictionary where keys are word lengths and values are lists of DNA words of that length.
    &quot;&quot;&quot;
    if not dna_sequence:
        raise ValueError(&quot;The DNA sequence cannot be empty.&quot;)

    if min_length &lt;= 0 or max_length &lt;= 0:
        raise ValueError(&quot;Word lengths must be positive integers.&quot;)

    if min_length &gt; max_length:
        raise ValueError(&quot;Minimum length cannot be greater than maximum length.&quot;)

    # Ensure the DNA sequence contains valid nucleotides
    for nucleotide in dna_sequence:
        if nucleotide.upper() not in &quot;ATCG&quot;:
            raise ValueError(f&quot;Invalid character &#039;{nucleotide}&#039; found in DNA sequence.&quot;)

    # Generate words of varying lengths
    words_by_length = {}
    for length in range(min_length, max_length + 1):
        words_by_length[length] = [dna_sequence[i:i+length] for i in range(0, len(dna_sequence) - length + 1)]

    return words_by_length

# Example usage
def main():
    dna_sequence = &quot;ATGCGTACGCTAATGCGTACGCTAATGCGTACGCTAATGCGTACGCTAATGCGTACGCTAATGCGTACGCTAATGCGTACGCTAATGCGTACGCTAATGCGTACGCTAATGCGTACGCTA&quot;
    min_length = 3
    max_length = 99

    try:
        words_by_length = split_dna_into_words(dna_sequence, min_length, max_length)
        for length, words in words_by_length.items():
            print(f&quot;Words of length {length}:&quot;, words)
    except ValueError as e:
        print(&quot;Error:&quot;, e)

if __name__ == &quot;__main__&quot;:
    main()</code>]]></description>
	<dc:creator>LEGE</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/44740/python-script-to-find-all-possible-repeats-in-a-dna-string</guid>
	<pubDate>Mon, 16 Dec 2024 07:54:38 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/44740/python-script-to-find-all-possible-repeats-in-a-dna-string</link>
	<title><![CDATA[Python script to find all possible repeats in a DNA string !]]></title>
	<description><![CDATA[<code>from collections import defaultdict

def find_repeats_in_genome(genome, min_length=2, max_length=None):
    &quot;&quot;&quot;
    Finds all repeating sequences in a genome within a specified length range.

    Parameters:
        genome (str): The genome sequence.
        min_length (int): Minimum length of repeats to scan for (default: 2).
        max_length (int): Maximum length of repeats to scan for (default: None, meaning entire genome).

    Returns:
        dict: A dictionary where keys are repeating sequences and values are lists of starting positions.
    &quot;&quot;&quot;
    if max_length is None:
        max_length = len(genome)

    repeats = defaultdict(list)

    # Iterate over all possible lengths of substrings
    for length in range(min_length, max_length + 1):
        seen = defaultdict(list)  # Tracks occurrences of substrings of the current length

        # Sliding window approach
        for i in range(len(genome) - length + 1):
            substring = genome[i:i + length]
            seen[substring].append(i)

        # Filter substrings that appear more than once
        for substring, positions in seen.items():
            if len(positions) &gt; 1:
                repeats[substring].extend(positions)

    return repeats

# Example usage
def main():
    genome = &quot;ATCGATCGAATTCGATCG&quot;  # Example genome sequence
    min_length = 2
    max_length = 5

    repeats = find_repeats_in_genome(genome, min_length, max_length)

    print(&quot;Repeating sequences:&quot;)
    for seq, positions in repeats.items():
        print(f&quot;Sequence: {seq}, Positions: {positions}&quot;)

if __name__ == &quot;__main__&quot;:
    main()</code>]]></description>
	<dc:creator>LEGE</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/44738/python-script-for-treemap-using-pythons-plotly-library</guid>
	<pubDate>Sat, 14 Dec 2024 12:45:15 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/44738/python-script-for-treemap-using-pythons-plotly-library</link>
	<title><![CDATA[Python script for treemap using Python's Plotly library]]></title>
	<description><![CDATA[<code>import plotly.express as px
import pandas as pd

# Sample dataset: Representing biological pathways and their associated counts
data = {
    &quot;Category&quot;: [&quot;Metabolism&quot;, &quot;Metabolism&quot;, &quot;Metabolism&quot;, 
                 &quot;Cellular Processes&quot;, &quot;Cellular Processes&quot;, &quot;Cellular Processes&quot;, 
                 &quot;Information Storage&quot;, &quot;Information Storage&quot;],
    &quot;Subcategory&quot;: [&quot;Carbohydrate metabolism&quot;, &quot;Lipid metabolism&quot;, &quot;Amino acid metabolism&quot;, 
                    &quot;Signal transduction&quot;, &quot;Cell cycle&quot;, &quot;Transport&quot;, 
                    &quot;DNA replication&quot;, &quot;RNA processing&quot;],
    &quot;Count&quot;: [150, 120, 90, 100, 85, 70, 110, 95]
}

# Convert data to a DataFrame
df = pd.DataFrame(data)

# Create the treemap
fig = px.treemap(
    df,
    path=[&quot;Category&quot;, &quot;Subcategory&quot;],  # Hierarchical levels
    values=&quot;Count&quot;,                   # Size of the treemap blocks
    color=&quot;Count&quot;,                    # Color based on the count values
    color_continuous_scale=&quot;Viridis&quot;  # Color scale
)

# Add a title
fig.update_layout(title=&quot;Treemap: Hierarchical Data Representation in Bioinformatics&quot;)

# Show the plot
fig.show()</code>]]></description>
	<dc:creator>LEGE</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/44733/bacterial-comparative-genomics-pipeline-bash-script</guid>
	<pubDate>Sat, 14 Dec 2024 12:34:57 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/44733/bacterial-comparative-genomics-pipeline-bash-script</link>
	<title><![CDATA[Bacterial Comparative Genomics Pipeline Bash Script]]></title>
	<description><![CDATA[<code>#!/bin/bash

# Bacterial Comparative Genomics Pipeline Script
# This script automates key steps in bacterial comparative genomics using popular bioinformatics tools.

# Ensure the script stops on error
set -e

# Define paths
WORKDIR=&quot;./bacterial_genomics_pipeline&quot;
INPUT_FASTA_DIR=&quot;./input_genomes&quot;
OUTPUT_DIR=&quot;./output&quot;
CORE_PAN_DIR=&quot;$OUTPUT_DIR/core_pan_analysis&quot;
PHYLOGENY_DIR=&quot;$OUTPUT_DIR/phylogeny&quot;
ALIGNMENT_DIR=&quot;$OUTPUT_DIR/genome_alignment&quot;
RESISTANCE_DIR=&quot;$OUTPUT_DIR/antibiotic_resistance&quot;
SYNTENY_DIR=&quot;$OUTPUT_DIR/synteny_analysis&quot;

# Create directories if they do not exist
mkdir -p $WORKDIR $OUTPUT_DIR $CORE_PAN_DIR $PHYLOGENY_DIR $ALIGNMENT_DIR $RESISTANCE_DIR $SYNTENY_DIR

# Tools required
PROKKA=&quot;prokka&quot;
ROARY=&quot;roary&quot;
MAUVE=&quot;progressiveMauve&quot;
IQTREE=&quot;iqtree&quot;
ABRICATE=&quot;abricate&quot;
MCSCANX=&quot;mcscanx&quot;

# Step 1: Genome Annotation using Prokka
annotate_genomes() {
  echo &quot;\n=== Annotating Genomes with Prokka ===&quot;
  for fasta in $INPUT_FASTA_DIR/*.fasta; do
    basename=$(basename $fasta .fasta)
    output_path=&quot;$OUTPUT_DIR/annotation_$basename&quot;
    echo &quot;Annotating $basename...&quot;
    $PROKKA --outdir $output_path --prefix $basename $fasta
  done
}

# Step 2: Core and Pan-genome Analysis using Roary
core_pan_analysis() {
  echo &quot;\n=== Performing Core and Pan-genome Analysis with Roary ===&quot;
  gff_files=$(find $OUTPUT_DIR -name &quot;*.gff&quot;)
  roary_output=&quot;$CORE_PAN_DIR/pan_genome_analysis&quot;
  mkdir -p $roary_output
  $ROARY -e -n -v -p 8 -o $roary_output $gff_files
}

# Step 3: Whole Genome Alignment using Mauve
align_genomes() {
  echo &quot;\n=== Aligning Genomes with Mauve ===&quot;
  alignment_output=&quot;$ALIGNMENT_DIR/aligned_genomes.xmfa&quot;
  echo &quot;Running Mauve on input genomes...&quot;
  $MAUVE --output=$alignment_output $(find $INPUT_FASTA_DIR -name &quot;*.fasta&quot;)
  echo &quot;Alignment saved to $alignment_output&quot;
}

# Step 4: Phylogenetic Tree Construction using IQ-TREE
construct_phylogeny() {
  echo &quot;\n=== Constructing Phylogenetic Tree with IQ-TREE ===&quot;
  alignment=&quot;$ALIGNMENT_DIR/aligned_genomes.xmfa&quot;
  phylo_output=&quot;$PHYLOGENY_DIR/phylogeny_tree&quot;
  iqtree_output=&quot;$phylo_output.treefile&quot;

  echo &quot;Running IQ-TREE on aligned genomes...&quot;
  $IQTREE -s $alignment -m GTR+G -nt AUTO -pre $phylo_output
  echo &quot;Phylogenetic tree saved to $iqtree_output&quot;
}

# Step 5: Antibiotic Resistance Gene Identification using ABRicate
identify_resistance_genes() {
  echo &quot;\n=== Identifying Antibiotic Resistance Genes with ABRicate ===&quot;
  for fasta in $INPUT_FASTA_DIR/*.fasta; do
    basename=$(basename $fasta .fasta)
    output_path=&quot;$RESISTANCE_DIR/${basename}_resistance.txt&quot;
    echo &quot;Analyzing $basename for resistance genes...&quot;
    abricate $fasta &gt; $output_path
  done
}

# Step 6: Synteny Analysis using MCScanX
synteny_analysis() {
  echo &quot;\n=== Performing Synteny Analysis with MCScanX ===&quot;
  synteny_output=&quot;$SYNTENY_DIR/synteny_results&quot;
  mkdir -p $synteny_output
  echo &quot;Running MCScanX on annotated genomes...&quot;
  MCScanX $OUTPUT_DIR &gt; &quot;$synteny_output/results.txt&quot;
  echo &quot;Synteny analysis results saved to $synteny_output&quot;
}

# Main workflow
annotate_genomes
core_pan_analysis
align_genomes
construct_phylogeny
identify_resistance_genes
synteny_analysis

echo &quot;\n=== Bacterial Comparative Genomics Pipeline Complete ===&quot;
echo &quot;Results saved in $OUTPUT_DIR&quot;</code>]]></description>
	<dc:creator>LEGE</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/44701/methods-to-upgrade-the-ubuntu</guid>
	<pubDate>Fri, 06 Dec 2024 23:36:11 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/44701/methods-to-upgrade-the-ubuntu</link>
	<title><![CDATA[Methods to upgrade the Ubuntu !]]></title>
	<description><![CDATA[<code>#Install ubuntu-release-upgrader-core if it is not already installed:

sudo apt-get install ubuntu-release-upgrader-core
#Edit /etc/update-manager/release-upgrades and set Prompt=normal

#Launch the upgrade tool:

do-release-upgrade
#Follow the on-screen instructions.</code>]]></description>
	<dc:creator>LEGE</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/44671/install-edirect</guid>
	<pubDate>Thu, 03 Oct 2024 01:52:15 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/44671/install-edirect</link>
	<title><![CDATA[Install Edirect !]]></title>
	<description><![CDATA[<code>sh -c &quot;$(curl -fsSL https://ftp.ncbi.nlm.nih.gov/entrez/entrezdirect/install-edirect.sh)&quot;</code>]]></description>
	<dc:creator>LEGE</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/44670/extract-the-fasta-sequence-using-ids</guid>
	<pubDate>Thu, 03 Oct 2024 01:27:32 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/44670/extract-the-fasta-sequence-using-ids</link>
	<title><![CDATA[Extract the fasta sequence using ids]]></title>
	<description><![CDATA[<code>#Extract sequences with names in file name.list, one sequence name per line:
seqtk subseq input.fasta name.list &gt; output.fasta</code>]]></description>
	<dc:creator>LEGE</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/44665/r-script-to-add-p-values-in-plots</guid>
	<pubDate>Tue, 17 Sep 2024 20:23:02 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/44665/r-script-to-add-p-values-in-plots</link>
	<title><![CDATA[R script to add P-Values in plots !]]></title>
	<description><![CDATA[<code>library(ggplot2)
library(tidyverse)
library(ggpubr)
my_comp &lt;- list( c(&quot;0.5&quot;, &quot;1&quot;), c(&quot;1&quot;, &quot;2&quot;), c(&quot;0.5&quot;, &quot;2&quot;) )
ggboxplot(ToothGrowth,
 x = &quot;dose&quot;, 
 y = &quot;len&quot;,
 fill = &quot;dose&quot;, 
 palette = &quot;Dark2&quot;)+
 stat_compare_means(label = &quot;p.format&quot;,
 comparisons = my_comp,
 method = &quot;t.test&quot;,
 symnum.args = list(cutpoints = c(0, 0.001, 1), 
 symbols = &quot;p &lt; 0.001&quot;))</code>]]></description>
	<dc:creator>LEGE</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/44532/commands-to-create-conda-env</guid>
	<pubDate>Mon, 13 May 2024 06:38:11 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/44532/commands-to-create-conda-env</link>
	<title><![CDATA[Commands to create conda env]]></title>
	<description><![CDATA[<code>(base) [lege@hn1 testVisanu]$ conda create -n pythonENV python=3.10 scipy=1.13.0 astroid babel
Channels:
 - conda-forge
 - bioconda
 - defaults
Platform: linux-64
Collecting package metadata (repodata.json): done
Solving environment: done


==&gt; WARNING: A newer version of conda exists. &lt;==
    current version: 24.3.0
    latest version: 24.4.0

Please update conda by running

    $ conda update -n base -c conda-forge conda



## Package Plan ##

  environment location: /home/lege/miniforge3/envs/pythonENV

  added / updated specs:
    - astroid
    - babel
    - python=3.10
    - scipy=1.13.0


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    astroid-3.2.0              |  py310hff52083_0         389 KB  conda-forge
    babel-2.14.0               |     pyhd8ed1ab_0         7.3 MB  conda-forge
    libblas-3.9.0              |22_linux64_openblas          14 KB  conda-forge
    libcblas-3.9.0             |22_linux64_openblas          14 KB  conda-forge
    libgfortran-ng-13.2.0      |       h69a702a_7          24 KB  conda-forge
    libgfortran5-13.2.0        |       hca663fb_7         1.4 MB  conda-forge
    liblapack-3.9.0            |22_linux64_openblas          14 KB  conda-forge
    libopenblas-0.3.27         |pthreads_h413a1c8_0         5.3 MB  conda-forge
    numpy-1.26.4               |  py310hb13e2d6_0         6.7 MB  conda-forge
    pytz-2024.1                |     pyhd8ed1ab_0         184 KB  conda-forge
    scipy-1.13.0               |  py310h93e2701_1        15.8 MB  conda-forge
    typing-extensions-4.11.0   |       hd8ed1ab_0          10 KB  conda-forge
    typing_extensions-4.11.0   |     pyha770c72_0          37 KB  conda-forge
    ------------------------------------------------------------
                                           Total:        37.1 MB

The following NEW packages will be INSTALLED:

  _libgcc_mutex      conda-forge/linux-64::_libgcc_mutex-0.1-conda_forge 
  _openmp_mutex      conda-forge/linux-64::_openmp_mutex-4.5-2_gnu 
  astroid            conda-forge/linux-64::astroid-3.2.0-py310hff52083_0 
  babel              conda-forge/noarch::babel-2.14.0-pyhd8ed1ab_0 
  bzip2              conda-forge/linux-64::bzip2-1.0.8-hd590300_5 
  ca-certificates    conda-forge/linux-64::ca-certificates-2024.2.2-hbcca054_0 
  ld_impl_linux-64   conda-forge/linux-64::ld_impl_linux-64-2.40-h55db66e_0 
  libblas            conda-forge/linux-64::libblas-3.9.0-22_linux64_openblas 
  libcblas           conda-forge/linux-64::libcblas-3.9.0-22_linux64_openblas 
  libffi             conda-forge/linux-64::libffi-3.4.2-h7f98852_5 
  libgcc-ng          conda-forge/linux-64::libgcc-ng-13.2.0-h77fa898_7 
  libgfortran-ng     conda-forge/linux-64::libgfortran-ng-13.2.0-h69a702a_7 
  libgfortran5       conda-forge/linux-64::libgfortran5-13.2.0-hca663fb_7 
  libgomp            conda-forge/linux-64::libgomp-13.2.0-h77fa898_7 
  liblapack          conda-forge/linux-64::liblapack-3.9.0-22_linux64_openblas 
  libnsl             conda-forge/linux-64::libnsl-2.0.1-hd590300_0 
  libopenblas        conda-forge/linux-64::libopenblas-0.3.27-pthreads_h413a1c8_0 
  libsqlite          conda-forge/linux-64::libsqlite-3.45.3-h2797004_0 
  libstdcxx-ng       conda-forge/linux-64::libstdcxx-ng-13.2.0-hc0a3c3a_7 
  libuuid            conda-forge/linux-64::libuuid-2.38.1-h0b41bf4_0 
  libxcrypt          conda-forge/linux-64::libxcrypt-4.4.36-hd590300_1 
  libzlib            conda-forge/linux-64::libzlib-1.2.13-hd590300_5 
  ncurses            conda-forge/linux-64::ncurses-6.5-h59595ed_0 
  numpy              conda-forge/linux-64::numpy-1.26.4-py310hb13e2d6_0 
  openssl            conda-forge/linux-64::openssl-3.3.0-hd590300_0 
  pip                conda-forge/noarch::pip-24.0-pyhd8ed1ab_0 
  python             conda-forge/linux-64::python-3.10.14-hd12c33a_0_cpython 
  python_abi         conda-forge/linux-64::python_abi-3.10-4_cp310 
  pytz               conda-forge/noarch::pytz-2024.1-pyhd8ed1ab_0 
  readline           conda-forge/linux-64::readline-8.2-h8228510_1 
  scipy              conda-forge/linux-64::scipy-1.13.0-py310h93e2701_1 
  setuptools         conda-forge/noarch::setuptools-69.5.1-pyhd8ed1ab_0 
  tk                 conda-forge/linux-64::tk-8.6.13-noxft_h4845f30_101 
  typing-extensions  conda-forge/noarch::typing-extensions-4.11.0-hd8ed1ab_0 
  typing_extensions  conda-forge/noarch::typing_extensions-4.11.0-pyha770c72_0 
  tzdata             conda-forge/noarch::tzdata-2024a-h0c530f3_0 
  wheel              conda-forge/noarch::wheel-0.43.0-pyhd8ed1ab_1 
  xz                 conda-forge/linux-64::xz-5.2.6-h166bdaf_0 


Proceed ([y]/n)? y


Downloading and Extracting Packages:
                                                                                                    
Preparing transaction: done                                                                         
Verifying transaction: done                                                                         
Executing transaction: done                                                                         
#                                                                                                   
# To activate this environment, use                                                                 
#                                                                                                   
#     $ conda activate pythonENV                                                                    
#                                                                                                   
# To deactivate an active environment, use                                                          
#                                                                                                   
#     $ conda deactivate</code>]]></description>
	<dc:creator>LEGE</dc:creator>
</item>

</channel>
</rss>