技术背景

由于创建软链接这个事情,在算法开发的日常中使用到的并不是很多,因此本文也是做一个简单的回顾。这里我们使用的案例是通过TMalign这个蛋白质打分文件,在编译好可执行文件之后,可以使用建立软链接的方法快捷的使用该可执行文件。

TMalign的下载与安装

TMalign可以给两个给定的蛋白质pdb文件进行评分:

$ TMalign out.pdb origin.pdb

 *********************************************************************
* TM-align (Version 20220412): protein structure alignment *
* References: Y Zhang, J Skolnick. Nucl Acids Res 33, 2302-9 (2005) *
* Please email comments and suggestions to yangzhanglab@umich.edu *
********************************************************************* Name of Chain_1: out.pdb (to be superimposed onto Chain_2)
Name of Chain_2: origin.pdb
Length of Chain_1: 207 residues
Length of Chain_2: 207 residues Aligned length= 207, RMSD= 0.00, Seq_ID=n_identical/n_aligned= 1.000
TM-score= 1.00000 (if normalized by length of Chain_1, i.e., LN=207, d0=5.35)
TM-score= 1.00000 (if normalized by length of Chain_2, i.e., LN=207, d0=5.35)

那么如果要使用该评分软件,需要从该链接中下载相关的文件,比如cpp文件和readme文件。下载到本地目录下之后,可以执行如下指令进行编译(如果是Mac可能需要去掉static):

$ g++ -static -O3 -ffast-math -lm -o TMalign TMalign.cpp

编译之后就会在当前路径下生成一个名为TMalign的可执行文件:

$ ll
总用量 3036
drwxrwxr-x 2 dechin dechin 4096 5月 6 13:58 ./
drwxrwxr-x 11 dechin dechin 4096 5月 6 13:57 ../
-rw-rw-r-- 1 dechin dechin 7387 5月 6 13:58 readme.c++.txt
-rwxrwxr-x 1 dechin dechin 2904224 5月 6 13:59 TMalign*
-rw-rw-r-- 1 dechin dechin 182097 5月 6 13:57 TMalign.cpp

建立软链接

虽然这条指令很简单,但是需要注意的是一定要使用绝对路径,如果使用相对路径,会出现符号连接的层数过多的报错信息。另外如果要创建的软链接在/usr/bin之类的目录下的话,需要使用到sudo权限。具体执行指令如下:

$ sudo ln -s /home/dechin/tools/TMalign/TMalign /usr/bin/TMalign

一般/usr/bin是用户的系统路径,相比于不断的补充系统路径,这种建立软链接的方式会显得更加简洁。建立完软链接之后,就可以在系统的任一位置直接执行TMalign的指令了:

$ TMalign 

 *********************************************************************
* TM-align (Version 20220412): protein structure alignment *
* References: Y Zhang, J Skolnick. Nucl Acids Res 33, 2302-9 (2005) *
* Please email comments and suggestions to yangzhanglab@umich.edu *
********************************************************************* Usage: TMalign PDB1.pdb PDB2.pdb [Options] Options:
-u TM-score normalized by user assigned length (the same as -L)
warning: it should be >= minimum length of the two structures
otherwise, TM-score may be >1 -a TM-score normalized by the average length of two structures
T or F, (default F) -i Start with an alignment specified in fasta file 'align.txt' -I Stick to the alignment specified in 'align.txt' -m Output TM-align rotation matrix -d TM-score scaled by an assigned d0, e.g. 5 Angstroms -o Output the superposition to 'TM_sup*'
$ TMalign PDB1.pdb PDB2.pdb -o TM_sup
View superposed C-alpha traces of aligned regions by RasMol or PyMOL:
$ rasmol -script TM_sup
$ pymol -d @TM_sup.pml
View superposed C-alpha traces of all regions:
$ rasmol -script TM_sup_all
$ pymol -d @TM_sup_all.pml
View superposed full-atom structures of aligned regions:
$ rasmol -script TM_sup_atm
$ pymol -d @TM_sup_atm.pml
View superposed full-atom structures of all regions:
$ rasmol -script TM_sup_all_atm
$ pymol -d @TM_sup_all_atm.pml
View superposed full-atom structures and ligands of all regions
$ rasmol -script TM_sup_all_atm_lig
$ pymol -d @TM_sup_all_atm_lig.pml -fast Fast but slightly inaccurate alignment by fTM-align algorithm -cp Alignment with circular permutation -v Print the version of TM-align -h Print the full help message, including additional options (Options -u, -a, -d, -o will not change the final structure alignment) Example usages:
TMalign PDB1.pdb PDB2.pdb
TMalign PDB1.pdb PDB2.pdb -u 100 -d 5.0
TMalign PDB1.pdb PDB2.pdb -a T -o PDB1.sup
TMalign PDB1.pdb PDB2.pdb -i align.txt
TMalign PDB1.pdb PDB2.pdb -m matrix.txt
TMalign PDB1.pdb PDB2.pdb -fast
TMalign PDB1.pdb PDB2.pdb -cp

总结概要

编译安装源代码为可执行文件时,有时候会遇到想把可执行文件放在特定的路径下的问题,比如放到/usr/bin目录下,这样可以全局可调用,又不需要手动添加各种乱七八糟的系统路径。这就需要使用到Linux中的软链接的功能,通常使用ln -s的指令即可。本文顺带介绍了蛋白质结构评分软件TMalign的源码下载和安装使用的基本方法,编译成一个可执行文件后,可以建立一个软链接,在系统各处都可以使用,是一个比较基础的操作。

版权声明

本文首发链接为:https://www.cnblogs.com/dechinphy/p/ln.html

作者ID:DechinPhy

更多原著文章请参考:https://www.cnblogs.com/dechinphy/

打赏专用链接:https://www.cnblogs.com/dechinphy/gallery/image/379634.html

腾讯云专栏同步:https://cloud.tencent.com/developer/column/91958

CSDN同步链接:https://blog.csdn.net/baidu_37157624?spm=1008.2028.3001.5343

51CTO同步链接:https://blog.51cto.com/u_15561675

参考链接

  1. https://blog.csdn.net/jialibang/article/details/108247033

最新文章

  1. C语言笔记
  2. jQuery插件-表单验证插件-Validation
  3. Scala教程
  4. ASP lable标签显示过长,自动换行。
  5. sql 查询强制使用HASH连接性能测试比较
  6. Codeforces Round #322 (Div. 2) B. Luxurious Houses 水题
  7. Android测试TestSuite的执行方法
  8. 编写高效的JavaScript
  9. Spring01-IOC
  10. java频繁new对象的优化方案
  11. hdu-5786(补图最短路)
  12. 李清华 201772020113《面向对象程序设计(java)》第十四周学习总结
  13. MVC区域area
  14. 如果CocoaPods 导入的库需要修改代码
  15. ServiceDesk Plus更有序地组织IT项目
  16. POJ 2453
  17. 20155320 Exp3 免杀原理与实践
  18. 基于nopCommerce的开发框架(附源码)
  19. Ninject
  20. ssh之为什么要放弃ssh?

热门文章

  1. 2020/12/28为止好用的PC下载工具
  2. Collection和 Collections的区别?
  3. Homebrew安装环境
  4. Spring 框架的事务管理有哪些优点?
  5. 解释 WEB 模块?
  6. 阿里低代码引擎 | LowCodeEngine - 如何配置并调用请求
  7. Easyx库安装教程
  8. VueJs项目笔记
  9. HTML5 & CSS3 内容收集(1)
  10. windows下的volatility取证分析与讲解