Module: bbcflib.daflims

The DNA Array Facility at the University of Lausanne provides all their data in a LIMS accessible from VITAL-IT. This module hides the details of fetching files from that LIMS. Files are identified by four fields:

  • The facility where they were generated (either 'lgtf' for Lausanne, or 'gva' at the University of Geneva).
  • The machine at the facility on which they were generated ('R2D2' or 'C3PO' in Lausanne, or 'HWUSI-EAS691' in Geneva).
  • The run number on that machine (an integer).
  • The lane in that run (also an integer).

Connecting to the LIMS requires a username and password, and will often only be possible from certain hosts. A connection is represented as a DAFLIMS object, which provides methods for fetching the three kinds of files stored in the LIMS:

  • fetch_fastq: The FASTQ file of all reads. You probably want this.
  • fetch_export: The output of aligning all reads against some genome with Eland, a proprietary tool from Illumina.
  • fetch_qc: pdf file of the QC.

For example, to fetch the FASTQ file of run 91, lane 3 sequenced on R2D2 in Lausanne, write:

d = DAFLIMS(username=..., password=...)
d.fetch_fastq('lgtf', 'R2D2', 91, 3, '/path/to/save/to.fastq')

The last argument works much like a target given to the Unix command cp: if it specifies a directory, the file is given a random name in that directory. If it is given a filename, the file is written to that name. If the last argument is omitted, the file is written to a random name in the current working irectory.

class bbcflib.daflims.DAFLIMS(username=None, password=None, config=None, section='daflims')[source]

Connect to the DNA Array Facility’s LIMS.

Either specify username and password, or provide a ConfigParser object to the config argument. The ConfigParser should define daflims_username and daflims_password in the sections daflims (you can override the section with the section argument). If you specify a config argument, and one or both of username and password, the latter override the ConfigParser.

fetch_fastq(facility, machine, run, lane, to=None)[source]
fetch_export(facility, machine, run, lane, to=None)[source]
fetch_qc(facility, machine, run, lane, to=None)[source]

Fetch a file from the LIMS to to.

If to is omitted, then the data is written to a randomly named file in the current working directory. If to is a directory, the data is written to a randomly named file in that directory. Otherwise to is taken as the full path to the file to write to.

The return value is a dictionary containing the following keys (all of which refer to strings unless otherwise noted.

  • 'path' (the path to the fetched file)
  • 'machine'
  • 'run' (integer)
  • 'lane' (integer)
  • 'cycle' (integer)
  • 'quantity (/pM)' (float, the concentration of DNA in picomolar)
  • 'library'
  • 'project'
  • 'protocol'
  • 'run type' ('ChipSeq', etc.)
  • 'PI firstname'
  • 'PI lastname'
  • 'submitter firstname'
  • 'submitter lastname'
  • 'organism'
  • 'NCBI ID' (the genome Eland aligns against)
class bbcflib.daflims.DAFLIMS(username=None, password=None, config=None, section='daflims')[source]

Connect to the DNA Array Facility’s LIMS.

Either specify username and password, or provide a ConfigParser object to the config argument. The ConfigParser should define daflims_username and daflims_password in the sections daflims (you can override the section with the section argument). If you specify a config argument, and one or both of username and password, the latter override the ConfigParser.

fetch_fastq(facility, machine, run, lane, to=None)[source]
fetch_export(facility, machine, run, lane, to=None)[source]
fetch_qc(facility, machine, run, lane, to=None)[source]

Fetch a file from the LIMS to to.

If to is omitted, then the data is written to a randomly named file in the current working directory. If to is a directory, the data is written to a randomly named file in that directory. Otherwise to is taken as the full path to the file to write to.

The return value is a dictionary containing the following keys (all of which refer to strings unless otherwise noted.

  • 'path' (the path to the fetched file)
  • 'machine'
  • 'run' (integer)
  • 'lane' (integer)
  • 'cycle' (integer)
  • 'quantity (/pM)' (float, the concentration of DNA in picomolar)
  • 'library'
  • 'project'
  • 'protocol'
  • 'run type' ('ChipSeq', etc.)
  • 'PI firstname'
  • 'PI lastname'
  • 'submitter firstname'
  • 'submitter lastname'
  • 'organism'
  • 'NCBI ID' (the genome Eland aligns against)
fetch_export(facility, machine, run, lane, to=None)[source]

Fetch a file from the LIMS to to.

If to is omitted, then the data is written to a randomly named file in the current working directory. If to is a directory, the data is written to a randomly named file in that directory. Otherwise to is taken as the full path to the file to write to.

The return value is a dictionary containing the following keys (all of which refer to strings unless otherwise noted.

  • 'path' (the path to the fetched file)
  • 'machine'
  • 'run' (integer)
  • 'lane' (integer)
  • 'cycle' (integer)
  • 'quantity (/pM)' (float, the concentration of DNA in picomolar)
  • 'library'
  • 'project'
  • 'protocol'
  • 'run type' ('ChipSeq', etc.)
  • 'PI firstname'
  • 'PI lastname'
  • 'submitter firstname'
  • 'submitter lastname'
  • 'organism'
  • 'NCBI ID' (the genome Eland aligns against)
fetch_fastq(facility, machine, run, lane, to=None, libname=None)[source]

Fetch a file from the LIMS to to.

If to is omitted, then the data is written to a randomly named file in the current working directory. If to is a directory, the data is written to a randomly named file in that directory. Otherwise to is taken as the full path to the file to write to.

The return value is a dictionary containing the following keys (all of which refer to strings unless otherwise noted.

  • 'path' (the path to the fetched file)
  • 'machine'
  • 'run' (integer)
  • 'lane' (integer)
  • 'cycle' (integer)
  • 'quantity (/pM)' (float, the concentration of DNA in picomolar)
  • 'library'
  • 'project'
  • 'protocol'
  • 'run type' ('ChipSeq', etc.)
  • 'PI firstname'
  • 'PI lastname'
  • 'submitter firstname'
  • 'submitter lastname'
  • 'organism'
  • 'NCBI ID' (the genome Eland aligns against)
fetch_qc(facility, machine, run, lane, to=None)[source]

Fetch a file from the LIMS to to.

If to is omitted, then the data is written to a randomly named file in the current working directory. If to is a directory, the data is written to a randomly named file in that directory. Otherwise to is taken as the full path to the file to write to.

The return value is a dictionary containing the following keys (all of which refer to strings unless otherwise noted.

  • 'path' (the path to the fetched file)
  • 'machine'
  • 'run' (integer)
  • 'lane' (integer)
  • 'cycle' (integer)
  • 'quantity (/pM)' (float, the concentration of DNA in picomolar)
  • 'library'
  • 'project'
  • 'protocol'
  • 'run type' ('ChipSeq', etc.)
  • 'PI firstname'
  • 'PI lastname'
  • 'submitter firstname'
  • 'submitter lastname'
  • 'organism'
  • 'NCBI ID' (the genome Eland aligns against)

Previous topic

Module: bbcflib.common

Next topic

<no title>

This Page

Websites