繁体   English   中英

如何提取子文件中存在的化合物名称?

[英]How to extract names of compound present in sub files?

我有一个包含 15000 个文件夹名称的 15000 个化合物名称(文件名:uniq-compounds)的列表。 该文件夹有子文件,即out.pdbqt ,其中包含第 3 行中的化合物名称。 (名称 = 1-叔丁基-5-氧代-N-[2-(3-吡啶基)乙基]-3-吡咯烷甲酰胺)。 我想通过提供 50,000 个文件夹中的 uniq 复合文件(它包含文件夹名称,例如ligand_* )来提取所有这 15000 个名称。

目录和子文件

sidra---50,000folder (ligand_00001 - ligand50,000)--each contains subfiles (out.pdbqt)--that conatins names.(mention below)
another file (uniq-compound) contains 15000 folder names (that compound names i want).

输出.pdbqt

MODEL 1
REMARK VINA RESULT:      -6.0      0.000      0.000
REMARK  Name = 1-tert-butyl-5-oxo-N-[2-(3-pyridinyl)ethyl]-3-pyrrolidinecarboxamide
REMARK  8 active torsions:
REMARK  status: ('A' for Active; 'I' for Inactive)
REMARK    1  A    between atoms: N_1  and  C_7

假设, uniq-compound.txt包含文件夹名称,每个文件夹包含一个out.pdbqt 此外,化合物名称出现在文件out.pdbqt的第三行。 如果是这种情况,下面的脚本将起作用:

#!/bin/bash
while IFS= read -r line; do
    awk 'FNR == 3 {print $4}' $line/out.pdbqt 
done < uniq-compound.txt

Loop 会一一遍历uniq-compound.txt ,对于文件(即文件夹)中的每一行,它使用awk显示该文件out.pdbqt内文件out.pdbqt的第 3 行的第 4 列。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM