Category Archives: Articles

Enable SSL on WordPress Site on Linode (Using CPanel/Direct Transfer or Certbot)

We can enable SSL on your WordPress site hosted on a Linode server either by using Let’s Encrypt with Certbot or transferring an SSL certificate from another provider (e.g., Namecheap). This guide covers both methods.


1. Using Let’s Encrypt with Certbot

1.1 Install Certbot

SSH into your Linode server:

ssh root@your_linode_ip

Install Certbot for your web server:

# For Ubuntu with Apache
sudo apt update
sudo apt install certbot python3-certbot-apache

# For Ubuntu with Nginx
sudo apt update
sudo apt install certbot python3-certbot-nginx

Generate the SSL certificate:

sudo certbot --apache    # or --nginx

Follow prompts to select your domain and enable HTTPS.

1.2 Location of SSL Certificates and Keys

When you use Certbot, your certificates and keys are stored in /etc/letsencrypt/live/yourdomain.com/:

  • Certificates (fullchain.pem)

    /etc/letsencrypt/live/yourdomain.com/fullchain.pem

    Full certificate including domain and intermediate certificates.

  • Private Key (privkey.pem)

    /etc/letsencrypt/live/yourdomain.com/privkey.pem

    Private key associated with the certificate.

  • Chain of Trust (chain.pem)

    /etc/letsencrypt/live/yourdomain.com/chain.pem

    Intermediate certificates linking your domain certificate to the root certificate.

  • Symlink to domain certificate (cert.pem)

    /etc/letsencrypt/live/yourdomain.com/cert.pem

    Your domain certificate, symlinked to fullchain.pem.

The certificates and private keys should be owned by root and should be readable only by the server.

We need to adjust the permissions for any reason:

  sudo chmod 644 /etc/letsencrypt/live/yourdomain.com/*
  sudo chmod 600 /etc/letsencrypt/live/yourdomain.com/privkey.pem

1.3 Configure Web Server

  • For Apache, update your site’s .conf file (often located in /etc/apache2/sites-available/000-default-le-ssl.conf or a similar file) with the paths to the certificate files above.
    SSLEngine on
    SSLCertificateFile /etc/letsencrypt/live/yourdomain.com/cert.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/yourdomain.com/privkey.pem
    SSLCertificateChainFile /etc/letsencrypt/live/yourdomain.com/chain.pem
  • For Nginx, update the ssl_certificate and ssl_certificate_key directives (typically located in /etc/nginx/sites-available/yourdomain.com).

    server {
    listen 443 ssl;
    server_name yourdomain.com www.yourdomain.com;
    
    ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
    }

1.4 Test SSL Configuration

Reload or restart your web server and test your site with https://yourdomain.com.

1.5 Optional: Enable Auto-Renewal

Configure certbot to auto-renew your certificates using a cron job or system timer.

sudo systemctl list-timers
sudo certbot renew --dry-run
sudo certbot certificates

2. Configure WordPress for HTTPS

WordPress needs to be updated to use HTTPS for all URLs and assets.

2.1 Update Site URL

  • Log into your WordPress admin dashboard.
  • Go to Settings > General.
  • Change both the WordPress Address (URL) and Site Address (URL) to use https:// instead of http://.

2.2 Force HTTPS

You can force WordPress to always load over HTTPS by adding rules to your .htaccess file (for Apache) or nginx.conf (for Nginx).

For Apache:

Edit the .htaccess file in your WordPress root directory and add:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

For Nginx:

In your server block, add:

server {
    listen 80;
    server_name yourdomain.com www.yourdomain.com;
    return 301 https://$host$request_uri;
}

This ensures all HTTP traffic is redirected to HTTPS. We can also use a plugin like “WP Encryption” (chosen), “Really Simple SSL” to enforce HTTPS across your WordPress site. This plugin will automatically fix any mixed-content issues (insecure resources loaded over HTTP), ensuring that your entire site loads securely.


3. Transferring SSL from Another Provider

Follow similar steps to upload the certificate, private key, and CA bundle, then update your web server configuration as described above.

基于微管的MT1-MMP运输调控人巨噬细胞对耳念珠菌(Candida auris)的吞噬作用 和 微生物合成生物学

基于微管的MT1-MMP运输调控人巨噬细胞对耳念珠菌(Candida auris)的吞噬作用

  1. 背景:耳念珠菌是一种近年来备受关注的耐药真菌,能够引起严重感染。人体的先天免疫系统,尤其是巨噬细胞(macrophages),在抵御这种病原体时发挥着重要作用。巨噬细胞通过吞噬作用(phagocytosis)来清除入侵的病菌。

  2. MT1-MMP的作用:MT1-MMP(膜型基质金属蛋白酶1)是一种位于细胞膜上的酶,通常与细胞运动、吞噬以及细胞外基质降解相关。它需要被运输到合适的细胞膜位置才能发挥作用。

  3. 微管运输:MT1-MMP 的定位和功能依赖于细胞内部的“轨道系统”——微管(microtubules)。微管为囊泡和膜蛋白的运输提供通道。研究表明,MT1-MMP 通过微管的运输才能被有效送到巨噬细胞膜的正确位置。

  4. 与耳念珠菌吞噬的关系:当MT1-MMP能够被微管正确运输并定位在细胞膜上时,巨噬细胞的吞噬功能更高效,从而增强了对耳念珠菌的清除能力。如果微管运输受阻,MT1-MMP的定位受到影响,吞噬作用就会减弱。

  5. 结论:这项研究揭示了一个新的机制,即巨噬细胞通过微管介导的MT1-MMP运输来调控对耳念珠菌的吞噬。这为理解真菌感染的免疫防御机制提供了新的视角,也可能为开发新的治疗方法(如增强免疫清除能力)提供理论基础。


微生物合成生物学(Microbial Synthetic Biology) 是合成生物学的一个重要分支,主要利用微生物(如大肠杆菌、酵母菌、放线菌等)作为“底盘细胞”或“工程细胞”,通过基因编辑、代谢工程和合成回路设计,实现新的功能或改造其代谢路径。下面用中文详细解释:

  1. 核心概念:合成生物学的目标是像“设计机器”一样去设计和组装生物系统。微生物合成生物学就是将这一理念应用于微生物中,通过重编程它们的基因组,让它们执行我们希望的任务。

  2. 方法与工具

    • 基因组编辑:利用 CRISPR-Cas、重组技术等手段对微生物的基因进行修改或插入新基因。
    • 代谢途径改造:通过调整或导入代谢通路,使微生物能够合成新的化合物(如药物、燃料、材料)。
    • 合成生物元件:设计“人工开关”、“逻辑门”或调控回路,让微生物能对外部信号做出响应。
  3. 应用领域

    • 医药:工程化微生物用于生产抗生素、疫苗或蛋白药物。
    • 能源与材料:让微生物合成生物燃料(如生物乙醇、生物丁醇)或新型材料(如生物塑料)。
    • 环境:改造微生物去降解塑料、去除重金属或进行二氧化碳固定。
    • 农业:工程微生物可促进作物生长、合成生物肥料。
  4. 意义:微生物合成生物学结合了生物学、工程学、信息科学与化学,既帮助人类理解生命系统的运行规律,也为可持续发展和生物经济提供了强有力的工具。

换句话说,微生物合成生物学就是 “用工程思维改造微生物,让它们为人类生产所需物质或执行特定功能”

微生物与病毒生物信息学 vs. 细菌与病毒生物信息学

核心区别

  • Microbial & Viral Bioinformatics(微生物与病毒生物信息学)
    研究对象更广,涵盖所有类型的微生物(细菌、古菌、真菌、原生生物等)以及病毒。
  • Bacterial and Viral Bioinformatics(细菌与病毒生物信息学)
    研究对象较窄,专注于细菌和病毒,不包括其他非细菌类微生物。
Bacterial_and_Viral_Bioinformatics

对比表

维度 微生物与病毒生物信息学 细菌与病毒生物信息学
研究对象范围 微生物(细菌、古菌、真菌、原生生物等)+ 病毒 仅限细菌 + 病毒
广度 广,涵盖多类生物 窄,专注于细菌相关
典型研究方向 宏基因组学、群落生态学、宿主-微生物互作、病毒-微生物关系 细菌基因组学、耐药基因预测、病原体分析、噬菌体研究
应用场景 微生物群落研究、环境样本分析、人体微生物组研究 医学细菌学、传染病、抗生素耐药机制
学科定位 偏向综合性、生态学与系统层面 偏向临床、病原学与应用层面

应用实例对比

  • 微生物与病毒生物信息学

    • 实例:分析人类肠道微生物组(细菌、真菌、古菌等)与病毒群落的互作,探索其与肥胖、糖尿病或免疫系统疾病的关系。
    • 特点:关注整体微生物生态系统,强调多类生物之间的协同与平衡。
  • 细菌与病毒生物信息学

    • 实例:研究医院获得性耐药细菌(如耐甲氧西林金黄色葡萄球菌,MRSA)及其与噬菌体的互作,寻找新的治疗策略。
    • 特点:聚焦病原体与临床应用,强调对疾病防控和治疗的直接价值。

总结

  • Microbial & Viral Bioinformatics:范围大,适合研究多样微生物群落及其与病毒的关系。
  • Bacterial and Viral Bioinformatics:范围小,专注于细菌和病毒,更聚焦临床和病原学研究。

import matplotlib.pyplot as plt
from matplotlib_venn import venn2

# Create side-by-side comparison
fig, axes = plt.subplots(1, 2, figsize=(12,6))

# --- Left: Microbial & Viral ---
venn_left = venn2(
    subsets=(1, 1, 1),
    set_labels=("Microbes", "Viruses"),
    ax=axes[0],
    set_colors=("skyblue", "lightcoral"),  # 微生物用蓝色,病毒用红色
    alpha=0.6
)
venn_left.get_label_by_id('10').set_text('Bacteria, Archaea,\nFungi, Protists')
venn_left.get_label_by_id('01').set_text('Viruses')
venn_left.get_label_by_id('11').set_text('Microbe-Virus\ninteractions')
axes[0].set_title("Microbial & Viral Bioinformatics")

# --- Right: Bacterial & Viral ---
venn_right = venn2(
    subsets=(1, 1, 1),
    set_labels=("Bacteria", "Viruses"),
    ax=axes[1],
    set_colors=("lightgreen", "lightcoral"),  # 细菌用绿色,病毒用红色
    alpha=0.6
)
venn_right.get_label_by_id('10').set_text('Bacteria\n(pathogens, commensals)')
venn_right.get_label_by_id('01').set_text('Viruses\n(phages, human viruses)')
venn_right.get_label_by_id('11').set_text('Bacteria-Virus\ninteractions')
axes[1].set_title("Bacterial & Viral Bioinformatics")

# Add a caption below the plots
fig.text(
    0.5, -0.05,
    "Comparison: Microbial & Viral Bioinformatics covers all microbes (bacteria, archaea, fungi, protists) plus viruses,\n"
    "while Bacterial & Viral Bioinformatics is narrower, focusing only on bacteria and viruses.",
    ha='center', fontsize=10
)

plt.tight_layout()
plt.show()
import matplotlib.pyplot as plt

fig, ax = plt.subplots(figsize=(6,6))

# 大圆 - Microbial
microbe_circle = plt.Circle((0,0), 1.0, color="skyblue", alpha=0.4, label="Microbes")
ax.add_artist(microbe_circle)

# 小圆 - Bacteria (在Microbial里)
bacteria_circle = plt.Circle((0.3,0.3), 0.4, color="lightgreen", alpha=0.6, label="Bacteria")
ax.add_artist(bacteria_circle)

# 另一个圆 - Viruses
virus_circle = plt.Circle((-0.2,-0.2), 0.6, color="lightcoral", alpha=0.6, label="Viruses")
ax.add_artist(virus_circle)

# 设置比例 & 美化
ax.set_xlim(-1.5, 1.5)
ax.set_ylim(-1.5, 1.5)
ax.set_aspect("equal")
ax.axis("off")

# 添加标签
ax.text(-0.9, 1.0, "Microbes\n(bacteria, archaea, fungi, protists)", fontsize=10, color="blue")
ax.text(0.4, 0.6, "Bacteria", fontsize=10, color="green")
ax.text(-0.9, -0.8, "Viruses", fontsize=10, color="red")

plt.title("Nested Scope: Microbes vs Bacteria with Viruses", fontsize=12)
plt.show()

The top 10 genes

  • TP53: The TP53 gene, also known as p53, is a tumor suppressor gene that plays a critical role in preventing cancer. Mutations in TP53 are present in up to 50% of all cancers and are associated with a worse prognosis. TP53 acts as a transcription factor, regulating the expression of genes involved in cell cycle control, DNA repair, and apoptosis. When DNA is damaged, p53 is activated, leading to cell cycle arrest, DNA repair, or apoptosis if the damage is too severe.

  • TNF: Tumor necrosis factor (TNF) is a cytokine that plays a critical role in the immune response to cancer and infectious diseases. TNF is produced by immune cells, such as macrophages and T cells, and can induce apoptosis in cancer cells. In addition, TNF has been targeted by drugs to treat autoimmune diseases, such as rheumatoid arthritis and psoriasis.

  • EGFR: Epidermal growth factor receptor (EGFR) is a transmembrane receptor that binds to epidermal growth factor (EGF) and other ligands to activate downstream signaling pathways. EGFR is frequently mutated in cancers, particularly in lung cancer, and mutations in EGFR can lead to resistance to chemotherapy and targeted therapies. EGFR-targeting drugs, such as gefitinib and erlotinib, have been developed to treat lung cancer and other cancers that overexpress EGFR.

  • VEGFA: Vascular endothelial growth factor A (VEGFA) is a protein that promotes angiogenesis, the formation of new blood vessels. VEGFA is overexpressed in many cancers, including breast, lung, and colon cancer, and plays a critical role in tumor growth and metastasis. Drugs targeting VEGFA, such as bevacizumab and ranibizumab, have been developed to inhibit angiogenesis and treat cancer.

  • APOE: Apolipoprotein E (APOE) is a protein involved in lipid metabolism and is important for the transportation of cholesterol and other lipids in the bloodstream. APOE has also been implicated in Alzheimer’s disease, as individuals with a certain APOE allele have an increased risk of developing the disease.

  • IL6: Interleukin 6 (IL6) is a cytokine that plays a critical role in the immune response to infection and inflammation. IL6 is produced by immune cells, such as T cells and macrophages, and can activate downstream signaling pathways that lead to inflammation and fever. IL6 has also been implicated in cancer, as high levels of IL6 in the bloodstream have been associated with a worse prognosis.

  • TGFB1: Transforming growth factor beta 1 (TGFB1) is a cytokine that plays a critical role in cell proliferation, differentiation, and immune regulation. TGFB1 is produced by immune cells, such as T cells and macrophages, and can activate downstream signaling pathways that lead to cell cycle arrest and apoptosis. In addition, TGFB1 has been implicated in cancer, as it can promote tumor growth and metastasis.

  • MTHFR (Methylenetetrahydrofolate reductase) is an enzyme that plays a critical role in the metabolism of amino acids. Specifically, MTHFR is involved in the conversion of homocysteine to methionine, which is essential for the production of S-adenosylmethionine (SAMe). SAMe is a methyl donor that is important for the methylation of DNA, RNA, and proteins, and is involved in many cellular processes including gene expression, protein synthesis, and cell signaling. Mutations in the MTHFR gene can lead to reduced activity of the enzyme, which can result in elevated levels of homocysteine in the blood. Elevated homocysteine levels have been linked to a number of health problems, including cardiovascular disease, stroke, and neural tube defects in newborns. Some studies have also suggested that MTHFR mutations may be associated with an increased risk of certain types of cancer, although the evidence is not conclusive.

  • ESR1 (Oestrogen receptor 1) is a protein that plays a critical role in the response to estrogen in many tissues, including the breast, uterus, and bone. The ESR1 gene codes for the estrogen receptor alpha, which is a nuclear receptor that binds to estrogen and regulates the expression of many genes. In breast cancer, ESR1 is often overexpressed, and is a major driver of the disease. Targeting ESR1 with drugs like tamoxifen or aromatase inhibitors has been a key strategy in the treatment of estrogen receptor-positive breast cancer.

  • AKT1 (also known as protein kinase B) is a serine/threonine kinase that is involved in many cellular processes, including cell proliferation, apoptosis, and metabolism. AKT1 is activated by a variety of stimuli, including growth factors, cytokines, and extracellular matrix proteins. Once activated, AKT1 phosphorylates a number of downstream targets, including transcription factors, enzymes, and cytoskeletal proteins, leading to changes in gene expression, metabolism, and cell morphology. Mutations in AKT1 have been identified in a number of different cancers, including breast, colorectal, and ovarian cancer. In many cases, these mutations lead to increased AKT1 activity, which can promote cell survival and proliferation, and can also confer resistance to chemotherapy and other cancer treatments. As a result, AKT1 inhibitors are being developed as a potential therapeutic strategy for cancer treatment.

Creating a 3D scatterplot using ggplot2 in R

library(ggplot2)
library(plotly)

# Create some random data
set.seed(123)
x <- rnorm(100)
y <- rnorm(100)
z <- rnorm(100)

# Perform PCA
data <- data.frame(x, y, z)
pca <- prcomp(data, scale = TRUE)
scores <- as.data.frame(pca$x)

# Create 3D scatterplot using ggplot2 and plotly
ggplot(scores, aes(x = PC1, y = PC2, z = PC3)) +
  geom_point(size = 3, color = "blue") +
  labs(x = "PC1", y = "PC2", z = "PC3") +
  theme_bw() +
  theme(panel.grid.major = element_blank(),
        panel.grid.minor = element_blank(),
        axis.line = element_line(colour = "black", size = 0.5),
        panel.border = element_blank()) +
  scale_x_continuous(limits = c(-4, 4), expand = c(0, 0)) +
  scale_y_continuous(limits = c(-4, 4), expand = c(0, 0)) +
  scale_z_continuous(limits = c(-4, 4), expand = c(0, 0)) +
  coord_cartesian(xlim = c(-4, 4), ylim = c(-4, 4), zlim = c(-4, 4)) +
  ggtitle("3D Scatterplot using PCA") +
  theme(plot.title = element_text(size = 12, face = "bold"))

This code creates a 3D scatterplot using ggplot2 and the plotly package. It first generates some random data and performs principal component analysis (PCA) on it. The resulting PCA scores are then plotted in a 3D scatterplot. The labs() function is used to set the axis labels, and the ggtitle() function is used to set the plot title. The scale_x_continuous(), scale_y_continuous(), and scale_z_continuous() functions are used to set the axis limits, and the coord_cartesian() function is used to ensure that the plot is displayed with the specified limits. The theme() function is used to adjust the appearance of the plot.

draw 2D PCA from rld

library(ggplot2)
data <- plotPCA(rld, intgroup=c("condition", "donor"), returnData=TRUE)
ggplot(data, aes(x=PC1, y=PC2, color=condition, shape=donor)) +
      geom_point(size=8) + labs(x = "PC1", y = "PC2") +
      scale_color_manual(values = c("untreated" = "grey",
                                    "mCh d3"="#a6cee3",
                                    "mCh d8"="#1f78b4",
                                    "GFP+mCh d9/12"="cyan",
                                    "GFP d3"="#b2df8a",
                                    "GFP d8"="#33a02c",
                                    "sT d3"="#fb9a99",
                                    "sT d8"="#e31a1c",
                                    "LT d3"="#fdbf6f",
                                    "LT d8"="#ff7f00",
                                    "LTtr d3"="#cab2d6",
                                    "LTtr d8"="#6a3d9a",
                                    "sT+LT d3"="#ffff99",                        
                                    "sT+LTtr d9/12"="#a14a1a")) 
      xlab(paste0("PC1: ",percentVar[1],"% variance")) +
      ylab(paste0("PC2: ",percentVar[2],"% variance")) + theme(axis.text = element_text(face="bold",size = 21), axis.title = element_text(face="bold",size = 21)) + theme(legend.text = element_text(size = 20)) + theme(legend.title = element_text(size = 22)) + guides(color = guide_legend(override.aes = list(size = 10)), shape = guide_legend(override.aes = list(size = 10)), alpha = guide_legend(override.aes = list(size = 10)))

bubble plots in R using ggplot2

library(ggplot2)
png("bubble_plot.png", 3000, 2000)
ggplot(mydat, aes(y = Term, x = Comparison)) + geom_point(aes(color = Regulation, size = Count, alpha = abs(log10(FDR)))) + scale_color_manual(values = c("up" = "red", "down" = "blue")) + scale_size_continuous(range = c(1, 34)) + labs(x = "", y = "", color="Regulation", size="Count", alpha="-log10(FDR)") + theme(axis.text.y = element_text(face = bold.labels))+ theme(axis.text.x = element_text(angle = 30, vjust = 0.5)) + theme(axis.text = element_text(size = 40)) + theme(legend.text = element_text(size = 40)) + theme(legend.title = element_text(size = 40))+
  guides(color = guide_legend(override.aes = list(size = 20)), alpha = guide_legend(override.aes = list(size = 20)))
dev.off()

library(ggplot2)
library(dplyr)
library(magrittr)
library(tidyr)
library(forcats)

mydat <- read.csv2("GO_DAVID_Summary_R.csv", sep=",", header=TRUE)
#mydat$GeneRatio <- sapply(mydat$GeneRatio_frac, function(x) eval(parse(text=x)))
mydat$FoldEnrichment <- as.numeric(mydat$FoldEnrichment)
mydat$Comparison <- factor(mydat$Comparison, levels=c("sT 3 dpi","sT 8 dpi","LT 3 dpi","LT 8 dpi","LTtr 3 dpi","LTtr 8 dpi","sT+LT 3 dpi","sT+LTtr 9/12 dpi"))    # solution for point 2
mydat$Term <- factor(mydat$Term, levels=rev(c("Cell proliferation","Negative regulation of cell proliferation","Cell division","Mitotic nuclear division","G1/S transition of mitotic cell cycle","DNA replication initiation","DNA replication","Sister chromatid cohesion","DNA repair","Cellular response to DNA damage stimulus","Transcription, DNA-templated","Regulation of transcription, DNA-templated","Positive regulation of transcription, DNA-templated","Positive regulation of transcription from RNA polymerase II promoter","Positive regulation of gene expression","Negative regulation of transcription from RNA polymerase II promoter","rRNA processing","Protein folding","Inflammatory response","Immune response","Innate immune response","Positive regulation of ERK1 and ERK2 cascade","Chemokine-mediated signaling pathway","Chemotaxis","Cell chemotaxis","Neutrophil chemotaxis","Viral process","Response to virus","Defense response to virus","Cellular response to lipopolysaccharide","Type I interferon signaling pathway","Extracellular matrix organization","Cell adhesion","Nervous system development","Angiogenesis","Apoptotic process")))    # solution for point 2
mydat$Regulation <- factor(mydat$Regulation, levels=c("up","down"))
png("bubble.png", width=1166, height=1067)
ggplot(mydat, aes(y = Term, x = Comparison, size = FoldEnrichment)) + geom_point(aes(color = Regulation), alpha = 1.0) + labs(x = "", y = "") + theme(axis.text.x = element_text(angle = 30, vjust = 0.5)) + theme(axis.text = element_text(size = 20)) + theme(legend.text = element_text(size = 20)) + theme(legend.title = element_text(size = 20)) + scale_size(range = c(1, 20)) + guides(color = guide_legend(override.aes = list(size = 10)))    # solution for point 1
dev.off()

libraries with a syntax similar to ggplot2 for creating 3D plots in R

If you are looking for a library with a syntax similar to ggplot2 for creating 3D plots in R, you might want to check out the ggplot2 extension packages ggplot2_3d, ggplot2rayshader, or rayshader. Here is a brief description of each package:

ggplot2_3d: This package provides an extension to ggplot2 that allows you to create 3D plots using the same syntax as ggplot2. The package adds a geom_3d() function and several 3D coordinate systems that can be used to create different types of 3D plots.

ggplot2rayshader: This package extends ggplot2 with the rayshader package to create 3D plots with realistic shading and lighting effects. It provides functions for creating elevation maps, hillshades, and combining them with ggplot2 layers.

rayshader: This package allows you to create 2D and 3D maps and visualizations using a combination of ggplot2 and raytracing techniques. It provides functions for creating elevation maps, hillshades, and adding water features and labels to the plots.

Here is an example code snippet using the ggplot2_3d package to create a 3D scatter plot:

library(ggplot2)
library(ggplot2_3d)

# create a 3D scatter plot
ggplot(data = iris, aes(x = Sepal.Length, y = Sepal.Width, z = Petal.Length, color = Species)) +
      geom_3d(point_size = 3) +
      theme_3d()
library(ggplot2)
library(ggplot2_3d)

# create a 3D scatter plot
ggplot(data = iris, aes(x = Sepal.Length, y = Sepal.Width, z = Petal.Length, color = Species)) +
  geom_3d(point_size = 3) +
  theme_3d()

This will create a 3D scatter plot of the iris dataset with Sepal.Length, Sepal.Width, and Petal.Length as the x, y, and z coordinates, respectively, and Species as the color variable. The geom_3d() function is used to specify the type of plot, and the theme_3d() function is used to add a 3D theme to the plot.

How to use the TxDb.Hsapiens.UCSC.hg38.knownGene package in R?

To use the TxDb.Hsapiens.UCSC.hg38.knownGene package in R, you will need to follow these steps: :joy: https://www.markdownguide.org/basic-syntax/ https://www.markdownguide.org/extended-syntax/

Tux, Logo

Tux, yopK

  • Install the TxDb.Hsapiens.UCSC.hg38.knownGene package from Bioconductor using the following code:
if (!requireNamespace("BiocManager", quietly = TRUE))
  install.packages("BiocManager")
BiocManager::install("TxDb.Hsapiens.UCSC.hg38.knownGene")
if (!requireNamespace("BiocManager", quietly = TRUE))

  install.packages("BiocManager")

BiocManager::install("TxDb.Hsapiens.UCSC.hg38.knownGene")
  • Load the package using the library() function:
library(TxDb.Hsapiens.UCSC.hg38.knownGene)
  • Load the GenomicFeatures package, which is required by TxDb packages:
library(GenomicFeatures)
  • Use the TxDb.Hsapiens.UCSC.hg38.knownGene package to create a transcript database object using the TxDb() function:
txdb <- TxDb.Hsapiens.UCSC.hg38.knownGene
  • This will create a TxDb object that contains information about gene models and transcripts from the hg38 version of the human genome, based on the knownGene track in the UCSC Genome Browser.
  • You can then use the GenomicFeatures package to retrieve information about genes and transcripts from the TxDb object. For example, you can use the exonsBy() function to retrieve exon coordinates for a given gene:
    gene <- "ENSG00000139618"
    exons <- exonsBy(txdb, gene)

This will retrieve the exon coordinates for the gene with the Ensembl ID “ENSG00000139618”.

Note that the TxDb objects can be memory-intensive, especially for larger genomes or datasets, so you may need to be careful about the amount of data you load into memory at once. You can also use the saveDb() and loadDb() functions to save and load TxDb objects to/from disk, respectively.

update all packages in R

# Load the utils package
library(utils)

# Get information about all installed packages
pkg_info <- packageStatus()

# Filter the information to show only packages that need to be updated
outdated_packages <- pkg_info[,"needsUpdate"]

# Display the number of outdated packages
cat("Number of outdated packages:", length(outdated_packages))

pkg_info <- packageStatus()
pkg_info

Number of installed packages:

                            ok upgrade unavailable

/usr/local/lib/R/site-library 467 27 161 /usr/lib/R/site-library 0 0 0 /usr/lib/R/library 16 13 0

Number of available packages (each package counted only once):

                                           installed not installed

http://ftp.gwdg.de/pub/misc/cran/src/contrib 506 18771

/usr/local/lib/R/site-library /usr/lib/R/library/

sudo chown -R jhuang:jhuang /usr/lib/R/library/ 
sudo chown -R jhuang:jhuang /usr/share/R/doc/html
#update.packages(ask = FALSE)
update.packages(repos='http://cran.rstudio.com/', ask=FALSE, checkBuilt=TRUE)