5-plex = wide format : Each target is divided into wild type and mutant/variant and taken into two different columns
WWTP
Target
Copies_per_uL_WT
Copies_per_uL_variant
other_cols_WT
other_cols_variant
AS
418
20
1
6
2.2
Implementation details
In the main script have a command that says
if (filaname contains the string **5plex** or **CA** ) go into this function variant_processing(datalist)
_This is similar to line 227-232 in 2-calcs.. which was for B117
this function variant_processing will take the data; convert the existing Target_Name into two columns locus and variant_status using a list as a lookup table.
variant_target_lookup_list <- list( 'N417Q' = 'BJ', 'N417' = 'WT', ..)
the left side is the matching to the Target_Name, right side will go into the variant_status column. The locus column will only retain the number 417 ; using str_extract(Target_Name, '[:digit:]*') to fish out the 417 or other digits. More info about string manipulations here
Then implement the same code as in g.3-B117../ calculate_B117_percentage after this step.
Make sure to test with both a variant assay and an N1N2 assay (which should not pass through the variant_processing function.
I just realized that this is quite a difficult task, so just use this as practice for thinking through the steps/R commands you would use for this. This is a really challenging way to learn R.. I will do this task on the side so no pressure on you
Goal
Implement a function that is invoked only when 5plex or CA are found in the filename that processes variants into their desired format
format explanation
The main difference between the variant assays and the N1N2 ones is the way the data is reported
Implementation details
In the main script have a command that says
if (filaname contains the string **5plex** or **CA** ) go into this function variant_processing(datalist)
_This is similar to line 227-232 in 2-calcs.. which was for B117this function variant_processing will take the data; convert the existing
Target_Name
into two columnslocus
andvariant_status
using a list as a lookup table.variant_target_lookup_list <- list( 'N417Q' = 'BJ', 'N417' = 'WT', ..)
the left side is the matching to the Target_Name, right side will go into the variant_status column. The locus column will only retain the number 417 ; usingstr_extract(Target_Name, '[:digit:]*')
to fish out the 417 or other digits. More info about string manipulations hereThen implement the same code as in g.3-B117../ calculate_B117_percentage after this step.
variant_processing
function.I just realized that this is quite a difficult task, so just use this as practice for thinking through the steps/R commands you would use for this. This is a really challenging way to learn R.. I will do this task on the side so no pressure on you