Entering edit mode
5.8 years ago
Arindam Ghosh
▴
530
I need to extract the sample source for a list of sample ids. I tried using efetch as follows:
efetch -db biosample -id SAMN04383980 -format xml | xtract -pattern BioSampleSet -division BioSample -group Attributes -element Attribute
The problem here is that there are often more than two attributes:
<Attributes>
<Attribute attribute_name="source_name" harmonized_name="source_name" display_name="source name">H7 hESCs</Attribute>
<Attribute attribute_name="cell line" harmonized_name="cell_line" display_name="cell line">H7 derived</Attribute>
</Attributes>
How do I extract the one with attribute_name="source_name" only?
Any idea how to also export the attribute_name to have a nicely formatted table ?