npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

plate-data-transfer

v0.0.4

Published

Rearranging plate-layouts according to liquid handling steps

Downloads

10

Readme

Plate Transformer

Ideal for rearranging plate-layouts according to liquid handling steps

Are you a scientist performing HTP assays in 96-well-plates (or other sizes), and trying to track the plate-layouts in a spreadsheet to record what is in each well?

Do you then pipette the plate contents into other plates, thus mixing up the spreadsheet records? If so, you might have trouble creating the new plate-layout.

If so, PlateDataTransfer can help you out.

Code

Install

$ npm install plate-data-transfer

Basic Usage

import PlateDataTransfer from "plate-data-transfer";

let transformer = new PlateDataTransfer(
  sourceLayout,
  destinationLayout,
  transferInstructions,
  sourceInfo,
  destinationInfo
);

let newLayout = transformer.transformPlates();

Example Input Parameters

//source plate map (pipetting from)
//Plate and Well keys required
const sourceLayout = [
  { Plate: "plate1", Well: "A1", buffer: "Tris", additive: "DMSO" },
  { Plate: "plate1", Well: "A2", buffer: "Tris", additive: "Water" },
  { Plate: "plate1", Well: "A3", buffer: "Tris", additive: null },
];

//destination plate layout (pipetting into)
//Plate and Well keys required
const destinationLayout = [
  { Plate: "plate2", Well: "A1", optional: 1 },
  { Plate: "plate2", Well: "A2", optional: 3 },
  { Plate: "plate2", Well: "A3", optional: 5 },
];
// If the destination plate is initially empty, its array can contain just one entry [{Plate:"platename", Well:"A1"}]

const transferInstructions = [
  {
    "Source Plate": "plate_1",
    "Source Well": "A1",
    Volume: 1,
    "Destination Plate": "plate2",
    "Destination Well": "A3",
  },
  {
    "Source Plate": "plate_1",
    "Source Well": "A2",
    Volume: 5,
    "Destination Plate": "plate2",
    "Destination Well": "A2",
  },
  {
    "Source Plate": "plate_1",
    "Source Well": "A3",
    Volume: 10,
    "Destination Plate": "plate2",
    "Destination Well": "A1",
  },
];

const sourceInfo = {
  plate_map_id: "plate1",
  plate_instruction_id: "plate_1", //slightly different name
  plate_size: 6,
  plate_suffix: "_6wp",
};

const destinationInfo = {
  plate_map_id: "plate2",
  plate_instruction_id: "plate2",
  plate_size: 96,
  plate_suffix: "_96wp",
};

let transformer = new PlateTransofmer(
  sourceLayout,
  destinationLayout,
  transferInstructions,
  sourceInfo,
  destinationInfo
);

let newLayout = transformer.transformPlates();

// newLayout
// [
//   { Plate: "plate2", Well: "A1", volume_6wp: 10, optional: 1, buffer: "Tris", additive: null },
//   { Plate: "plate2", Well: "A2", volume_6wp: 5, optional: 3, buffer: "Tris", additive: "Water"},
//   { Plate: "plate2", Well: "A3", volume_6wp: 1, optional: 5, buffer: "Tris", additive: "DMSO" },
//   ...
// ];

SourceInfo and DestinationInfo

The source configuration object indicates what the source plate is named in in the platelayout (plate_map_id) and in the instructions (plate_instruction_id) (in case they are named differently). Plate_size attribute indicates the size of the plate (24, 96, etc). The last configuration is the prefered plate_suffix, which may or may not be used depending on the platelayouts and transfer instructions. See below for details.

Clash Options

When the source and destination's well data share a common key (aside from Plate and Well), then transfering the data from source to the destination creates a clash issue. You can configure PlateDataTransfer to accomodate the clash in several ways. You can keep the source value,keep the destination value, or concatenate both together with a chosen separator (eg: ", " or "-"). Additionally, both keys' names can be changed by adding the suffix.

Clash strategy options = "keepSource" | "keepDestination" | "concatenate" | "suffix"

If clash strategy is concatenate, then the separator option defines what character (if any) separates the two concatenated values.

Separator options = ", " | "-" | "_" | " " | " + " | ""

Clash on buffer key

Default clash strategy is "suffix"

import PlateDataTransfer from "plate-data-transfer";
asdfawef3254jnbvcqwe4rbvfvfe;
//source plate map (pipetting from)
const sourceLayout = [
  { Plate: "a", Well: "A1", buffer: "Tris" },
  { Plate: "a", Well: "A2", buffer: "Tris" },
  //...
  { Plate: "a", Well: "B3", buffer: "Tris" },
];

//destination shares 'buffer' key with source plate
const destinationLayout = [
  { Plate: "b", Well: "A1", buffer: "HEPES" },
  { Plate: "b", Well: "A2", buffer: "HEPES" },
  //...
  { Plate: "b", Well: "G12", buffer: "HEPES" },
];

let transformer = new PlateTransofmer(
  sourceLayout,
  destinationLayout,
  transferInstructions,
  sourceInfo,
  destinationInfo
);

//default clash strategy = "suffix"
let newLayout = transformer.transformPlates();
//newLayout contains {..., buffer_6wp: "Tris", buffer_96wp: "HEPES"}]

Change Clash Strategy

//change clash strategy to keep destination values
transformer.setClashStrategy("keepDestination");
let newLayout = transformer.transformPlates();
//newLayout contains {..., buffer: "HEPES"}

concatenate clash strategy

//change clash strategy to concatenate
transformer.setClashStrategy("concatenate");
transformer.setClashConcatenationSeparator(" + ");
let newLayout = transformer.transformPlates();}
//newLayout contains {..., buffer: "Tris + HEPES"}

transformer.setClashConcatenationSeparator("");
let newLayout = transformer.transformPlates();
//newLayout contains {..., buffer: "TrisHEPES"}

transformer.setClashConcatenationSeparator(", ");
let newLayout = transformer.transformPlates();
//newLayout contains {..., buffer: "Tris, HEPES"}