<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Biomedical science and Mathematics</title>
    <description>The English blog of Lijia Yu.</description>
    <link>https://yulijia.net/en/</link>
    <atom:link href="https://yulijia.net/en/feed/index.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Mon, 04 May 2026 04:48:19 +0000</pubDate>
    <lastBuildDate>Mon, 04 May 2026 04:48:19 +0000</lastBuildDate>
    <generator>Jekyll v3.10.0</generator>
    
      <item>
        <title>Craig Venter</title>
        <description>&lt;p&gt;If I don’t write it down, I never seem to find time to do it.
Craig Venter passed away in April 29, it makes me feel my world become old and faraway with these excited people.&lt;/p&gt;

&lt;p&gt;For me, it marks the end of an era.&lt;/p&gt;

&lt;p&gt;Venter is someone I first learned about from textbooks when I studied genomics. My mentor in the US also worked at the J. Craig Venter Institute before, and he told me that he could focus on a project and not talk to anyone for a week (which I doubt), but that place seems amazing.&lt;/p&gt;
</description>
        <pubDate>Mon, 04 May 2026 00:00:00 +0000</pubDate>
        <link>https://yulijia.net/en/uncategorized/2026/05/04/Craig-Venter.html</link>
        <guid isPermaLink="true">https://yulijia.net/en/uncategorized/2026/05/04/Craig-Venter.html</guid>
        
        <category>Human Genome</category>
        
        
        <category>Uncategorized</category>
        
      </item>
    
      <item>
        <title>The most important thing I learned in last two years</title>
        <description>&lt;blockquote&gt;
  &lt;p&gt;What people say to you may not reveal their true character, watch how they treat others.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;I finished my PhD in the last two years, but I haven’t updated my blog since 2023. It is not just too busy with research, but also about seeing how people treat others, and for me,  how to manage up (apparently, I am not good at it).&lt;/p&gt;

&lt;p&gt;Academic life is all about how to manage your time, your thoughts, your health, and your emotions.
Thanks to the good environment, peers, and more experienced supervisors, I graduated.&lt;/p&gt;

&lt;p&gt;I will keep writing, my views are my own.&lt;/p&gt;
</description>
        <pubDate>Sun, 29 Mar 2026 00:00:00 +0000</pubDate>
        <link>https://yulijia.net/en/learning/2026/03/29/the-most-important-thing-i-learned-in-last-two-years.html</link>
        <guid isPermaLink="true">https://yulijia.net/en/learning/2026/03/29/the-most-important-thing-i-learned-in-last-two-years.html</guid>
        
        <category>Lifelong Learning</category>
        
        
        <category>Learning</category>
        
      </item>
    
      <item>
        <title>How to update all R packages after installing a new version of R?</title>
        <description>&lt;p&gt;Many R users are unfamiliar with the process of updating all their R packages after upgrading to a new version of R.&lt;/p&gt;

&lt;p&gt;Would you like to learn how to update all R pacakges in a safe and straightforward way?&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The method I described below should work for all platforms, however, I didn’t use R in Windows, so I don’t know the specific directory path, I will describe the steps using a Linux system.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;For example, I upgraded R from 4.2.1 to 4.3.1 recently.&lt;/p&gt;

