Skip to content

Instantly share code, notes, and snippets.

@wbazant
Created June 19, 2018 10:50
Show Gist options
  • Save wbazant/fbee26e5c827605ec5bf7c51898a4af3 to your computer and use it in GitHub Desktop.
Save wbazant/fbee26e5c827605ec5bf7c51898a4af3 to your computer and use it in GitHub Desktop.
Get sample attributes for an ENA sample
sampleAttributes() {
curl -s "https://www.ebi.ac.uk/ena/data/view/$1&display=xml " \
| perl -MXML::LibXML -e '
for my $attr (XML::LibXML->load_xml(string => do {local $/ ; <> }) -> findnodes("./ROOT/SAMPLE/SAMPLE_ATTRIBUTES/*")) {
print $attr->findvalue("./TAG") . "\t" . $attr->findvalue("./VALUE"). "\n"
} '
}
sampleAttributes SRS1334254
cultivar CCN51
dev_stage Adult tree
geo_loc_name Ecuador: local selection
tissue mix Leaf-flower
BioSampleModel Plant
ENA-SPOT-COUNT 14224288
ENA-BASE-COUNT 2844857600
ENA-FIRST-PUBLIC 2016-03-11
ENA-LAST-UPDATE 2016-03-14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment