Basic data normalizer for ProtocolIO

This commit is contained in:
Urban Rotnik 2019-05-16 15:55:04 +02:00
parent ec49388283
commit aadf2eecb4
6 changed files with 5419 additions and 1 deletions

View file

@ -0,0 +1,55 @@
# frozen_string_literal: true
module ProtocolImporters
module ProtocolsIO
module V3
class ProtocolNormalizer < ProtocolImporters::ProtocolNormalizer
def load_protocol(id:)
response = ProtocolImporters::ProtocolsIO::V3::ApiClient.new.single_protocol(id)
normalized_hash = normalize(response)
normalized_hash
end
private
def normalize(response)
protocol_hash = response.parsed_response.with_indifferent_access[:protocol]
normalized_data = {}
normalized_data[:uri] = response.request.last_uri.to_s
normalized_data[:source] = Constants::PROTOCOLS_IO_V3_API[:source_id]
normalized_data[:doi] = protocol_hash[:doi]
normalized_data[:published_on] = protocol_hash[:published_on]
normalized_data[:version] = protocol_hash[:version_id]
normalized_data[:source_id] = protocol_hash[:id]
normalized_data[:name] = protocol_hash[:title]
normalized_data[:description] = protocol_hash[:description]
normalized_data[:authors] = protocol_hash[:authors].map { |e| e[:name] }.join(', ')
normalized_data[:steps] = protocol_hash[:steps].map do |e|
{
source_id: e[:id],
name: StepComponents.name(e[:components]),
description: StepComponents.description(e[:components]),
position: e[:previous_id].nil? ? 0 : nil
}
end
# set positions
first_step_id = normalized_data[:steps].find { |s| s[:position].zero? }[:source_id]
next_step_id = protocol_hash[:steps].find { |s| s[:previous_id] == first_step_id }.try(:[], :id)
steps = normalized_data[:steps].map { |s| [s[:source_id], s] }.to_h
original_order = protocol_hash[:steps].map { |m| [m[:previous_id], m[:id]] }.to_h
current_position = 0
while next_step_id
current_position += 1
steps[next_step_id][:position] = current_position
next_step_id = original_order[next_step_id]
end
{ protocol: normalized_data }
end
end
end
end
end

View file

@ -0,0 +1,30 @@
# frozen_string_literal: true
module ProtocolImporters
module ProtocolsIO
module V3
class StepComponents
AVAILABLE_COMPONENTS = {
6 => :title,
1 => :description
}.freeze
def self.get_component(id, components)
if AVAILABLE_COMPONENTS.include?(id)
components.find { |o| o[:type_id] == id }
else
raise ArgumentError
end
end
def self.name(components)
get_component(6, components)[:source][:title]
end
def self.description(components)
get_component(1, components)[:source][:description]
end
end
end
end
end

View file

@ -208,7 +208,8 @@ class Constants
page_id: 1
}
}
}
},
source_id: 'protocolsio/v3'
}.freeze
#=============================================================================

View file