&lt;p&gt;As we can see in the R library folder, there are two sub-folders, one is 4.2 (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/home/ylj/R/x86_64-pc-linux-gnu-library/4.2&lt;/code&gt;) and the other is 4.3 (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/home/ylj/R/x86_64-pc-linux-gnu-library/4.3&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;First, we need to copy all the packages from the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;4.2&lt;/code&gt; folder to the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;4.3&lt;/code&gt; folder. Alternatively, it is also possible to perform the reverse operation, but in that case, the folder needs to be renamed.&lt;/p&gt;

&lt;p&gt;Then, in R terminal/Rstudio run each line below.&lt;/p&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c1&quot;&gt;## load all installed packages&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pkglist&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data.frame&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;installed.packages&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lib.loc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/path/to/lib&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;# at here, lib.loc=&quot;/home/ylj/R/x86_64-pc-linux-gnu-library/4.3&quot;&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;## update all packages&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;BiocManager&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;install&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pkglist&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Package&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;update&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ask&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;FALSE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;checkBuilt&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;## reload new Rsession&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;c1&quot;&gt;## check if there are any packages that weren&apos;t updated&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pkgupdated&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;data.frame&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;installed.packages&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lib.loc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;/path/to/lib&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pkgfailed&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pkgupdated&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pkgupdated&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;$&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Built&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;4.3.1&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,]&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For all packages in the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;pkgfailed&lt;/code&gt;. we have to install them manually.&lt;/p&gt;

</description>
        <pubDate>Wed, 05 Jul 2023 00:00:00 +0000</pubDate>
        <link>https://yulijia.net/en/howto/2023/07/05/How-to-update-all-R-packages-after-installing-a-new-version-of-R.html</link>
        <guid isPermaLink="true">https://yulijia.net/en/howto/2023/07/05/How-to-update-all-R-packages-after-installing-a-new-version-of-R.html</guid>
        
        <category>update R packages</category>
        
        
        <category>HowTo</category>
        
      </item>
    
      <item>
        <title>Lifelong Learning</title>
        <description>&lt;p&gt;I have initiated a category dedicated to discussing the valuable insights gained from my supervisors, and peers, and sharing personal reflections/thoughts. This category aims to share thoughts during &lt;strong&gt;the ongoing, voluntary, and self-motivated pursuit of knowledge for either personal or professional reasons&lt;/strong&gt; (lifelong learning).&lt;/p&gt;

&lt;p&gt;In this initial post, I will continuously update and share insightful quotes from various individuals.&lt;/p&gt;

&lt;p&gt;J: You are using only two numbers to determine your life.
&lt;em&gt;confusion matrix isn’t enough, let’s use AUC.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;T: If this decision is hard to make, that means this decision does not matter.
If this decision does not matter, then you can decide by tossing a coin.&lt;/p&gt;

&lt;p&gt;T:&lt;/p&gt;
&lt;blockquote&gt;
  &lt;p&gt;“Must a name mean something?” Alice asks Humpty Dumpty, only to get this answer: “When I use a word… it means just what I choose it to mean – neither more nor less.”&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;This reminds me of a famous statement from the 1960s: &lt;a href=&quot;https://en.wikipedia.org/wiki/The_medium_is_the_message&quot;&gt;The medium is the message&lt;/a&gt;. Here you seem to be letting Google docs or Google form/spreadsheet determine how to organise your thoughts. That doesn’t seem to me to be the right way around.&lt;/p&gt;
</description>
        <pubDate>Sat, 01 Jul 2023 00:00:00 +0000</pubDate>
        <link>https://yulijia.net/en/learning/2023/07/01/Lifelong-Learning.html</link>
        <guid isPermaLink="true">https://yulijia.net/en/learning/2023/07/01/Lifelong-Learning.html</guid>
        
        <category>Lifelong Learning</category>
        
        
        <category>Learning</category>
        
      </item>
    
      <item>
        <title>Keep good dry lab habits</title>
        <description>&lt;p&gt;I have been worked in multiple dry labs during the last 10 years. Each laboratory has its own style, but few of them training students with good dry lab habits. I learned a lot of good habits from Dr. Malay Basu’s lab. Now, I would like to share these good habits and tips when doing bioinformatics study in a dry lab. All the suggestions based on the Linux environment.&lt;/p&gt;

&lt;h2 id=&quot;habtis&quot;&gt;Habtis&lt;/h2&gt;

&lt;h4 id=&quot;no1&quot;&gt;No.1&lt;/h4&gt;

&lt;p&gt;Maintain a good documentary for all analysis. I learned this since the first week at Malay’s lab. We recommand follow the style of Rmarkdown reprot from &lt;a href=&quot;https://bioinformatics.mdanderson.org/Supplements/ResidualDisease/Reports/&quot;&gt;MD Anderson Cancer Center&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The report should includes:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Executive Summary (*)
    &lt;ul&gt;
      &lt;li&gt;Introduction&lt;/li&gt;
      &lt;li&gt;Data and Methods&lt;/li&gt;
      &lt;li&gt;Results&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Data Mungling&lt;/li&gt;
  &lt;li&gt;Analysis
    &lt;ul&gt;
      &lt;li&gt;Step 1&lt;/li&gt;
      &lt;li&gt;Step 2&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Appendix (*)
    &lt;ul&gt;
      &lt;li&gt;Working dir&lt;/li&gt;
      &lt;li&gt;Script descriptions&lt;/li&gt;
      &lt;li&gt;List of Figures&lt;/li&gt;
      &lt;li&gt;List of Tables&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If you want to share the report with others, it is better to generate a HTML report, if you want to see the report as a MD file on Github, you need to generate a Github MD report.&lt;/p&gt;

&lt;p&gt;Always use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sessionInfo()&lt;/code&gt; to print the collect information about the current R session in the bottom of the report.&lt;/p&gt;

&lt;h4 id=&quot;no2&quot;&gt;No.2&lt;/h4&gt;

&lt;p&gt;Each research project should also follow a clean structure:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;bin&lt;/li&gt;
  &lt;li&gt;original_data
    &lt;ul&gt;
      &lt;li&gt;README - containing where the data is from&lt;/li&gt;
      &lt;li&gt;Data in compressed form.
        &lt;ol&gt;
          &lt;li&gt;If the raw data is huge. Then only the process data. The the processed step should be captured in the “exp” directory.&lt;/li&gt;
        &lt;/ol&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;“exp” - Actual experiments. Each directory must be named as
    &lt;ol&gt;
      &lt;li&gt;YYYYMMDD-some_identifiable_info-#githubissue-INITIALS&lt;/li&gt;
      &lt;li&gt;each directory should link input files in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;in&lt;/code&gt; folder and generate outputfiles in &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;out&lt;/code&gt; folder. The outfiles should have the name date and time appended to it.&lt;/li&gt;
      &lt;li&gt;The entire experiments should be done through and RMD file or single “run.sh” or a “Makefile”. There must be the RMD/MD file in each directory. You must write the executable summary and the list of figures and tables and their descriptions in the report.&lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
  &lt;li&gt;“design” (?)
    &lt;ul&gt;
      &lt;li&gt;Reserved for PI.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;docs
    &lt;ul&gt;
      &lt;li&gt;Reserved for PI.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;reports
    &lt;ol&gt;
      &lt;li&gt;“index.htm”: A top level index files listing every file and few lines description of the files in the directory.&lt;/li&gt;
      &lt;li&gt;A list of files names matching with the each directory names of “exp”, preferebly in html format generated from RMDs&lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can upload the project structure and code to any cloud storage, make a backup every day/week.&lt;/p&gt;

&lt;h4 id=&quot;no3&quot;&gt;No.3&lt;/h4&gt;

&lt;p&gt;Whatever, back up the server data every week, lost data is a huge pain for every researcher.&lt;/p&gt;

&lt;h4 id=&quot;no4&quot;&gt;No.4&lt;/h4&gt;

&lt;p&gt;After a project is finished. You need to review the whole project’s data and make sure every folder in the project has a document to record what you had done before, every script should also have a note to record the meaning of it.&lt;/p&gt;

&lt;h4 id=&quot;no5&quot;&gt;No.5&lt;/h4&gt;

&lt;p&gt;when link a data from one sub-folder to another sub-folder in one project folder, you should use relative symbolic link &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ln -rs&lt;/code&gt;. When you need to move a project folder to other place, the data structure will not be broken.&lt;/p&gt;

&lt;h2 id=&quot;tips&quot;&gt;Tips&lt;/h2&gt;

&lt;h4 id=&quot;no1-1&quot;&gt;No.1&lt;/h4&gt;

&lt;p&gt;Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tmux&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;screen&lt;/code&gt; when you want to run some program after exit the terminal session, they are usable with interactive commands. I perfer using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tmux&lt;/code&gt; , because it has more function compare with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;screen&lt;/code&gt;. Please try to avoid to use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nohup&lt;/code&gt; which you couldn’t control the program later.&lt;/p&gt;

&lt;p&gt;When you have a Rstudio-server, sometime you may wish to run program via Rstudio termianl after you close the Rstudio interface, but I still suggest you run the program using &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;tmux&lt;/code&gt; inside the Rstudio terminal.&lt;/p&gt;

&lt;p&gt;The main reason for this is when the Rstudio terminal session is not reponse, you still can do interactive in tmux from other ssh session.&lt;/p&gt;

&lt;h4 id=&quot;no2-1&quot;&gt;No.2&lt;/h4&gt;

&lt;p&gt;Always monitor the memory usage via &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ps aux --sort -rss | head&lt;/code&gt;, some parallel program may cause momory leak, you maynot know about memory leak even the program is running sucessfully.&lt;/p&gt;

&lt;h4 id=&quot;no3-1&quot;&gt;No.3&lt;/h4&gt;

&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Control+C&lt;/code&gt; aborts the application almost immediately while &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Control+Z&lt;/code&gt; shunts it into the background, suspended. If you shunt any application into the background, &lt;strong&gt;please keep in mind that the program is still waiting for your command&lt;/strong&gt;.&lt;/p&gt;

&lt;h4 id=&quot;no4-1&quot;&gt;No.4&lt;/h4&gt;

&lt;p&gt;Do not save the large files to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/home&lt;/code&gt; directory if your server has limited storage for &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/home&lt;/code&gt;. Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;df -h&lt;/code&gt; to check the size of each system disk.&lt;/p&gt;

&lt;p&gt;Use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;du -sh * | sort -rh&lt;/code&gt; to check the size of each folder.&lt;/p&gt;

&lt;h4 id=&quot;no5-1&quot;&gt;No.5&lt;/h4&gt;

&lt;p&gt;Better to learn one of &lt;a href=&quot;https://www.biostars.org/p/91301/&quot;&gt;Pipeline Building Framework&lt;/a&gt; and Docker, it makes everything reproducible more easily.&lt;/p&gt;

&lt;h4 id=&quot;no6&quot;&gt;No.6&lt;/h4&gt;

&lt;p&gt;You need have &lt;a href=&quot;https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf&quot;&gt;basic knowledge&lt;/a&gt; of conda, and use it when run python code.&lt;/p&gt;

&lt;p&gt;Also makesure you know where is the installed version of it. I found someone who is a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;su&lt;/code&gt; user installs miniconda on the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/home&lt;/code&gt; directory but the all user’s environment of the conda has changed to this person’s &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/home&lt;/code&gt; version. That’s ridiculous.&lt;/p&gt;

&lt;h4 id=&quot;no7&quot;&gt;No.7&lt;/h4&gt;

&lt;p&gt;Always compress dataset in to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.xz&lt;/code&gt; or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.gz&lt;/code&gt; format. R and Python (or other programming language) has function to read compressed datasets, you don’t need to uncompress any dataset for analysis. That’s may save a lot of space.&lt;/p&gt;

&lt;h4 id=&quot;no8&quot;&gt;No.8&lt;/h4&gt;

&lt;p&gt;When generate a modified file, never cover the orginal files.&lt;/p&gt;

&lt;h4 id=&quot;no9&quot;&gt;No.9&lt;/h4&gt;

&lt;p&gt;Bioinformatics is a field that has rapid changes. Stay hungry, keep learning.&lt;/p&gt;
</description>
        <pubDate>Wed, 28 Apr 2021 00:00:00 +0000</pubDate>
        <link>https://yulijia.net/en/bioinfo/2021/04/28/keep-good-dry-lab-habits.html</link>
        <guid isPermaLink="true">https://yulijia.net/en/bioinfo/2021/04/28/keep-good-dry-lab-habits.html</guid>
        
        <category>Rstudio</category>
        
        <category>tmux</category>
        
        <category>Ctrl-z</category>
        
        
        <category>bioinfo</category>
        
      </item>
    
      <item>
        <title>Some useful R codes</title>
        <description>&lt;p&gt;This is an Attic to store some useful R codes, I don’t want to search them every time, so I put these codes at here.&lt;/p&gt;

&lt;h3 id=&quot;check-packages-if-they-are-installed&quot;&gt;Check packages if they are installed&lt;/h3&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;check.package&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pkg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new.pkg&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pkg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;!&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pkg&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;%in%&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;installed.packages&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()[,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;Package&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;])]&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;length&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new.pkg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; 
    &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;install.packages&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;new.pkg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;dependencies&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sapply&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;pkg&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;character.only&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kc&quot;&gt;TRUE&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;


&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;packages.name&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;-&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;reshape&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;ggplot2&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;gridExtra&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;check.package&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;packages.name&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;

&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;draw-beautiful-arrowhead&quot;&gt;Draw beautiful arrowhead&lt;/h3&gt;

&lt;div class=&quot;language-r highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;n&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ggplot2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;require&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;grid&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;seals&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sample&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;nrow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;seals&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),]&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ggplot&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;d&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;x&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;y&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lat&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;geom_segment&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;aes&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;xend&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;long&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;delta_long&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; 
                 &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;yend&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;lat&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;delta_lat&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;100&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
             &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;arrow&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;arrow&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;angle&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; &lt;/span&gt;&lt;span class=&quot;m&quot;&gt;10&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;closed&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
             &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;colour&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;black&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
             &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;arrow.fill&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;nf&quot;&gt;c&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;red&quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;),&lt;/span&gt;&lt;span class=&quot;w&quot;&gt;
             &lt;/span&gt;&lt;span class=&quot;n&quot;&gt;size&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;m&quot;&gt;0.5&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;w&quot;&gt; 
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;TBC&lt;/p&gt;
</description>
        <pubDate>Mon, 04 May 2020 00:00:00 +0000</pubDate>
        <link>https://yulijia.net/en/r-language/2020/05/04/Some-useful-R-codes.html</link>
        <guid isPermaLink="true">https://yulijia.net/en/r-language/2020/05/04/Some-useful-R-codes.html</guid>
        
        <category>R</category>
        
        
        <category>R-Language</category>
        
      </item>
    
      <item>
        <title>How to convert webm to gif on Linux</title>
        <description>&lt;p&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;webm&lt;/code&gt; is an audiovisual media file format. It is primarily intended to offer a royalty-free alternative to use in the HTML5 video and the HTML5 audio elements. It has a sister project WebP for images. On Fedora system, you could use the &lt;a href=&quot;https://fedoraproject.org/wiki/ScreenCasting&quot;&gt;Gnome’s embedded screencast tool&lt;/a&gt; to create a 30 seconds video of your screen by default. What I want is a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gif&lt;/code&gt; animation that would be easier to be transferred and shown online.&lt;/p&gt;

