league_code = query.make_league_code(i['gameid'], i['leagueid'])
    league_url = query.league_data(league_code)
    l = auth.api_query(y, league_url)

    #grab relevant part of dict
    this_league = l['fantasy_content']['league']
    leagues.append(this_league)

    player_dict={}

    # Get All Taken Players
    loopcount=0
    while(True):
       # 2 Gets: first = 1 for seas+pct
       #         secnd = 2 for lastmonth 
       GET1 = auth.api_query(y, query.getdata(league_url,loopcount,1,status="T"))
       GET2 = auth.api_query(y, query.getdata(league_url,loopcount,2,status="T"))
       num_players_returned = int(GET1['fantasy_content']['league']['players']['@count'])

       # Relevent part of get
       GET_SEA = GET1['fantasy_content']['league']['players']['player']
       GET_LM  = GET2['fantasy_content']['league']['players']['player']

       for count in range(0,num_players_returned):
          # Create player 'object' using player information (name, etc) from one of the gets
          # createplayer( x, True) --- True = Taken/NonFreeAgent
          new_player = query.createplayer(GET_SEA[count], True)

          # Update new player with Season Stats from get
          # Update new player with LMonth Stats from get
          # Add new player to player dictionary
Example #2
0
import os
from query import consistency
from query import getdata
# from query import queryrna
# queryrna()

orig_pdb  = int(os.system("ls data/Pdb/ | wc -l"))
rna_pdb   = int(os.system("ls data/OnlyNA/ | wc -l"))
inp_pdb   = int(os.system("ls data/Inp/ | wc -l"))
rel_date  = int(os.system("grep \"REVDAT\" data/Pdb/*.pdb | awk '{ if ($5 ~ /^0/) print $0}' | wc -l"))

consistency(orig_pdb,rna_pdb,inp_pdb)

# Uncomment to check that the release dates match
# consistency(orig_pdb,rna_pdb,rel_date)

getdata()
Example #3
0
print "total number of pdb files = %d" % int(orig_pdb)
rna_pdb = subprocess.check_output('ls data/OnlyNA/ | wc -l', shell=True)
print "rna pdbs = %d" % int(rna_pdb)
inp_pdb = subprocess.check_output('ls data/Inp/ | wc -l', shell=True)
print "inp pdbs = %d" % int(inp_pdb)
query.consistency(orig_pdb, rna_pdb, inp_pdb)

# query.makedirs()

# query.download()

query.analysis()

query.helices()

query.getdata()

#####################################################################
# -4-
# Plot number of bases vs. year
# This module automatically generates plots after subsetting the
# relevant information.
# The aim is to produce plots like the ones in Figure 2.1 (page 22 )
# of the authors thesis which were created in a more manual,
# non-fully automated fashion.
#####################################################################

# import graphs
# graphs.Plots.plot()
# graphs.Plots.hel_stats()
# graphs.Plots.rnadimerplot()