示例#1
0
    from omero.gateway import BlitzGateway
    from Parse_OMERO_Properties import USERNAME, PASSWORD, HOST, PORT
    print(HOST)
    conn = BlitzGateway(USERNAME, PASSWORD, host=HOST, port=PORT)
    conn.connect()
    
    user = conn.getUser()
    print "Current user:"******"   ID:", user.getId()
    print "   Username:"******"   Full Name:", user.getFullName()

    if( args.group is not None ):
        print("change group")
        new_group = args.group
        groups = [ g.getName() for g in conn.listGroups() ]
        print(groups)
        if( new_group not in groups ):
            print("{} not found in groups:".format(new_group))
            for gn in groups:
                print("    {}".format(gn))
            sys.exit(1)
        else:
            conn.setGroupNameForSession(group)
    print conn.getGroupFromContext().getName()
    path    = os.getcwd()

    mdict= setup_dict()

    def package_file( mdict,conn, group, Id, path, name ):
        print "processing {} {} as : {}/{}".format(group,Id,path,name)
示例#2
0
password = getpass.getpass()

# Connect to the Python Blitz Gateway.
conn = BlitzGateway(username, password, host=HOST, port=PORT)
connected = conn.connect()
if not connected:
    print >> sys.stderr, ("Error: Connection not available, please check your " "username and password.")
    sys.exit(1)
else:
    print "Login successful.\n"

# Set our default group so we can see the data.
# (I thought I had to do this, but now I am not sure it's needed.
# -JLM 2013/12/04)
try:
    group = next(g for g in conn.listGroups() if g.getName() == GROUP)
except StopIteration:
    print >> sys.stderr, "Error: could not find group '%s'" % GROUP
conn.setGroupForSession(group.getId())

# Get plate of interest.
# (ID 1552 is "RTK ligands induce differing FOXO3a translocation dynamics")
plate = conn.getObject("Plate", 1552)
# Get list of lists of well objects from the plate.
well_grid = plate.getWellGrid()

# Loop over all wells in the plate.
for (raw_row_num, row) in enumerate(well_grid):
    for (raw_col_num, well) in enumerate(row):
        # Fix up row and column numbers to match Pat's nomenclature.
        row_num = raw_row_num + 1
示例#3
0
# Connect to the Python Blitz Gateway.
conn = BlitzGateway(username, password, host=HOST, port=PORT)
connected = conn.connect()
if not connected:
    print >> sys.stderr, ("Error: Connection not available, please check your "
                          "username and password.")
    sys.exit(1)
else:
    print "Login successful.\n"

# Set our default group so we can see the data.
# (I thought I had to do this, but now I am not sure it's needed.
# -JLM 2013/12/04)
try:
    group = next(g for g in conn.listGroups() if g.getName() == GROUP)
except StopIteration:
    print >> sys.stderr, "Error: could not find group '%s'" % GROUP
conn.setGroupForSession(group.getId())

# Get plate of interest.
# (ID 1552 is "RTK ligands induce differing FOXO3a translocation dynamics")
plate = conn.getObject('Plate', 1552)
# Get list of lists of well objects from the plate.
well_grid = plate.getWellGrid()

# Loop over all wells in the plate.
for (raw_row_num, row) in enumerate(well_grid):
    for (raw_col_num, well) in enumerate(row):
        # Fix up row and column numbers to match Pat's nomenclature.
        row_num = raw_row_num + 1