&lt;p&gt;So how to convert &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;webm&lt;/code&gt; file to &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;gif&lt;/code&gt; file on Linux?&lt;/p&gt;

&lt;p&gt;The best way is using ffmpeg &lt;sup id=&quot;fnref:1&quot; role=&quot;doc-noteref&quot;&gt;&lt;a href=&quot;#fn:1&quot; class=&quot;footnote&quot; rel=&quot;footnote&quot;&gt;1&lt;/a&gt;&lt;/sup&gt;.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ffmpeg &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; input.webm &lt;span class=&quot;nt&quot;&gt;-vf&lt;/span&gt; palettegen palette.png
ffmpeg &lt;span class=&quot;nt&quot;&gt;-y&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; input.webm &lt;span class=&quot;nt&quot;&gt;-i&lt;/span&gt; palette.png &lt;span class=&quot;nt&quot;&gt;-filter_complex&lt;/span&gt; paletteuse &lt;span class=&quot;nt&quot;&gt;-r&lt;/span&gt; 10 output.gif
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;After that I also recommend using GNU Image Manipulation Program (GIMP) to crop off the unwanted part in the animation, it is also a way to reduce the animation size.&lt;/p&gt;

&lt;div class=&quot;footnotes&quot; role=&quot;doc-endnotes&quot;&gt;
  &lt;ol&gt;
    &lt;li id=&quot;fn:1&quot; role=&quot;doc-endnote&quot;&gt;
      &lt;p&gt;&lt;a href=&quot;https://askubuntu.com/questions/506670/how-to-do-i-convert-an-webm-video-to-a-animated-gif-on-the-command-line&quot;&gt;How to do I convert an webm (video) to a (animated) gif on the command line?&lt;/a&gt; &lt;a href=&quot;#fnref:1&quot; class=&quot;reversefootnote&quot; role=&quot;doc-backlink&quot;&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
    &lt;/li&gt;
  &lt;/ol&gt;
