How to extract repeatedly information from a text and store a specific table?

조회 수: 1 (최근 30일)

Hello, I have SDF file containing structure information over 150K substances and I'm interested in extract some information from there. I had to convert to .xls due to matlab supporting.

You can visualize an example of this file below. The ORIGINAL TEXT FILE IS AVAILABLE AS ONTHOLOGY.XLS

Each structure starts with a code (in this example: Q2785366) and finishes with a $$$$.

Q2785366-1 %name of structure

% A set of numbers that represent a .mol file. I'm not interested on them.

%Attributes

"> InChIKey" InChIKey=FPRJHXLFTAYEJH-UHFFFAOYSA-N

"> SMILES" COC1=C2C(OC)=C3C=COC3=NC2=C(OCC(O)C(C)(C)O)C=C1

> Kingdom Organic compounds

"> Superclass" Organoheterocyclic compounds

"> Class" Quinolines and derivatives

"> Subclass" Furanoquinolines

"> Nodes"

"> Parent" Furanoquinolines

"> Parents" Furopyridines

"> Framework" Aromatic heteropolycyclic compounds

"> Substituents" Furanoquinoline

"> description" This compound belongs to the class of organic compounds known as furanoquinolines. These are compounds containing a furan ring fused to a quinoline.

"> Ancestors" 1,2-diols

> Descriptors

$$$$

I'm interested in organize this data in a new table. The rows related the substances and columns with features. Below are described the features which I´m interested.

Column 1: InChIKey (using only information after "=")

Column 2: SMILES (Only Code)

Column 3: Kingdom (Only text)

Column 4: Superclass (Only text)

Column 5: Class (Only text)

Column 6: Subclass (Only text)

Column 7: Framework (Only text)

Thank you.

  댓글 수: 2
Bob Thompson
Bob Thompson 2018년 4월 25일
You can find specific strings or values within an array using commands such as strfind(), find(), and strcmp(). I would suggest importing your data into a cell array and then examining cells for these specific values you're looking for.

댓글을 달려면 로그인하십시오.

답변 (1개)

Sarah Palfreyman
Sarah Palfreyman 2018년 4월 30일
You can also use Text Analytics Toolbox for this workflow.

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by