Exemplo n.º 1
0
def flowcell_samples(
    lims: Lims, flowcell_id: str, bcl_converter: str
) -> Iterable[Union[LimsFlowcellSampleBcl2Fastq, LimsFlowcellSampleDragen]]:
    lims_flowcell_sample = {
        "bcl2fastq": LimsFlowcellSampleBcl2Fastq,
        "dragen": LimsFlowcellSampleDragen,
    }
    LOG.info("Fetching samples from lims for flowcell %s", flowcell_id)
    containers: List[Container] = lims.get_containers(name=flowcell_id)
    if not containers:
        return []
    container: Container = containers[-1]  # only take the last one. See ÖA#217.
    raw_lanes: List[str] = sorted(container.placements.keys())
    for raw_lane in raw_lanes:
        lane: int = get_placement_lane(raw_lane)
        placement_artifact: Artifact = container.placements[raw_lane]
        non_pooled_artifacts: List[Artifact] = get_non_pooled_artifacts(placement_artifact)
        for artifact in non_pooled_artifacts:
            sample: Sample = artifact.samples[0]  # we are assured it only has one sample
            label: Optional[str] = get_reagent_label(artifact)
            index = get_index(lims=lims, label=label)
            yield lims_flowcell_sample[bcl_converter](
                flowcell_id=flowcell_id,
                lane=lane,
                sample_id=sample.id,
                index=index,
                sample_name=sample.name,
                project=sample.project.name,
            )
def main(args):
    lims = Lims(BASEURI, USERNAME, PASSWORD)
    conts = lims.get_containers(name=args.flowcell)
    print "found {} containers with name {}".format(len(conts), args.flowcell)
    for cont in conts:
        if cont.type.name not in args.types:
            print "Container {} is a {} and will be renamed".format(cont.id, cont.type.name)
            cont.name = args.name
            cont.put()
        else:
            print "Container {} is a {} and will NOT be renamed".format(cont.id, cont.type.name)
Exemplo n.º 3
0
def main(args):
    lims = Lims(BASEURI, USERNAME, PASSWORD)
    conts = lims.get_containers(name=args.flowcell)
    print "found {} containers with name {}".format(len(conts), args.flowcell)
    for cont in conts:
        if cont.type.name not in args.types:
            print "Container {} is a {} and will be renamed".format(
                cont.id, cont.type.name)
            cont.name = args.name
            cont.put()
        else:
            print "Container {} is a {} and will NOT be renamed".format(
                cont.id, cont.type.name)
"""

import codecs

from genologics.lims import Lims

# Login parameters for connecting to a LIMS instance.
# NOTE: Modify according to your setup.
from genologics.site_cloud import BASEURI, USERNAME, PASSWORD

# Create the LIMS interface instance, and check the connection and version.
lims = Lims(BASEURI, USERNAME, PASSWORD)
lims.check_version()

# Get the list of all containers.
containers = lims.get_containers()
print len(containers), 'containers in total'

for state in ['Empty', 'Reagent-Only', 'Discarded', 'Populated']:
    containers = lims.get_containers(state=state)
    print len(containers), state, 'containers'

containers = lims.get_containers(type='96 well plate')
print len(containers)

container = containers[2]
print container, container.occupied_wells

placements = container.get_placements()
for location, artifact in placements.iteritems():
    print location, artifact.name