&lt;/div&gt;
</description>
        <pubDate>Mon, 04 May 2020 00:00:00 +0000</pubDate>
        <link>https://yulijia.net/en/howto/2020/05/04/How-to-convert-webm-to-gif-on-Linux.html</link>
        <guid isPermaLink="true">https://yulijia.net/en/howto/2020/05/04/How-to-convert-webm-to-gif-on-Linux.html</guid>
        
        <category>webm</category>
        
        <category>gif</category>
        
        <category>GIMP</category>
        
        
        <category>HowTo</category>
        
      </item>
    
      <item>
        <title>working with VCF files</title>
        <description>&lt;ul id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;#1sort-vcf-files&quot; id=&quot;markdown-toc-1sort-vcf-files&quot;&gt;1.sort VCF files&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#2index-vcf-files&quot; id=&quot;markdown-toc-2index-vcf-files&quot;&gt;2.index VCF files&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#3extract-vcf-from-a-bed-region&quot; id=&quot;markdown-toc-3extract-vcf-from-a-bed-region&quot;&gt;3.extract vcf from a bed region&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#4intersect-vcf-files&quot; id=&quot;markdown-toc-4intersect-vcf-files&quot;&gt;4.intersect VCF files&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#5merge-vcf-files&quot; id=&quot;markdown-toc-5merge-vcf-files&quot;&gt;5.merge VCF files&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#6concatenate-or-combine-or-append-vcf-files&quot; id=&quot;markdown-toc-6concatenate-or-combine-or-append-vcf-files&quot;&gt;6.Concatenate or combine or append VCF files&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;#7change-chromosome-notation&quot; id=&quot;markdown-toc-7change-chromosome-notation&quot;&gt;7.Change Chromosome Notation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This is a note of working with VCF files. Try to avoid use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;awk/sed&lt;/code&gt; and other linux default command. Use the professional tools!&lt;/p&gt;

&lt;h3 id=&quot;1sort-vcf-files&quot;&gt;1.sort VCF files&lt;/h3&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;java &lt;span class=&quot;nt&quot;&gt;-jar&lt;/span&gt; picard.jar SortVcf &lt;span class=&quot;nv&quot;&gt;INPUT&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;in&lt;/span&gt;.vcf &lt;span class=&quot;nv&quot;&gt;OUTPUT&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;out.vcf
java &lt;span class=&quot;nt&quot;&gt;-jar&lt;/span&gt; picard.jar SortVcf &lt;span class=&quot;nv&quot;&gt;INPUT&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;in&lt;/span&gt;.vcf.gz &lt;span class=&quot;nv&quot;&gt;OUTPUT&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;out.vcf.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;It will provide index file if you set the output as gz file.&lt;/p&gt;

&lt;h3 id=&quot;2index-vcf-files&quot;&gt;2.index VCF files&lt;/h3&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;bgzip genotypes.vcf &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; tabix &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; vcf genotypes.vcf.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Ref:&lt;a href=&quot;https://www.biostars.org/p/59492/&quot;&gt;Question: Generate vcf.gz file and its index file vcf.gz.tbi&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;3extract-vcf-from-a-bed-region&quot;&gt;3.extract vcf from a bed region&lt;/h3&gt;

&lt;p&gt;Need have a vcf index file before extract from the vcf file.
Print header line with &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-h&lt;/code&gt;.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;tabix &lt;span class=&quot;nt&quot;&gt;-R&lt;/span&gt; region.bed myvcf.gz &lt;span class=&quot;nt&quot;&gt;-h&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; extract.vcf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Ref:&lt;a href=&quot;https://www.biostars.org/p/46331/&quot;&gt;Question: Extract Sub-Set Of Regions From Vcf File&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;4intersect-vcf-files&quot;&gt;4.intersect VCF files&lt;/h3&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;bcftools isec  &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; output_dir  A.vcf.gz B.vcf.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;output_dir/0000.vcf.gz&lt;/code&gt; would be variants unique to A.vcf.gz&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;output_dir/0001.vcf.gz&lt;/code&gt; would be variants unique to B.vcf.gz&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;output_dir/0002.vcf.gz&lt;/code&gt; would be variants shared by A.vcf.gz and B.vcf.gz as represented in A.vcf.gz&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;output_dir/0002.vcf.gz&lt;/code&gt; would be variants shared by A.vcf.gz and B.vcf.gz as represented in B.vcf.gz&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Ref: &lt;a href=&quot;https://www.biostars.org/p/178146/&quot;&gt;Question: intersect VCF files&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;5merge-vcf-files&quot;&gt;5.merge VCF files&lt;/h3&gt;

&lt;p&gt;When we say &lt;strong&gt;merge&lt;/strong&gt; VCF files, it means that all genotype of one snv/indel will be merged in single line.&lt;/p&gt;

&lt;p&gt;A.vcf&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; ##fileformat=VCFv4.1 
 ##FILTER=&amp;lt;ID=PASS,Description=&quot;Passed all filters&quot;&amp;gt;
 ##INFO=&amp;lt;ID=DP,Number=1,Type=Integer,Description=&quot;Total Read Depth&quot;&amp;gt;
 ##FORMAT=&amp;lt;ID=GT,Number=1,Type=String,Description=&quot;Genotype&quot;&amp;gt;
 #CHROM POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  S1  S2  S3
 10  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/1 0/0 0/1
 11  .   C   A   .   .   DP=3;CALLER=Samtools    GT  .   .   1/1
 12  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/0 0/0 0/0
 13  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/1 1/1 1/1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;B.vcf&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; ##fileformat=VCFv4.1 
 ##FILTER=&amp;lt;ID=PASS,Description=&quot;Passed all filters&quot;&amp;gt;
 ##INFO=&amp;lt;ID=DP,Number=1,Type=Integer,Description=&quot;Total Read Depth&quot;&amp;gt;
 ##FORMAT=&amp;lt;ID=GT,Number=1,Type=String,Description=&quot;Genotype&quot;&amp;gt;
 #CHROM POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  S4  S5  S6
 10  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/1 0/0 0/1
 11  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/1  .  1/1
 12  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/0 0/0 1/1 
 13  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/0 0/0 0/0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;merged.vcf&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; ##fileformat=VCFv4.1 
 ##FILTER=&amp;lt;ID=PASS,Description=&quot;Passed all filters&quot;&amp;gt;
 ##INFO=&amp;lt;ID=DP,Number=1,Type=Integer,Description=&quot;Total Read Depth&quot;&amp;gt;
 ##FORMAT=&amp;lt;ID=GT,Number=1,Type=String,Description=&quot;Genotype&quot;&amp;gt;
 #CHROM POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  S1  S2  S3 S4  S5  S6
 10  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/1 0/0 0/1 0/1 0/0 0/1
 11  .   C   A   .   .   DP=3;CALLER=Samtools    GT  .   .   1/1 0/1  .  1/1
 12  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/0 0/0 0/0 0/0 0/0 1/1 
 13  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/1 1/1 1/1 0/0 0/0 0/0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;bcftools only accept zipped vcf files. &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-Oz&lt;/code&gt; is the output format of &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;.gz&lt;/code&gt;&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;bcftools merge &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;vcf.gz &lt;span class=&quot;nt&quot;&gt;-Oz&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; Merged.vcf.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Ref:&lt;a href=&quot;https://www.biostars.org/p/311621/&quot;&gt;Question: Best way to merge multiple VCF files&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;6concatenate-or-combine-or-append-vcf-files&quot;&gt;6.Concatenate or combine or append VCF files&lt;/h3&gt;

&lt;p&gt;All source files must have the same sample columns appearing in the same order. The program can be used, for example, to concatenate chromosome VCFs into one VCF, or combine a SNP VCF and an indel VCF into one. The input files must be sorted by chr and position.&lt;/p&gt;

&lt;p&gt;A.vcf&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; ##fileformat=VCFv4.1 
 ##FILTER=&amp;lt;ID=PASS,Description=&quot;Passed all filters&quot;&amp;gt;
 ##INFO=&amp;lt;ID=DP,Number=1,Type=Integer,Description=&quot;Total Read Depth&quot;&amp;gt;
 ##FORMAT=&amp;lt;ID=GT,Number=1,Type=String,Description=&quot;Genotype&quot;&amp;gt;
 #CHROM POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  S1  S2  S3
 10  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/1 0/0 0/1
 11  .   C   A   .   .   DP=3;CALLER=Samtools    GT  .   .   1/1
 12  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/0 0/0 0/0
 13  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/1 1/1 1/1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;B.vcf&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; ##fileformat=VCFv4.1
 ##FILTER=&amp;lt;ID=PASS,Description=&quot;Passed all filters&quot;&amp;gt;  
 ##INFO=&amp;lt;ID=DP,Number=1,Type=Integer,Description=&quot;Total Read Depth&quot;&amp;gt;
 ##FORMAT=&amp;lt;ID=GT,Number=1,Type=String,Description=&quot;Genotype&quot;&amp;gt;
 #CHROM POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  S1  S2  S3
 14  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/1 0/0 0/1
 15  .   C   A   .   .   DP=3;CALLER=Samtools    GT  .   .   1/1
 16  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/0 0/0 0/0
 17  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/1 1/1 1/1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;concat.vcf&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; ##fileformat=VCFv4.1
 ##FILTER=&amp;lt;ID=PASS,Description=&quot;Passed all filters&quot;&amp;gt;
 ##INFO=&amp;lt;ID=DP,Number=1,Type=Integer,Description=&quot;Total Read Depth&quot;&amp;gt;
 ##FORMAT=&amp;lt;ID=GT,Number=1,Type=String,Description=&quot;Genotype&quot;&amp;gt;
 #CHROM POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  S1  S2  S3
 10  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/1 0/0 0/1
 11  .   C   A   .   .   DP=3;CALLER=Samtools    GT  .   .   1/1
 12  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/0 0/0 0/0
 13  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/1 1/1 1/1
 14  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/1 0/0 0/1
 15  .   C   A   .   .   DP=3;CALLER=Samtools    GT  .   .   1/1
 16  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/0 0/0 0/0
 17  .   C   A   .   .   DP=3;CALLER=Samtools    GT  0/1 1/1 1/1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;bcftools concat A.vcf.gz B.vcf.gz &lt;span class=&quot;nt&quot;&gt;-Oz&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; output.vcf.gz 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Ref:&lt;a href=&quot;https://www.biostars.org/p/312024/&quot;&gt;Question: How to merge vcf files with different variants but same samples?&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;7change-chromosome-notation&quot;&gt;7.Change Chromosome Notation&lt;/h3&gt;

