Skip to content

Instantly share code, notes, and snippets.

@naphthalene
Created January 31, 2016 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save naphthalene/d65c92b8ece43cc66131 to your computer and use it in GitHub Desktop.
Save naphthalene/d65c92b8ece43cc66131 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -f
IFS=$'\n'
esearch -db protein -query "ybfE" |\
efetch -format gpc -mode xml |\
xtract -insd complete CDS coded_by > query_results.txt
for i in $(cat query_results.txt);
do echo "$i" | awk '{match($0,"([A-Z0-9\\.]+)\\s+(complement\\()?([A-Z0-9\\.]+):([0-9]+)\\.\\.([0-9]+)(\\))?",a)}END{print a[1], a[3], a[4], a[5]}'
done
unset IFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment