- 1. Working directories
- 2. img2pdf with xargs
- 3. Telomere measurement
- 4. BLAST结果下载要求
- 5. Tips of less
- 6. How to Use the less Command on Linux
- 6.1. The History of less
- 6.2. Why less Is Better Than more
- 6.3. Reading a File With less
- 6.4. Displaying Line Numbers
- 6.5. Searching in less
- 6.6. Opening a File With a Search Term
- 6.7. Navigating in Less: The Most Useful Keys
- 6.8. Squeeze Blank Lines
- 6.9. Viewing Multiple Files
- 6.10. Using Marks
- 6.11. Using Piped Input with Less
- 6.12. Editing Files With less
- 6.13. In Summary
- 7. QGIS
- 8. sequin from NCBI
- 9. CRAN “devtools” installation
Working directories
1 | # GoldenDict installation in Ubuntu |
1 | sudo aptitude upgrade --full-resolver |
1 | open: 40003; closed: 28954; defer: 51; conflict: 191 oUnable to resolve dependencies for the upgrade: no solution found. |
1 | A_Ligation_Recombinase_Polymerase_Amplification_Assay_for_Rapid_Detection_of_SARS_CoV−2.pdf |
GoldenDict
magnet:?xt=urn:btih:477f73217801f21bf8ed499aa431eb9641ba789e&dn=GoldenDict
img2pdf with xargs
command line - Convert a directory of JPEG files to a single PDF document - Ask Ubuntu
1 | convert *.jpg -auto-orient pictures.pdf |
Unfortunately, convert
changes the image quality before “packing it” into the PDF. So, to have minimal loss of quality, is better to put the original jpg
, (works with .png
too) into the PDF, you need to use img2pdf
.
I use these commands:
A shorter one liner solution also using img2pdf
as suggested in the comments**
Make PDF
img2pdf *.jp* --output combined.pdf
(optional) OCR the output PDF
ocrmypdf combined.pdf combined_ocr.pdf
Below is the original answer commands with more command and more tools needed:
This command is to make a
pdf
file out of everyjpg
image without loss of either resolution or quality:ls -1 ./*jpg | xargs -L1 -I {} img2pdf {} -o {}.pdf
This command will concatenate the
pdf
pages into one document:pdftk *.pdf cat output combined.pdf
And finally, I add an OCRed text layer that doesn’t change the quality of the scan in the pdfs so that they can be searchable:
pypdfocr combined.pdf
An alternative to using pypdfocr
:
1 | `ocrmypdf combined.pdf combined_ocr.pdf` |
img2pdf: get pages in good order
1 | img2pdf *.tif -o out.pdf |
Ref
- Tags - Ask Ubuntu
- img2pdf: get pages in good order
- bash - How can I convert a series of images to a PDF from the command line on linux? - Stack Overflow
Telomere measurement
- Telomere Length: A Review of Methods for Measurement
- Telomere length measurement by qPCR – Summary of critical factors and recommendations for assay design
- A quantitative PCR method for measuring absolute telomere length | Biological Procedures Online | Full Text
- Frontiers | Telomere Length Measurement by Molecular Combing | Cell and Developmental Biology
- Comparison of telomere length measurement methods | Philosophical Transactions of the Royal Society B: Biological Sciences
- One-Step High-Throughput Telomerase Activity Measurement of Cell Populations, Single Cells, and Single-Enzyme Complexes | ACS Omega
BLAST结果下载要求
比对结果汇总需要包括2类文件
- 说明文件,如README.txt等
- BLAST结果汇总文件
BLAST结果汇总文件
- Text格式结果,该格式的文件头具有较好的信息汇总,需要下载。同时,Traditional画面的Text格式结果也需要下载。
- ASN.1格式结果
- CSV格式的Hit-Table汇总结果
- SAM格式结果
以上共计4种格式,5个文件必须下载。
在说明文件中简述如下信息:
- RID号码
- Query数据
- Subject,即数据库侧,特别是是否指定了数据范围,例如,是否限定了人类相关数据库。
Tips of less
How to Use the less Command on Linux
OCT 23, 2019, 8:00 AM EST | 7 MIN READ
Fatmawati Achmad Zaenuri/Shutterstock
The less
command lets you page through a text file, displaying a screenful of text each time. It seems like one of the simplest Linux commands at first glance, but there’s a lot more to less than meets the eye.
The History of less
Everything in Linux–and Unix—has a history, no pun intended. The less
program is based on the more
program, which was initially released in 1978 in version 3.0 of the Berkeley Software Distribution Unix (3.0BSD). more
allowed you to progressively page through a text file, displaying a screenful of text at a time.
RELATED10 Basic Linux Commands for Beginners
Necessity being the mother of invention, it was the inability of early versions of more
to scroll backward through a file that prompted Mark Nudelman to develop less
and to overcome that specific problem. That work started in 1983, and the first version was released outside of the company he worked for in 1985. As of October 2019, he is still the maintainer of less
.
I wonder if there is a Linux user who hasn’t used less
? Even if they haven’t used it to page through a chosen text file, chances are they’ve used the man
command. And man
calls less
behind the scenes to display the man
pages.
This is a command with a lot of tricks up its sleeve.
Why less Is Better Than more
less
has been added to steadily over the years. It has a staggering amount of command-line options and in-application command keystrokes. Do a quick comparison of the man page for less and the man page for more
, and you’ll start to see how less
absolutely towers over more
.
more
has overcome its initial failing of not being able to page backward through text, but only for files. It cannot page backward through piped input. You can do that with less
.
With its flexibility in navigating files, viewing multiple files, searching for text, dropping and returning to bookmarks, and dealing with piped input, less
wins hands down. Use less
instead of the more
.
Reading a File With less
To load a file into less
, provide the name of the file on the command line:
less Dr-Jekyll-and-Mr-Hyde-001.txt
The file is loaded and displayed. The top (or “start”) of the file is shown in the terminal window. You can use the scroll wheel of your mouse to scroll forward and backward through the text.
On the keyboard, use the Space bar or Page Down key to move forward through the text one screenful of text at a time.
Page Up will move backward through the file (towards the “start” of the file.) The Home and End keys will take you directly to the start and end of the text file, respectively.
The name of the file is displayed in the bottom-left corner of the display. When you start to move around in the file, the bottom line is cleared. It is used to display messages to you, and for you to enter commands in.
Press “q” to quit less
.
Displaying Line Numbers
To have the lines of the text file numbered for you, use the -N
(line numbers) option.
less -N Dr-Jekyll-and-Mr-Hyde-001.txt
The line numbers can be useful to guide you back to specific lines or sections within log files and other files that are not written in standard prose.
Searching in less
To search through the text of the file, press “/” and then type your search phrase. The search is case-sensitive. Your search phrase is displayed on the bottom line of the display. Hit “Enter” to perform the search.
In this example, the search term is “Enfield,” and this can be seen at the bottom of the display.
The search takes place from the current page to the end of the text file. To search the entire file, move to the top of the file before you search.
You will be told if there are no matches. If a match is found, the display moves to display the found item.
To find the next matching item, press “n”. To search for the previous matching item, press “N”.
To search backward from your current position in the file toward the start of the file, press the “?” key and type your search term. To find the next matching item, press “n”. To search for the previous matching item, press “N”.
Note that, when you’re searching backward, the next matching item (found with “n”) is the next one nearer to the top of the file, and the “N” for the previous matching item looks for a matching item closer to the bottom of the file. in other words, “n” and “N” reverse their search direction when you search backward.
Opening a File With a Search Term
You can use the -p
(pattern) option to cause less
to search through the text file and find the first matching item. It will then display the page with the matching search item in it, instead of the first page of the file. Unless, of course, the search item is found on the first page of the file.
Note there is no space between the -p
and the search term.
less -pEnfield Dr-Jekyll-and-Mr-Hyde-001.txt
The file is displayed with the first matching search term highlighted.
Navigating in Less: The Most Useful Keys
Use these keys to move and search through the text file.
- Move forward one line: Down Arrow, Enter, e, or j
- Move backward one line: Up Arrow, y, or k
- Move forward one page: Space bar or Page Down
- Move backward one page: Page Up or b
- Scroll to the right: Right Arrow
- Scroll to the left: Left Arrow
- Jump to the top of the file: Home or g
- Jump to the end of the file: End or G
- Jump to a specific line: Type the line number and then hit “g”
- Jump to a percentage way through the file: Type the percentage and then hit “p” or “%.” (You can even enter decimal values, so to jump to the point 27.2 percent through the file, type “27.2” and then hit “p” or “%.” Why would you want to use decimals? I honestly have no idea.)
- Search forward: Hit “/” and type your search, like “/Jekyll”, and press Enter
- Search backward: Hit “?” and type your search, like “/Hyde”, and press Enter
- Next matching search item: n
- Previous matching search item: N
- Quit: q
Squeeze Blank Lines
The -s
(squeeze blank lines) option removes a series of blanks lines and replaces them with a single blank line.
There are a couple of consecutive blank lines in our example file, let’s see how less
treats them when we use the -s
option:
less -s Dr-Jekyll-and-Mr-Hyde-001.txt
All of the double (or more) blank lines have been replaced by a single blank line in each case.
Viewing Multiple Files
less
can open multiple files for you. You can hop back and forth from file to file. less
will remember your position in each file.
less Dr-Jekyll-and-Mr-Hyde-001.txt Dr-Jekyll-and-Mr-Hyde-002.txt
The files are opened, and the first file is displayed. You are shown which file you are looking at, and how many files have been loaded. This is highlighted below.
To view the next file, press “:” and then hit “n”.
Your display will change to show the second file, and the information on the bottom line is updated to show you are viewing the second file. This is highlighted below.
To move to the previous file, type “:” and then hit “p.”
Using Marks
less
lets you drop a marker so that you can easily return to a marked passage. Each marker is represented by a letter. To drop a mark on the top-most displayed line, press “m” and then hit the letter you wish to use, such as “a”.
When you press “m”, the bottom line of the display shows a prompt as it waits for you to press a letter key.
As soon as you press a letter, the prompt is removed.
From any other location within the file, you can easily return to a mark by pressing the apostrophe (or single quote) “‘” and then pressing the letter of the mark you wish to return to. When you press the “‘” key, you are prompted for the mark you wish to go to.
Press the letter of the mark you wish to return to, and that section of the text file is displayed for you.
Using Piped Input with Less
less
can display information that comes as a stream of piped text, just as easily as if it were a file.
The dmesg
command displays the kernel ring buffer messages. We can pipe the output from dmesg
into less
using the following command:
dmesg | less
The output from dmesg
is displayed.
You can page and search through the piped input just as though it were a file. To see the most recent messages, hit “End” to go to the bottom of the file.
As new messages arrive, you must keep pressing “End” to force less
to display the bottom of the file. This isn’t very convenient. To have less
always show the bottom of the text, even when new data is being added, use the +F
(forward) option. Note the use of +
and not -
as the option flag.
dmesg | less +F
The +
option flag tells less
to treat the option as though you had used that command inside less
. So if you forgot to use the +F
option, press “F” inside less
.
less
displays the bottom of the text, which shows the most recent messages from dmesg
. It displays a message that it is waiting for more data. When more kernel messages appear, the display scrolls so that you can always see the newest messages.
You can’t scroll or page in this mode; it is devoted to displaying the bottom of the piped text. To exit from of his mode, press Ctrl+c, and you will be returned to the usual less
interactive mode.
Editing Files With less
You can edit files with less
—well, sort of. This command can’t edit files, but if you type “v” when you are viewing a file, the file is transferred to your default editor. When you leave the editor, you are returned to less
.
Hit “v” when viewing a file in less
:
The file is loaded into the default editor, in this case nano
:
When you close the editor, you are turned to less
.
In Summary
As counterintuitive as it may seem, in this caseless
> more
.
Linux Commands
Files
tar · pv · cat · tac · chmod · grep · diff · sed · ar · man · pushd · popd · fsck · testdisk · seq · fd · pandoc · cd · $PATH · awk · join · jq · fold · uniq · journalctl · tail · stat · ls · fstab · echo · less · chgrp · chown · rev · look · strings · type · rename · zip · unzip · mount · umount · install · fdisk · mkfs · rm · rmdir · rsync · df · gpg · vi · nano · mkdir · du · ln · patch · convert · rclone · shred · srm
Processes
alias · screen · top · nice · renice · progress · strace · systemd · tmux · chsh · history · at · batch · free · which · dmesg · chfn · usermod · ps · chroot · xargs · tty · pinky · lsof · vmstat · timeout · wall · yes · kill · sleep · sudo · su · time · groupadd · usermod · groups · lshw · shutdown · reboot · halt · poweroff · passwd · lscpu · crontab · date · bg · fg
Networking
netstat · ping · traceroute · ip · ss · whois · fail2ban · bmon · dig · finger · nmap · ftp · curl · wget · who · whoami · w · iptables · ssh-keygen · ufw
RELATED: Best Linux Laptops for Developers and Enthusiasts
QGIS
1 | sudo apt install qgis qgis-plugin-grass |
sequin from NCBI
1 | sudo apt install ncbi-tools-x11 |
CRAN “devtools” installation
1 | 1: In install.packages("devtools", dependencies = TRUE) : |
1 | install.packages(c("caret", "coin", "Cubist", "digest", "e1071", "fastICA", "glue", "gower", "ipred", "jsonlite", "knitr", "libcoin", "lme4", "lubridate", "magrittr", "mime", "nloptr", "party", "RcppArmadillo", "readr", "recipes", "rlang", "stringi", "tidyr", "tinytex", "tzdb", "vroom", "xfun", "yaml")) |