后缀数组
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
from rdkit.Chem import AllChem as Chem | |
import argparse | |
def smiles2molfile(smiles): | |
""" smiles to mol file | |
@parma molecule_name | |
@return None | |
@obtain a file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
def get_qstat_length(): | |
result=os.popen('qstat') | |
context = result.read() | |
length=len(context) | |
result.close() | |
return length |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!perl | |
use strict; | |
use Getopt::Long; | |
use MaterialsScript qw(:all); | |
my $exportDir="D:\\scripts\\car\\"; | |
my $folderPath = "D:\\scripts\\mol\\"; | |
opendir(THISDIR,$folderPath)or die "bad"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from rdkit import Chem | |
from rdkit.Chem import AllChem | |
from rdkit.Chem import Draw | |
import os | |
import pandas as pd | |
import argparse | |
def get_all_file(path): | |
filename_list=[] | |
files = os.listdir(path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import pubchempy as pcp | |
import argparse | |
def search_molecule_from_cas(CAS): | |
""" search molecules from CAS number | |
@parma molecule_name | |
@return molecule | |
""" | |
searched_results = pcp.get_compounds(CAS,"name") # gget a compounds list |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# path_list 是获得的所有包含 text 的绝对路径的list | |
def get_all_path(path_list,path,filenmane_content): | |
paths = os.listdir(path) # 列出指定路径下的所有目录和文件 | |
for i in paths: | |
com_path = os.path.join(path,i) | |
if os.path.isdir(com_path): | |
get_all_path(path_list,com_path,filenmane_content) # 如果该路径是目录,则调用自身方法 | |
elif os.path.isfile(com_path): | |
if filenmane_content in com_path: | |
path_list.append(com_path) # 如果该路径是文件,则追加到path_list中 |
B-树
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
数据压缩 | |
- 霍夫曼压缩 |
子字符串查找
NewerOlder