@ -0,0 +1,411 @@
{
"protocol": {
"uri": "https://www.protocols.io/api/v3/protocols/9451",
"source": "protocolsio/v3",
"doi": "dx.doi.org/10.17504/protocols.io.mgjc3un",
"published_on": 1516132805,
"version": 0,
"source_id": 9451,
"name": "CUT\u0026RUN: Targeted in situ genome-wide profiling with high efficiency for low cell numbers",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eCleavage Under Targets and Release Using Nuclease (CUT\u0026RUN) is an epigenomic profiling strategy in which antibody-targeted controlled cleavage by micrococcal nuclease releases specific protein-DNA complexes into the supernatant for paired-end DNA sequencing. As only the targeted fragments enter into solution, and the vast majority of DNA is left behind, CUT\u0026RUN has exceptionally low background levels. CUT\u0026RUN outperforms the most widely used Chromatin Immunoprecipitation (ChIP) protocols in resolution, signal-to-noise, and depth of sequencing required. In contrast to ChIP, CUT\u0026RUN is free of solubility and DNA accessibility artifacts and can be used to profile insoluble chromatin and to detect long-range 3D contacts without cross-linking. Here we present an improved CUT\u0026RUN protocol that does not require isolation of nuclei and provides high-quality data starting with only 100 cells for a histone modification and 1000 cells for a transcription factor. From cells to purified DNA CUT\u0026RUN requires less than a day at the lab bench.\u003c/div\u003e\u003cdiv class = \"text-block\"\u003eIn summary, CUT\u0026RUN has several advantages over ChIP-seq: (1) The method is performed in situ in non-crosslinked cells and does not require chromatin fragmentation or solubilization; (2) The intrinsically low background allows low sequence depth and identification of low signal genomic features invisible to ChIP; (3) The simple procedure can be completed within a day and is suitable for robotic automation; (4) The method can be used with low cell numbers compared to existing methodologies; (5) A simple spike-in strategy can be used for accurate quantitation of protein-DNA interactions. As such, CUT\u0026RUN represents an attractive replacement for ChIPseq, which is one of the most popular methods in biological research.\u003c/div\u003e\u003c/div\u003e",
"authors": "Peter J. Skene, Steven Henikoff",
"steps": [
{
"source_id": 601564,
"name": "Binding cells to beads",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003e\u003cspan style = \":justify;\"\u003eHarvest fresh culture(s) at room temperature and count cells. The same protocol can be used for 100 to 250,000 mammalian cells per sample and/or digestion time point.\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e",
"position": 0
},
{
"source_id": 601565,
"name": "Binding cells to beads",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eCentrifuge 3 min 600 x g at room temperature and withdraw liquid.\u003c/div\u003e\u003c/div\u003e",
"position": 1
},
{
"source_id": 601566,
"name": "Binding cells to beads",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003e\u003cspan style = \":justify;\"\u003eResuspend in 1.5 ml room temperature Wash buffer by gently pipetting and transfer if necessary to a 2 ml tube. (wash 1/2)\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e",
"position": 2
},
{
"source_id": 601567,
"name": "Binding cells to beads",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eCentrifuge 3 min 600 x g at room temperature and withdraw liquid. (wash 1/2)\u003c/div\u003e\u003c/div\u003e",
"position": 3
},
{
"source_id": 601568,
"name": "Binding cells to beads",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003e\u003cspan style = \":justify;\"\u003eAgain, resuspend in 1.5 ml room temperature Wash buffer by gently pipetting. Centrifuge 3 min 600 x g at room temperature and withdraw liquid. (wash 2/2)\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e",
"position": 4
},
{
"source_id": 601569,
"name": "Binding cells to beads",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eResuspend in 1 ml room temperature Wash buffer by gently pipetting.\u003c/div\u003e\u003c/div\u003e",
"position": 5
},
{
"source_id": 601570,
"name": "Binding cells to beads",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eWhile gently vortexing the cells at room temperature, add the bead slurry.\u003c/div\u003e\u003c/div\u003e",
"position": 6
},
{
"source_id": 601571,
"name": "Binding cells to beads",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eRotate 5-10 min at room temperature.\u003c/div\u003e\u003c/div\u003e",
"position": 7
},
{
"source_id": 601572,
"name": "Binding cells to beads",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eDivide into aliquots in 1.5-ml tubes, one for each antibody to be used.\u003c/div\u003e\u003c/div\u003e",
"position": 8
},
{
"source_id": 601573,
"name": "Bind (primary) antibodies",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003ePlace on the magnet stand to clear and pull off the liquid.\u003c/div\u003e\u003c/div\u003e",
"position": 9
},
{
"source_id": 601574,
"name": "Bind (primary) antibodies",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003e\u003cspan style = \":justify;\"\u003ePlace each tube at a low angle on the vortex mixer set to low (~1100 rpm) and squirt 50 μL of the Antibody buffer (per sample and/or digestion time point) along the side while gently vortexing to allow the solution to dislodge most or all of the beads. Tap to dislodge the remaining beads.\u003c/span\u003e\u003cspan style = \":justify;\"\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e",
"position": 10
},
{
"source_id": 601575,
"name": "Bind (primary) antibodies",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003ePlace on the tube rotator at 4°C for ~2 hr (or at room temperature for 5-10 min)\u003c/div\u003e\u003c/div\u003e",
"position": 11
},
{
"source_id": 601576,
"name": "Bind (primary) antibodies",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eRemove liquid from the cap and side with a quick pulse on a micro-centrifuge.\u003c/div\u003e\u003c/div\u003e",
"position": 12
},
{
"source_id": 601577,
"name": "Bind (primary) antibodies",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003ePlace on the magnet stand to clear (~30 s) and pull off all of the liquid.\u003c/div\u003e\u003c/div\u003e",
"position": 13
},
{
"source_id": 601578,
"name": "Bind (primary) antibodies",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003e\u003cspan style = \":justify;\"\u003eAdd 1 ml Dig-wash buffer, mix by inversion, or by gentle pipetting using a 1 ml tip if clumps persist, and remove liquid from the cap and side with a quick pulse on a micro-centrifuge.\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e",
"position": 14
},
{
"source_id": 601579,
"name": "Bind secondary antibody (as required)",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003ePlace on the magnet stand to clear and pull off all of the liquid.\u003c/div\u003e\u003c/div\u003e",
"position": 15
},
{
"source_id": 601580,
"name": "Bind secondary antibody (as required)",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003e\u003cspan style = \":justify;\"\u003ePlace each tube at a low angle on the vortex mixer set to low (~1100 rpm) and squirt 50 μL of the Dig-wash buffer (per sample and/or digestion time point) along the side while gently vortexing to allow the solution to dislodge most or all of the beads. Tap to dislodge the remaining beads.\u003c/span\u003e\u003cspan style = \":justify;\"\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e",
"position": 16
},
{
"source_id": 601581,
"name": "Bind secondary antibody (as required)",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003e\u003cspan style = \":justify;\"\u003eMix in the secondary antibody to a final concentration of 1:100 or to the manufacturers recommended concentration for immunofluorescence.\u003c/span\u003e\u003cspan\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e",
"position": 17
},
{
"source_id": 601582,
"name": "Bind secondary antibody (as required)",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003ePlace on the tube rotator at 4 °C for ~1 hr (or at room temperature for 5-10 min).\u003c/div\u003e\u003c/div\u003e",
"position": 18
},
{
"source_id": 601583,
"name": "Bind secondary antibody (as required)",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eRemove liquid from the cap and side with a quick pulse on a micro-centrifuge.\u003c/div\u003e\u003c/div\u003e",
"position": 19
},
{
"source_id": 601584,
"name": "Bind secondary antibody (as required)",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003ePlace on the magnet stand to clear and pull off all of the liquid.\u003c/div\u003e\u003c/div\u003e",
"position": 20
},
{
"source_id": 601585,
"name": "Bind secondary antibody (as required)",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003e\u003cspan style = \":justify;\"\u003eAdd 1 ml Dig-Wash buffer, mix by inversion, or by gentle pipetting if clumps persist, and remove liquid from the cap and side with a quick pulse on a micro-centrifuge.\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e",
"position": 21
},
{
"source_id": 601586,
"name": "Bind Protein A-MNase fusion protein",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003ePlace on the magnet stand to clear and pull off all of the liquid.\u003c/div\u003e\u003c/div\u003e",
"position": 22
},
{
"source_id": 601587,
"name": "Bind Protein A-MNase fusion protein",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003e\u003cspan style = \":justify;\"\u003ePlace each tube at a low angle on the vortex mixer set to low (~1100 rpm) and squirt 50 μL of the Dig-wash buffer (per sample and/or digestion time point) along the side while gently vortexing to allow the solution to dislodge most or all of the beads. Tap to dislodge the remaining beads.\u003c/span\u003e\u003cspan style = \":justify;\"\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e",
"position": 23
},
{
"source_id": 601588,
"name": "Bind Protein A-MNase fusion protein",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003e\u003cspan style = \":justify;\"\u003eMix in the pA-MNase to a final concentration of ~700 ng/ml (e.g. 2.5 μL/50 μL of a 1:10 dilution of the 140 μg/ml glycerol stock provided upon request).\u003c/span\u003e\u003cspan\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e",
"position": 24
},
{
"source_id": 601589,
"name": "Bind Protein A-MNase fusion protein",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003ePlace on the tube rotator at 4 °C for ~1 hr (or at room temperature for 5-10 min).\u003c/div\u003e\u003c/div\u003e",
"position": 25
},
{
"source_id": 601590,
"name": "Bind Protein A-MNase fusion protein",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eRemove liquid from the cap and side with a quick pulse on a micro-centrifuge.\u003c/div\u003e\u003c/div\u003e",
"position": 26
},
{
"source_id": 601591,
"name": "Bind Protein A-MNase fusion protein",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003ePlace on the magnet stand to clear and pull off all of the liquid.\u003c/div\u003e\u003c/div\u003e",
"position": 27
},
{
"source_id": 601592,
"name": "Bind Protein A-MNase fusion protein",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003e\u003cspan style = \":justify;\"\u003eAdd 1 ml Dig-wash buffer, mix by inversion, or by gentle pipetting if clumps persist, and remove liquid from the cap and side with a quick pulse on a micro-centrifuge.\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e",
"position": 28
},
{
"source_id": 601593,
"name": "Bind Protein A-MNase fusion protein",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eRepeat Dig-wash steps 28-29.\u003c/div\u003e\u003c/div\u003e",
"position": 29
},
{
"source_id": 601594,
"name": "Targeted digestion",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003ePlace on the magnet stand to clear and pull off all of the liquid.\u003c/div\u003e\u003c/div\u003e",
"position": 30
},
{
"source_id": 601595,
"name": "Targeted digestion",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003e\u003cspan style = \":justify;\"\u003ePlace each tube at a low angle on the vortex mixer set to low (~1100 rpm) and add 100 μL of the Dig-wash buffer (per sample and/or digestion time point) along the side while gently vortexing to allow the solution to dislodge most or all of the beads. Tap to dislodge the remaining beads.\u003c/span\u003e\u003cspan style = \":justify;\"\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e",
"position": 31
},
{
"source_id": 601596,
"name": "Targeted digestion",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eInsert tubes into the 1.5 ml wells of a heater block sitting in wet ice to chill down to 0 °C.\u003c/div\u003e\u003c/div\u003e",
"position": 32
},
{
"source_id": 601597,
"name": "Targeted digestion",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003e\u003cspan style = \":justify;\"\u003eRemove each tube from the block, mix in 2 μL 100 mM CaCl\u003c/span\u003e\u003cspan style = \":justify;vertical-align:sub;\"\u003e2\u003c/span\u003e\u003cspan style = \":justify;\"\u003e (diluted 1:10 from a 1 M stock) with gentle vortexing and immediately replace the tube in the 0 °C block.\u003c/span\u003e\u003cspan\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e",
"position": 33
},
{
"source_id": 601598,
"name": "Targeted digestion",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eIncubate at 0 °C for the desired digestion time (default is 30 min).\u003c/div\u003e\u003c/div\u003e",
"position": 34
},
{
"source_id": 601599,
"name": "Targeted digestion",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003e\u003cspan style = \":justify;\"\u003eAdd 100 μL 2XSTOP and mix by gentle vortexing. When there are multiple time points, remove 100 μL to 100 μL 2XSTOP and mix by gentle vortexing.\u003c/span\u003e\u003cspan\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e",
"position": 35
},
{
"source_id": 601600,
"name": "Target chromatin release",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eIncubate 10 min 37 °C to release CUT\u0026RUN fragments from the insoluble nuclear chromatin.\u003c/div\u003e\u003c/div\u003e",
"position": 36
},
{
"source_id": 601601,
"name": "Target chromatin release",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eCentrifuge 5 min at 4 °C and 16,000 x g and place on magnet stand.\u003c/div\u003e\u003c/div\u003e",
"position": 37
},
{
"source_id": 601602,
"name": "Option A: Fast DNA extraction by spin column",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003ePlace a spin column into a collection tube and add 400 μL Buffer NT1 (from NucleoSpin kit or equivalent).\u003c/div\u003e\u003c/div\u003e",
"position": 38
},
{
"source_id": 601603,
"name": "Option A: Fast DNA extraction by spin column",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003e\u003cspan style = \":justify;\"\u003eDecant the supernatant cleanly from the pellet and transfer to the NT1 in the spin column pipetting gently up and down to mix.\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e",
"position": 39
},
{
"source_id": 601604,
"name": "Option A: Fast DNA extraction by spin column",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eCentrifuge 30 s at 11,000 x g. Discard flow-through.\u003c/div\u003e\u003c/div\u003e",
"position": 40
},
{
"source_id": 601605,
"name": "Option A: Fast DNA extraction by spin column",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eAdd 700 μL Buffer NT3. Centrifuge 30 s at 11,000 x g. Discard flow-through.\u003c/div\u003e\u003c/div\u003e",
"position": 41
},
{
"source_id": 601606,
"name": "Option A: Fast DNA extraction by spin column",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eAdd 700 μL Buffer NT3. Centrifuge 30 s at 11,000 x g. Discard flow-through and replace in rotor.\u003c/div\u003e\u003c/div\u003e",
"position": 42
},
{
"source_id": 601607,
"name": "Option A: Fast DNA extraction by spin column",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eCentrifuge for 1 min at 11,000 x g. Let dry 5 min.\u003c/div\u003e\u003c/div\u003e",
"position": 43
},
{
"source_id": 601608,
"name": "Option A: Fast DNA extraction by spin column",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003ePlace in a fresh tube and add 20-40 μL Buffer NE to membrane.\u003c/div\u003e\u003c/div\u003e",
"position": 44
},
{
"source_id": 601609,
"name": "Option A: Fast DNA extraction by spin column",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eAfter 1 min, centrifuge for 1 min at 11,000 x g.\u003c/div\u003e\u003c/div\u003e",
"position": 45
},
{
"source_id": 601610,
"name": "Option B: Alternate DNA extraction (preferred for quantitative recovery of ≤80 bp fragments)",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eDecant the supernatant cleanly from the pellet and transfer to a fresh 1.5-ml microcentrifuge tube.\u003c/div\u003e\u003c/div\u003e",
"position": 46
},
{
"source_id": 601611,
"name": "Option B: Alternate DNA extraction (preferred for quantitative recovery of ≤80 bp fragments)",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003e\u003cspan style = \":justify;\"\u003eTo each sample add 2 μL 10% SDS (to 0.1%), and 2.5 μL Proteinase K (20 mg/ml). Mix by inversion and incubate 10 min 70 °C.\u003c/span\u003e\u003cspan\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e",
"position": 47
},
{
"source_id": 601612,
"name": "Option B: Alternate DNA extraction (preferred for quantitative recovery of ≤80 bp fragments)",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eAdd 300 μL PCI and mix by full-speed vortexing ~2 s.\u003c/div\u003e\u003c/div\u003e",
"position": 48
},
{
"source_id": 601613,
"name": "Option B: Alternate DNA extraction (preferred for quantitative recovery of ≤80 bp fragments)",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eTransfer to a phase-lock tube (e.g., Qiagen MaXtract), and centrifuge 5 min room temperature at 16,000 x g.\u003c/div\u003e\u003c/div\u003e",
"position": 49
},
{
"source_id": 601614,
"name": "Option B: Alternate DNA extraction (preferred for quantitative recovery of ≤80 bp fragments)",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eAdd 300 μL chloroform and invert ~10x to mix.\u003c/div\u003e\u003c/div\u003e",
"position": 50
},
{
"source_id": 601615,
"name": "Option B: Alternate DNA extraction (preferred for quantitative recovery of ≤80 bp fragments)",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eRemove liquid by pipetting to a fresh tube containing 2 μL 2 mg/ml glycogen.\u003c/div\u003e\u003c/div\u003e",
"position": 51
},
{
"source_id": 601616,
"name": "Option B: Alternate DNA extraction (preferred for quantitative recovery of ≤80 bp fragments)",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eAdd 750 μL 100% ethanol and mix by vortexing or tube inversion.\u003c/div\u003e\u003c/div\u003e",
"position": 52
},
{
"source_id": 601617,
"name": "Option B: Alternate DNA extraction (preferred for quantitative recovery of ≤80 bp fragments)",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eChill on ice and centrifuge 10 min at 4 °C 16,000 x g.\u003c/div\u003e\u003c/div\u003e",
"position": 53
},
{
"source_id": 601618,
"name": "Option B: Alternate DNA extraction (preferred for quantitative recovery of ≤80 bp fragments)",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003ePour off the liquid and drain on a paper towel.\u003c/div\u003e\u003c/div\u003e",
"position": 54
},
{
"source_id": 601619,
"name": "Option B: Alternate DNA extraction (preferred for quantitative recovery of ≤80 bp fragments)",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eRinse the pellet in 1 ml 100% ethanol and centrifuge 1 min at 4 °C 16,000 x g.\u003c/div\u003e\u003c/div\u003e",
"position": 55
},
{
"source_id": 601620,
"name": "Option B: Alternate DNA extraction (preferred for quantitative recovery of ≤80 bp fragments)",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eCarefully pour off the liquid and drain on a paper towel. Air dry.\u003c/div\u003e\u003c/div\u003e",
"position": 56
},
{
"source_id": 601621,
"name": "Option B: Alternate DNA extraction (preferred for quantitative recovery of ≤80 bp fragments)",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eWhen the pellet is dry, dissolve in 25-50 μL 1 mM Tris-HCl pH8 0.1 mM EDTA.\u003c/div\u003e\u003c/div\u003e",
"position": 57
},
{
"source_id": 601622,
"name": "Library preparation and sequencing",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eOptional: Quantify 1-2 μL, for example using fluorescence detection with a Qubit instrument.\u003c/div\u003e\u003c/div\u003e",
"position": 58
},
{
"source_id": 601623,
"name": "Library preparation and sequencing",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003e\u003cspan style = \":justify;\"\u003eOptional: Evaluate the presence of cleaved fragments and the size distribution by capillary electrophoresis with fluorescence detection, for example using a Tapestation instrument.\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e",
"position": 59
},
{
"source_id": 601624,
"name": "Library preparation and sequencing",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003e\u003cspan style = \":justify;\"\u003ePrepare barcoded libraries for Illumina sequencing with Tru-Seq adapters using a single-tube protocol, following the manufacturers instructions. Rapid PCR cycles favor exponential amplification of the desired CUT\u0026RUN fragments over linear amplification of large DNA fragments that are too long for polymerase to complete.\u003c/span\u003e\u003cspan\u003e\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e",
"position": 60
},
{
"source_id": 601625,
"name": "Library preparation and sequencing",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eQuantify library yield using dsDNA-specific assay, such as Qubit.\u003c/div\u003e\u003c/div\u003e",
"position": 61
},
{
"source_id": 601626,
"name": "Library preparation and sequencing",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003eDetermine the size distribution of libraries by Agilent 4200 TapeStation analysis.\u003c/div\u003e\u003c/div\u003e",
"position": 62
},
{
"source_id": 601627,
"name": "Library preparation and sequencing",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003ePerform paired-end Illumina sequencing on the barcoded libraries following the manufacturers instructions.\u003c/div\u003e\u003c/div\u003e",
"position": 63
},
{
"source_id": 601628,
"name": "Data processing and analysis",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003e\u003cspan style = \":justify;\"\u003eWe align paired-end reads using Bowtie2 version 2.2.5 with options: --local --very-sensitive- local --no-unal --no-mixed --no-discordant --phred33 -I 10 -X 700. For mapping spike-in fragments, we also use the --no-overlap --no-dovetail options to avoid cross-mapping of the experimental genome to that of the spike-in DNA.\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e",
"position": 64
},
{
"source_id": 601629,
"name": "Data processing and analysis",
"description": "\u003cdiv class = \"text-blocks\"\u003e\u003cdiv class = \"text-block\"\u003e\u003cspan style = \":justify;\"\u003eScripts are available from https://github.com/Henikoff/Cut-and-Run for spike-in calibration and for peak-calling.\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e",
"position": 65
}
]
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,45 @@
# frozen_string_literal: true
require 'rails_helper'
describe ProtocolImporters::ProtocolsIO::V3::ProtocolNormalizer do
let(:response) do
JSON.parse(file_fixture('protocols_io/v3/single_protocol.json').read).to_h.with_indifferent_access
end
let(:response_without_title) do
res_without_title = response
res_without_title[:protocol].reject! { |a| a == 'title' }
res_without_title
end
let(:normalized_result) do
JSON.parse(file_fixture('protocols_io/v3/normalized_single_protocol.json').read).to_h.with_indifferent_access
end
describe '#load_protocol' do
before do
allow_any_instance_of(ProtocolImporters::ProtocolsIO::V3::ApiClient)
.to(receive_message_chain(:single_protocol, :request, :last_uri, :to_s)
.and_return('https://www.protocols.io/api/v3/protocols/9451'))
end
context 'when have all data' do
it 'should normalize data correctly' do
allow_any_instance_of(ProtocolImporters::ProtocolsIO::V3::ApiClient)
.to receive_message_chain(:single_protocol, :parsed_response).and_return(response)
expect(subject.load_protocol(id: 'id').deep_stringify_keys).to be == normalized_result
end
end
context 'when do not have name' do
it 'sets nil for name' do
allow_any_instance_of(ProtocolImporters::ProtocolsIO::V3::ApiClient)
.to receive_message_chain(:single_protocol, :parsed_response).and_return(response_without_title)
expect(subject.load_protocol(id: 'id')[:protocol][:name]).to be_nil
end
end
end
end