python fgs
时间: 2024-06-24 09:01:30 浏览: 7
Python中的fgs可能是指“Feature Generation System”(特征生成系统),这是一个计算机科学概念,特别是在机器学习和数据挖掘中用于描述一种方法,它可以根据输入数据生成新的特征或属性,这些特征可以用来改进模型的性能。例如,在文本处理中,fgs可能会将单词转换为词干,提取n-gram特征等。
另一个可能是缩写错误,如果是“file globbing system”,则是在文件操作中,它是一种在操作系统中使用通配符(如*、?)来指定一组文件的操作方式,Python的os模块提供了对这种功能的支持。
如果是指特定的库或者工具,请提供更详细的信息,这样我可以给出准确的解释。相关问题:
1. Python中如何使用fgs进行特征生成?
2. 如何在Python中实现文件globbing功能?
3. FGS在实际项目中有哪些应用场景?
相关问题
python怎么实现化合物库分子的子结构频次统计
要实现化合物库分子的子结构频次统计,可以使用RDKit Python库。下面是一些参考代码:
1. 加载化合物库
```python
from rdkit import Chem
from rdkit.Chem import AllChem
# 从文件中读取化合物库
suppl = Chem.SDMolSupplier('compound.sdf')
mols = [x for x in suppl if x is not None]
print('共读取到{}个分子'.format(len(mols)))
```
2. 提取分子中的子结构
```python
# 提取分子中的环
def extract_rings(mol):
rings = Chem.GetSymmSSSR(mol)
return [Chem.MolToSmiles(mol, rootedAtAtom=r) for r in rings]
# 提取分子中的官能团
def extract_functional_groups(mol):
fgs = ['[{}]'.format(Chem.MolToSmiles(mol, rootedAtAtom=a, includeAtomNumbers=True)) for a in mol.GetAtoms() if a.GetAtomicNum() != 6]
return fgs
# 提取分子中的子结构
def extract_substructures(mol):
rings = extract_rings(mol)
fgs = extract_functional_groups(mol)
return rings + fgs
# 提取化合物库中所有分子的子结构
substructures = []
for mol in mols:
substructures += extract_substructures(mol)
substructures = list(set(substructures))
print('共提取到{}个子结构'.format(len(substructures)))
```
3. 计算每个子结构在化合物库中出现的频次
```python
# 计算每个子结构在化合物库中出现的频次
substructure_count = {}
for substructure in substructures:
substructure_count[substructure] = 0
for mol in mols:
for substructure in extract_substructures(mol):
substructure_count[substructure] += 1
print(substructure_count)
```
这样就可以得到每个子结构在化合物库中出现的频次了。可以根据需要,进一步对子结构进行聚类、筛选等操作,以便更好地分析化合物库中的结构信息。
<select id="pageQueryAllShouLiDanRecordNew" resultType="java.util.Map"> SELECT ${param} ,B.FLOWID,B.YYWORKSEQ,B.KDWORKSEQ FROM WF_BASE_FORM_INFO B where B.STATUS_ID < 100 AND B.PRODUCTID='0' ${where} <if test="FGSCode != '' and FGSCode != null"> AND B.FGS_Code in (#{FGSCode}) </if> <if test="ZHWGID != '' and ZHWGID != null"> AND B.ZHWGID in (#{ZHWGID}) </if> <choose> <when test="KDCompany == 3"> AND B.KDCOMPANY = '3' </when> <otherwise> AND B.KDCOMPANY in ('1','4','99') </otherwise> </choose> <if test="orderBy !=null and orderBy != ''"> ${orderBy} </if> <if test="orderBy ==null or orderBy == ''"> ORDER BY B.RECEIVE_TIME DESC </if> </select> 这段代码是什么意思
这段代码是一个 MyBatis 的 SQL 映射语句。它的作用是从 WF_BASE_FORM_INFO 表中查询符合条件的记录,并返回一个包含流程ID、YYWORKSEQ、KDWORKSEQ等字段的 Map 对象列表。
具体来说,它会根据传入的参数 ${param}、${where}、#{FGSCode}、#{ZHWGID}、${orderBy} 等条件进行筛选,其中:
- STATUS_ID < 100 且 PRODUCTID='0' 是筛选条件的一部分;
- 如果传入的 FGSCode 不为空,则会额外筛选 FGS_Code 列;
- 如果传入的 ZHWGID 不为空,则会额外筛选 ZHWGID 列;
- 如果传入的 KDCompany 等于 3,则会额外筛选 KDCOMPANY = '3',否则会筛选 KDCOMPANY in ('1', '4', '99');
- 如果传入的 orderBy 不为空,则按照该字段进行排序,否则按照 RECEIVE_TIME 倒序排列。
最后,符合条件的记录会被封装成一个 Map 对象列表并返回。
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![.pdf](https://img-home.csdnimg.cn/images/20210720083646.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)