&lt;p&gt;Please remember that in the VCF header line there also have chromosome notaion, if you use &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;awk/sed&lt;/code&gt; to change the notaion, you should also change it on the VCF header line.&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;1 chr1&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; chr_name_conv.txt
&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;2 chr2&quot;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt; chr_name_conv.txt
bcftools annotate &lt;span class=&quot;nt&quot;&gt;--rename-chrs&lt;/span&gt; chr_name_conv.txt original.vcf.gz | bgzip &lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; rename.vcf.gz
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Ref:&lt;a href=&quot;https://www.biostars.org/p/98582/&quot;&gt;Question: VCF files: Change Chromosome Notation&lt;/a&gt;&lt;/p&gt;

</description>
        <pubDate>Thu, 09 Apr 2020 00:00:00 +0000</pubDate>
        <link>https://yulijia.net/en/howto/bioinformatics/2020/04/09/working-with-VCF-files.html</link>
        <guid isPermaLink="true">https://yulijia.net/en/howto/bioinformatics/2020/04/09/working-with-VCF-files.html</guid>
        
        <category>VCF</category>
        
        <category>sort</category>
        
        <category>index</category>
        
        <category>intersect</category>
        
        <category>extract</category>
        
        <category>merge</category>
        
        <category>concatenate</category>
        
        <category>combine</category>
        
        
        <category>HowTo</category>
        
        <category>Bioinformatics</category>
        
      </item>
    
      <item>
        <title>Rising of Populism</title>
        <description>&lt;p&gt;Trump started to use the term “Chinese Virus” in twitter and briefings in the White House since 17 March.
It really let me feel angry, he almost did nothing to help the Americans stop the spread of coronavirus except blame China.
However, he stands for Americans, it implies most of Americans may agree with his view – The coronavirus is a “Chinese Virus”.
Trump’s actions are all driven by domestic politics in preparation for the 2020 election. 
COVID-19 is a global public health event. The United States is facing a huge pandemic prevention challenge, and the pandemic is likely to develop into a public crisis.
Trump has a very clear mind on this, in order to ensure that his re-election is not affected by the COVID-19 pandemic, he needs to shape a “story” for COVID-19.
“Foreign virus” is such a “story”. Its theme is: the United States is being invaded by foreign virus, the virus is imported from “other countries”, threatening the health and safety of the American public. Americans are innocent victims. Trump’s role as president is to protect the United States.&lt;/p&gt;

&lt;p&gt;Trump wants to “up the ante”, to make the stroy more vivid by throw out the “Chinese virus”. It clearly links the virus to China. And with China-threat theory, U.S.-China confrontation being the topic of U.S. politics for the last two years, cracking down and containing China is now politically correct in Washington. China was supposed to be the central topic of the Trump 2020 election.&lt;/p&gt;

&lt;p&gt;The use of term “Chinese virus” is an attempt to link infectious diseases to anti-Chinese sentiment and anti-Chinese politics.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://i.imgur.com/u5O66ET.jpg&quot; alt=&quot;img&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Trump’s story is that the COVID-19 is coming precisely from the biggest threat - China.  Even though China did not “intentionally export” the virus, its “failure to disclose” and “poor management” led to its spread to the U.S, causing serious damage to the U.S.&lt;/p&gt;

&lt;p&gt;In this way, people unconsciously shift their attention from their own epidemic prevention and government responsibility to China. They do not blame the government for its poor epidemic prevention, but to think that China exports viruses to the world and hurts the world. American politicians can find a scapegoat for their own failings.&lt;/p&gt;

&lt;p&gt;I think all of the Trump supporters will agree on his view. I know from my former hospital that an American physician never goes abroad, this person believes U.S. is the best country and never visits any other place in the world (because other countries are not better than the U.S.).  It is real ignorance.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;The appeal of the populists has grown with mounting public discontent over the status quo. In the West, many people feel left behind by technological change, the global economy, and growing inequality. Horrific incidents of terrorism generate apprehension and fear. Some are uneasy with societies that have become more ethnically, religiously and racially diverse. There is an increasing sense that governments and the elite ignore public concerns. &lt;a href=&quot;https://www.hrw.org/world-report/2017/country-chapters/dangerous-rise-of-populism&quot;&gt;The Dangerous Rise of Populism&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Nativism, xenophobia, racism are on the rise. We couldn’t avoid facing more and more conflict between China and the West. Nobody will win in the last.&lt;/p&gt;

