Skip to content

Instantly share code, notes, and snippets.

@bryan-lunt
Created February 24, 2016 16:40
Show Gist options
  • Save bryan-lunt/6b45d309a703a300a3c0 to your computer and use it in GitHub Desktop.
Save bryan-lunt/6b45d309a703a300a3c0 to your computer and use it in GitHub Desktop.
Getter for FlyFactorSurvey data
#!/usr/bin/env python
import BeautifulSoup as BS
import argparse
parser = argparse.ArgumentParser()
args, other = parser.parse_known_args()
symbols=["ind","kni","bcd"]
import requests
def get_gene_pwm(gene_symbol):
foo = requests.post("http://mccb.umassmed.edu/ffs/SearchAction.php",{"Source":"AnyPWM","searchType":"searchTF","Searchterm":"GeneSymbol","Searchvalue":gene_symbol})
foosoup = BS.BeautifulSoup(foo.content)
FBID = foosoup.find(id="datalist").table.tbody.tr.findAll("td")[0].a.text
bar = requests.get("http://mccb.umassmed.edu/ffs/TFdetails.php?FlybaseID=%s" % FBID)
barsoup = BS.BeautifulSoup(bar.content)
get_gene_pwm("dl")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment