Add office 365 calendar to Thunderbird
Thunderbird is a powerful software to handle emails and calendar accounts. Recently, I had a new laptop and installed the latest Thunderbird version 78.6.0, and want to add my office 365 calender into it. ).
Steps After searching internet for a while, I found that the following solution worked out:
Install TbSync addon.
Install Provide for Exchange ActiveSync addon.
Start the TbSync Addon from Tools->Addon options->TbSync.
[Learning notes] R S4 classes
There are three kinds of classes in R, S3, S4, and RC (or R6). The S3 class is simply
created by adding a ‘class’ attribute to an object. The S4 class is stricter and need
formally created, but it is still different from the classes in other object-oriented
programming languages such as Java, in terms of class inheritance and method dispatch.
The RC/R6 classes are more like the classes in Java.
[R] Use variables in RMarkdown chunk options
One can use variables as chunk options, which gives convenience in controlling the document appearance programmatically. Normally one need set up a variable in prior chunks to use it in current chunk. Here is an example.
The code ```{r set-var, eval=F} cat("Chunk 1") outWid="50%" ``` ```{r plot1, fig.cap=paste("out.width =", outWid), out.width=outWid} cat("Chunk 2") outWid="20%" plot(1:10) ``` ```{r plot2, fig.cap=paste("out.width =", outWid), out.width=outWid} cat("Chunk 3") plot(1:10) ``` The output cat("Chunk 1") ## Chunk 1 outWid="50%" cat("Chunk 2") ## Chunk 2 outWid="20%" plot(1:10) Figure 1: out.
[Python] Add pushback capacity to generators
Generators are a special kind of functions which return values using the keyword yield. The function itself is actually an iterator, allowing traversing its returned values in a for loop.
Sometimes, one may want to push back a obtained value to the generator and read again next time. To do so, one can create a iterable class to wrap generators. Below is an example:
A generator First, let’s construct a generator.
[R] minfi ERROR; return code from pthread_create() is 22
minfi is an R package to analyze DNA methylation arrays, such Illumina 450K and EPIC arrays.
One main function in the minfi package is estimateCellCounts; it can be used to estimate immuno cell fractions from a sample based on DNA methylation values. However, recently when I tried to run the function, I met the following problem during the normalization step:
1 2 3 4 5 6 7 8 9 10 Loading required package: FlowSorted.
[Linux] Caution: using command 'less' on gzipped file
A couple of years ago, I found that I can use Linux command less to view gzipped file, such as:
1 less in.gz This is very convenient to view gzipped file content.
However, recently, I noticed a problem with it. For a file which has 42196516 lines, if I opened it with less, it gave me a count of 30356021 lines:
1 2 less test.fq.gz | wc -l; # giving 30356021 gzip -dc test.
[Tips] Get the OS version of Linux
There are many variants of Unix/Linux systems, such as Ubuntu, Redhat, and even some versions in Windows system such as MinGW/Msys and Cygwin.
Today I am going to introduce a way to get such information, which is simple, run the following command
1 uname -o Running this command in Ubuntu and Redhat will yield GNU/Linux, while running it under MinGW/Msys yields Msys. If you run
1 uname -r will give you kernel release.
[Bioinfo] Extract data using NCBI E-utilities
Today I am going to introduce a powerful tool to retrieve data from NCBI – E-utilities. This is a REST API for NCBI databases. I used the API several years ago, but recently I picked it up again for my projects, so I think that this is a good opportunity to make some records for my future use as well as for internet users. So let’s start.
Introduction The use of the API has the following format:
[Linux] Input password automatically
In this post, I will introduce an approach to input password programatically, which is useful if a repeated command needs password.
Note: this approach is subject to the risk of exposing your passwords to others, so use it with caution.
Let’s use sudo as an example. Normally when you type
1 sudo ls It will prompt for a password if you set one.
However, if you type
[Windows] Get running processes using PowerShell
As a computational biologist, I may want to get the commands running in current system. This is pretty simple to achieve in Unix-like systems (using ps -ef or top command), but need some effort in Windows system. Today, I’d like to introduce two ways to get the running processes in using Windows PowerShell.
The first is get-process, which will list running processes, generating a table like the below:
Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName 162 12 1660 5160 0.