Package: icebreaker
IceBreakerIcebreaker provides a Python interface for theJBEI ICE sample manager.See the full API documentationhereInstallationIcebreaker is written for Python 3+. You can install icebreaker via PIP:sudo pip install icebreakerAlternatively, you can unzip the sources in a folder and typesudo python setup.py installExample of useIn this example we assume that we are a lab who wants to find primers from its
database to sequence a given construct. We will (1) pull all our primers from
ICE, (2) find which primers are adapted to our sequence, using thePrimavera package, and
(3) we will ask ICE for the location of the selected primers.Connexion to an ICE instanceYou can connecct to your ICE instance using either an API token (see below
for how to create a token), or an email/password authentication.importicebreaker# CONNECT TO ICEconfiguration=dict(root="https://my.ice.instance.org",token="WMnlYlWHz+BC+7eFV=...",client="icebot")ice=icebreaker.IceClient(configuration)Or:# CONNECT TO ICEconfiguration=dict(root="https://my.ice.instance.org",email="michael.swann@genomefoundry.org",password="ic3ic3baby")ice=icebreaker.IceClient(configuration)The configuration can also be written in a yaml file so you can writeIceClient('config.yml')whereconfig.ymlreads as follows:root:https://my.ice.instance.orgemail:michael.swann@genomefoundry.orgpassword:ic3ic3babyExtracting all records from a folderNext we pull all primers in the database:# FIND THE ID OF THE FOLDER WITH ALL PRIMERSprimers_folder=ice.get_folder_id("PRIMERS",collection="SHARED")# GET INFOS ON ALL ENTRIES IN THE FOLDER (PRIMER NAME, ID, CREATOR...)primers_entries=ice.get_folder_entries(primers_folder)# GET A BIOPYTHON RECORD FOR EACH PRIMERprimers_records={primer["id"]:ice.get_record(primer["id"])forprimerinprimers_entries}Primer selection with PrimaveraNext provide this information to Primavera and select some primers (see thePrimavera docs):fromprimaveraimportPrimerSelector,Primer,load_recordavailable_primers=[Primer(sequence=primers_records[entry['id']].seq.tostring(),name=entry['name'],metadata=dict(ice_id=entry['id']))forentryinprimers_entries]constructs=[load_record("RTM3_39.gb",linear=False)]selector=PrimerSelector(read_range=(150,1000),tm_range=(55,70),size_range=(16,25),coverage_resolution=10,primer_reuse_bonus=200)selected_primers=selector.select_primers(constructs,available_primers)Finding available samplesFinally we look for available samples for each primer:selected_primers=set(sum(selected_primers,[]))forprimerinselected_primers:ice_id=primer.metadata.get("ice_id",None)ifice_idisnotNone:samples=ice.get_samples(ice_id)iflen(samples)>0:location=icebreaker.sample_location_string(samples[0])print("Primer%sis in%s."%(primer.name,location))Result:PrimerPRV_EMMA_IN00042isinPRIMER_PLATE_1/E06.PrimerPRV_EMMA_IN00043isinPRIMER_PLATE_1/F06.PrimerPRV_EMMA_IN00028isinPRIMER_PLATE_1/G04.PrimerPRV_EMMA_IN00060isinPRIMER_PLATE_1/G08.PrimerPRV_EMMA_IN00064isinPRIMER_PLATE_1/C09.PrimerPRV_EMMA_IN00038isinPRIMER_PLATE_1/A06.PrimerPRV_EMMA_IN00068isinPRIMER_PLATE_1/G09.Getting an ICE tokenThere are several ways to get ICE tokens. We suggest you create one throug
the web interface as follows (see screenshot for indications):Create an account with administrator rightsGo to the administrator panelClick on “API keys”Click on “create new”. Note everything down !License = MITIcebreaker is an open-source software originally written at the Edinburgh
Genome Foundry byZulkoandreleased on
Githubunder
the MIT licence (Copyright Edinburg Genome Foundry). Everyone is welcome to
contribute !More biology softwareIcebreaker is part of theEGF Codonssynthetic biology software suite for DNA design, manufacturing and validation.