&lt;p&gt;In China, there are also lots of people support for Populism, some of them believe the COVID-19 is &lt;em&gt;de novo&lt;/em&gt; synthetic viruses, some of them believe traditional medicine is better than modern medical medicine. They believe the person who says the truth but not consistent with the government voice is the spokesperson for the West. Personal attacks via social media are more and more common.&lt;/p&gt;

&lt;p&gt;The ideology gap between the West and China will become larger than we could think.&lt;/p&gt;

&lt;p&gt;The economic gap between the developed countries and developing countries will become larger than we could predict. By the way, do you see many artists from South East Asia or Latin American or Africa at the virtual concert series – One World: Together at Home? Do you think those people have their voice in the world?&lt;/p&gt;

</description>
        <pubDate>Sun, 22 Mar 2020 00:00:00 +0000</pubDate>
        <link>https://yulijia.net/en/uncategorized/2020/03/22/The-Global-Rise-of-Populism.html</link>
        <guid isPermaLink="true">https://yulijia.net/en/uncategorized/2020/03/22/The-Global-Rise-of-Populism.html</guid>
        
        <category>Trump</category>
        
        <category>virus</category>
        
        <category>COVID-19</category>
        
        <category>populism</category>
        
        
        <category>Uncategorized</category>
        
      </item>
    
      <item>
        <title>How to set up Samba on CentOS</title>
        <description>&lt;p&gt;Samba is the standard Windows interoperability suite of programs for Linux and Unix. 
People can browse a server directory like use Windows OS on their own computer.
It also could avoid the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;scp&lt;/code&gt; step if you want to download and open a text file in the server,  yes, you could open any files on the server and edit it like on your own computer.&lt;/p&gt;

&lt;p&gt;Here I will introduce the steps to set up Samba on CentOS in a home network. There may be a problem if someone wants to use this Samba function on Windows 10 systems with a server that support different version of the Samba protocol.
My laptop OS is Fedora, and the server OS is CentOS.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Install Samba on &lt;strong&gt;local computer&lt;/strong&gt; and &lt;strong&gt;server&lt;/strong&gt;, eg: &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;yum install samba samba-client samba-client-libs&lt;/code&gt;.&lt;/li&gt;
  &lt;li&gt;Start the protocol on server, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sudo systemctl start smb.service&lt;/code&gt;.
    &lt;ul&gt;
      &lt;li&gt;The &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;smbd&lt;/code&gt; service provides file sharing and printing services and listens on TCP ports 139 and 445. At here, for personal reason, I didn’t want to start the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;nmbd&lt;/code&gt; server, which provides NetBIOS over IP naming services to clients and listens on UDP port 137.&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;Set up firewall
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;firewall-cmd &lt;span class=&quot;nt&quot;&gt;--list-services&lt;/span&gt;
firewall-cmd &lt;span class=&quot;nt&quot;&gt;--list-ports&lt;/span&gt;
firewall-cmd &lt;span class=&quot;nt&quot;&gt;--permanent&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--zone&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;public &lt;span class=&quot;nt&quot;&gt;--add-service&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;samba
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;I want to use the &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/home/yulijia&lt;/code&gt; directory via Samba, so the Samba configuration file (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;/etc/samba/smb.conf&lt;/code&gt;) could be:
    &lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;homes]
 comment &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; Home Directories
 valid &lt;span class=&quot;nb&quot;&gt;users&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; %S, %D%w%S
 browseable &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; Yes
 &lt;span class=&quot;nb&quot;&gt;read &lt;/span&gt;only &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; No
 create mask &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 0700
     directory mask &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; 0700
 inherit acls &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; Yes
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
    &lt;p&gt;Once done, please restart Samba services, &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;systemctl restart smb.service&lt;/code&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;Connect from your local machine.
Because I use Fedora, so I could open the Nautilus to add a new &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;connect to server&lt;/code&gt; link (&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;smb://192.168.0.111:139/&lt;/code&gt;), then connect to the server, select Registered User, enter your server username and password.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;img src=&quot;https://i.imgur.com/esdDgUE.png&quot; alt=&quot;connect_to_samba&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://i.imgur.com/EAe24pn.png&quot; alt=&quot;fill_in_username_and_password&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Then the files on the Samba server will be shown.&lt;/p&gt;

&lt;p&gt;Note: the default port of Samba service is &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;139&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Reference:&lt;/p&gt;

&lt;p&gt;[1] &lt;a href=&quot;https://linuxize.com/post/how-to-install-and-configure-samba-on-centos-7/&quot;&gt;How to Install and Configure Samba on CentOS 7&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Fri, 28 Feb 2020 00:00:00 +0000</pubDate>
        <link>https://yulijia.net/en/howto/2020/02/28/how-to-set-up-samba.html</link>
        <guid isPermaLink="true">https://yulijia.net/en/howto/2020/02/28/how-to-set-up-samba.html</guid>
        
        <category>Samba</category>
        
        <category>CentOS</category>
        
        
        <category>HowTo</category>
        
      </item>
    
  </channel>
</rss>
