featurize a specific POSCAR

87 views
Skip to first unread message

Huan Tran

unread,
Aug 11, 2019, 10:05:33 AM8/11/19
to matminer
H community,

I am looking for a way to read a given POSCAR file and then calculate all the possible feature from it. Is this possible with matminer? If yes, could you please give me an example on how to code this work? Thanks

Huan


Anubhav Jain

unread,
Aug 16, 2019, 2:50:49 PM8/16/19
to matminer
Hi Huan

1. convert the POSCAR to a pymatgen Structure object using Structure.from_file() method in pymatgen
2. Apply any featurizer directly to that Structure object

For example the code below:
====
from matminer.featurizers.composition import ElementProperty
from matminer.featurizers.structure import DensityFeatures
from pymatgen import Structure

s = Structure.from_file("/Users/ajain/Desktop/POSCAR")
comp_features = ElementProperty.from_preset("magpie").featurize(s.composition)
print(comp_features)
s_features = DensityFeatures().featurize(s)
print(s_features)
====

If you have a lot of structures (many POSCARs), you could also first create a DataFrame with a "structure" column and then follow the other tutorials as needed

Huan Tran

unread,
Aug 16, 2019, 3:02:48 PM8/16/19
to Anubhav Jain, matminer
Thank you, Anubhav. This is greatly helpful for us.
Regards
Huan

--
You received this message because you are subscribed to the Google Groups "matminer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to matminer+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/matminer/5dde8038-2b17-4653-b81c-fc23813695cd%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages