pair2id: This function convert ids: (will need to move to the spotgear...

Description Usage Arguments Value Examples

View source: R/utils.R

Description

This function convert ids: (will need to move to the spotgear package.)

Usage

1
pair2id(N_g_vec, set_id, lane_id, include_orig_lane1 = TRUE)

Arguments

N_g_vec

A vector of integers representing the number of lanes on each gel

set_id

a vector of set ids

lane_id

a vector of lane ids (has the same length as set_id)

include_orig_lane1

Default to TRUE - include lane 1 while converting; Otherwise set to FALSE.

Value

A vector of ids upon stacking lanes on one another

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
N_g_vec     <- c(20,18,20,20,20,20,   20,20,20,9,   20,20,20) 
# <-- number of lanes per gel.
index_start <- c(1,7,11) # the 1st, 7th, 11th gel that represents 
 #the first of each cancer group.
set_no_vec  <- c(1:6,1:4,1:3) 
# index_start <- c(1,7,11,14)
# set_no_vec <- c(1:6,1:4,1:3,1:4)
PMSCL_machine_lane_id <- c(20,18,16,20,2,20,   20,20,20,NA,   
2,20,2,NA,NA,NA,NA) # NB: 2nd one has deleted two empty lanes.
# ?? no ref_lanes? Note that we call the first lane to be the 
# reference lanes, sometimes we call them lane 1s.
# controls do not have identical bands: (lesson - clear documentation 
# of the variable names after the first test of the model.)
# need two ids to identify the control lanes (set id, lane id - prior 
# to removal of the first lane).
control_set_id  <- c(6,6,6,6,6,6,6,6,6,6, 
                     10,10,10,10,
                     13,13,13,13
)
control_lane_id <- c(10,11,12,13,14,15,16,17,18,19,
                     3,4,5,6,
                     17,18,19,20
)

# the control id if all the lanes are stacked together:
ctrl_in_id <- pair2id(N_g_vec,control_set_id,control_lane_id) 
#ctrl_in_id <- c(102:111+6,171:174+10,231:234+13) 
# <-- including the original lane 1s.

oslerinhealth/spotgear documentation built on May 25, 2021, 10:38 p.m.