eu_add_controlled_by

Sets the File.controlled_by property for all FASTQ File records on an Experiment.

An experiment can have multiple controls. This script will only work if:

  1. The Experiment.possible_controls is already set, and
  2. If more than one control, all controls have the same number of biologoical replicates, and
  3. The number of biological replicates on the Experiment is the same as the number of biological replicates for any given control.

Having varying number of technical replicates is fine.

These requiements are set in order to have some meaningful, automated way of assigning control FASTQ files to experimental FASTQ files.

The algorithm works as follows:

  1. The biological replicate numbers on the experiment are stored in a list, and ordered from least to greatest.
  2. The biological replicate numbers on each control are stored in a list, and ordered from least to greatest.
  3. Biological Replicate Assignment: For each control, its biological replicate number list created in step 2 is superimposed onto the list created in step 1. Assignment then takes place by positional matching. The matching is positional instead of simply by biological replicate number itself, since the numbering is known in some cases to not alwasy be sequential starting from 1.
  4. Setting possible_controls: For each replicate in the Experiment, the forward reads FASTQ file linked to that replicate is assigned to the forward reads control FASTQ files. The control FASTQs are determined from the superimposition step above. For each control, all replicates that have the same biologican_replicate_number are included. If the sequencing is paired-end, then the same type of assignment happens for the reverse reads files.

usage: eu_add_controlled_by.py [-h] [-m DCC_MODE] -e EXP_ID

Named Arguments

-m, --dcc-mode
The ENCODE Portal site (‘prod’ or ‘dev’, or an explicit host name, i.e. ‘demo.encodedcc.org’) to connect to.
-e, --exp-id
An identifier of an Experiment record whose FASTQ File objects need to have their controlled_by property set.