Skip to content

Commit

Permalink
Merge pull request #241 from MoTrPAC/develop
Browse files Browse the repository at this point in the history
MotrpacBicQC 0.9.5: proteomics tmt-18 support
  • Loading branch information
biodavidjm committed May 23, 2024
2 parents cb17a64 + 9f1790b commit e48e4cb
Show file tree
Hide file tree
Showing 90 changed files with 130 additions and 105 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: MotrpacBicQC
Type: Package
Title: QC/QA functions for the MoTrPAC community
Version: 0.9.4
Date: 2024-05-16
Version: 0.9.5
Date: 2024-05-22
Author: MoTrPAC Bioinformatics Center
Maintainer: David Jimenez-Morales <davidjm@stanford.edu>
Description: R Package for the analysis of MoTrPAC datasets.
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# MotrpacBicQC 0.9.5 (2024-05-22)

* Proteomics: provide QC support for TMT-18

# MotrpacBicQC 0.9.4 (2024-05-16)

* Enhance and improve `dl_read_gcp`:
Expand Down
4 changes: 4 additions & 0 deletions R/misc.R
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ filter_required_columns <- function(df,
emeta_sample_coln <- append(emeta_sample_coln, "tmt16_channel")
if(verbose) message(" + (+) All required columns present (tmt16 experiment)")
df <- subset(df, select = emeta_sample_coln)
}else if("tmt18_channel" %in% colnames(df)){
emeta_sample_coln <- append(emeta_sample_coln, "tmt18_channel")
if(verbose) message(" + (+) All required columns present (tmt18 experiment)")
df <- subset(df, select = emeta_sample_coln)
}else{
if(verbose) message(" - (-) Expected COLUMN NAMES are missed: FAIL")
}
Expand Down
35 changes: 24 additions & 11 deletions R/proteomics_qc.R
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,11 @@ check_vial_metadata_proteomics <- function(df_vm,
}else if("tmt16_channel" %in% colnames(df_vm)){
required_columns <- c("vial_label", "tmt_plex", "tmt16_channel")
tmt_channel <- "tmt16_channel"
}else if("tmt18_channel" %in% colnames(df_vm)){
required_columns <- c("vial_label", "tmt_plex", "tmt18_channel")
tmt_channel <- "tmt18_channel"
}else{
if(verbose) message(" - (-) `tmt[11|16]_channel` column not found")
if(verbose) message(" - (-) `tmt[11|16|18]_channel` column not found")
ic_vm <- 3
return(ic_vm)
}
Expand All @@ -542,6 +545,9 @@ check_vial_metadata_proteomics <- function(df_vm,
}else if("tmt16_channel" %in% colnames(df_vm)){
df_vm$vial_label <- gsub(" ", "", df_vm$vial_label)
valid_channels <- c("126C", "127N", "127C", "128N", "128C", "129N", "129C", "130N", "130C", "131N", "131C", "132N", "132C", "133N", "133C", "134N")
}else if("tmt18_channel" %in% colnames(df_vm)){
df_vm$vial_label <- gsub(" ", "", df_vm$vial_label)
valid_channels <- c("126C", "127N", "127C", "128N", "128C", "129N", "129C", "130N", "130C", "131N", "131C", "132N", "132C", "133N", "133C", "134N")
}

ic_vm <- 0
Expand All @@ -550,7 +556,7 @@ check_vial_metadata_proteomics <- function(df_vm,

for(p in plexes){
temp_plex <- df_vm[which(df_vm$tmt_plex == p),]
if(all(valid_channels %in% temp_plex[[tmt_channel]])){
if( all(valid_channels %in% temp_plex[[tmt_channel]]) ){
if(verbose) message(" + (+) All ", tmt_channel," channels are valid in plex ", paste(p))
}else{
if(tmt_channel == "tmt11_channel"){
Expand All @@ -566,15 +572,22 @@ check_vial_metadata_proteomics <- function(df_vm,
}
}
}

all_samples <- df_vm$vial_label
all_vial_labels <- NA

if( any( grepl("Ref", df_vm$vial_label) ) ){
all_vial_labels <- all_samples[!grepl('^Ref', all_samples)]
}else{
if(verbose) message(" - (-) Ref channels not found in vial_metadata")
ic_vm <- ic_vm + 1

# Check that all plexes have one channel
for(p in plexes){
temp_plex <- df_vm[which(df_vm$tmt_plex == p),]
if( sum(grepl("Ref", temp_plex$vial_label)) == 1 ){
if(verbose) message(" + (+) Ref channel found in plex ", paste(p))
}else if(sum(grepl("Ref", temp_plex$vial_label)) == 0) {
if(verbose) message(" - (-) Ref channel missed in plex ", paste(p))
ic_vm <- ic_vm + 1
}else if(sum(grepl("Ref", temp_plex$vial_label)) > 1) {
if(verbose) message(" - (-) Too many reference channels in plex ", paste(p))
if(verbose){
print(temp_plex[grepl("Ref", temp_plex$vial_label), ])
}
ic_vm <- ic_vm + 1
}
}

if( any(duplicated(df_vm$vial_label)) ){
Expand Down
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/articles/other_functions.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="generator" content="pandoc">
<meta name="date" content="2024-05-16">
<meta name="date" content="2024-05-22">
<title>MotrpacBicQC: Other Functions</title>
<script src="other_functions_files/header-attrs-2.25/header-attrs.js"></script><script src="other_functions_files/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1">
<link href="other_functions_files/bootstrap-3.3.7/css/bootstrap.min.css" rel="stylesheet">
Expand Down Expand Up @@ -123,7 +123,7 @@ <h1 class="title">MotrpacBicQC: Other Functions</h1>

<p class="authors">
</p>
<p class="date"><span class="glyphicon glyphicon-calendar"></span> 2024-05-16</p>
<p class="date"><span class="glyphicon glyphicon-calendar"></span> 2024-05-22</p>



Expand Down
4 changes: 2 additions & 2 deletions docs/articles/qc_metabolomics.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="generator" content="pandoc">
<meta name="date" content="2024-05-16">
<meta name="date" content="2024-05-22">
<title>MotrpacBicQC: Metabolomics QC</title>
<script src="qc_metabolomics_files/header-attrs-2.25/header-attrs.js"></script><script src="qc_metabolomics_files/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1">
<link href="qc_metabolomics_files/bootstrap-3.3.7/css/bootstrap.min.css" rel="stylesheet">
Expand Down Expand Up @@ -126,7 +126,7 @@ <h1 class="title">MotrpacBicQC: Metabolomics QC</h1>

<p class="authors">
</p>
<p class="date"><span class="glyphicon glyphicon-calendar"></span> 2024-05-16</p>
<p class="date"><span class="glyphicon glyphicon-calendar"></span> 2024-05-22</p>



Expand Down
4 changes: 2 additions & 2 deletions docs/articles/qc_olink.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="generator" content="pandoc">
<meta name="date" content="2024-05-16">
<meta name="date" content="2024-05-22">
<title>MotrpacBicQC: OLINK QC</title>
<script src="qc_olink_files/header-attrs-2.25/header-attrs.js"></script><script src="qc_olink_files/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1">
<link href="qc_olink_files/bootstrap-3.3.7/css/bootstrap.min.css" rel="stylesheet">
Expand Down Expand Up @@ -125,7 +125,7 @@ <h1 class="title">MotrpacBicQC: OLINK QC</h1>

<p class="authors">
</p>
<p class="date"><span class="glyphicon glyphicon-calendar"></span> 2024-05-16</p>
<p class="date"><span class="glyphicon glyphicon-calendar"></span> 2024-05-22</p>



Expand Down
4 changes: 2 additions & 2 deletions docs/articles/qc_proteomics.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="generator" content="pandoc">
<meta name="date" content="2024-05-16">
<meta name="date" content="2024-05-22">
<title>MotrpacBicQC: Proteomics QC</title>
<script src="qc_proteomics_files/header-attrs-2.25/header-attrs.js"></script><script src="qc_proteomics_files/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1">
<link href="qc_proteomics_files/bootstrap-3.3.7/css/bootstrap.min.css" rel="stylesheet">
Expand Down Expand Up @@ -125,7 +125,7 @@ <h1 class="title">MotrpacBicQC: Proteomics QC</h1>

<p class="authors">
</p>
<p class="date"><span class="glyphicon glyphicon-calendar"></span> 2024-05-16</p>
<p class="date"><span class="glyphicon glyphicon-calendar"></span> 2024-05-22</p>



Expand Down
6 changes: 3 additions & 3 deletions docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/notes_developers.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ articles:
qc_metabolomics: qc_metabolomics.html
qc_olink: qc_olink.html
qc_proteomics: qc_proteomics.html
last_built: 2024-05-16T19:23Z
last_built: 2024-05-23T04:49Z

2 changes: 1 addition & 1 deletion docs/reference/assay_abbr.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/assay_codes.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/assay_order.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/bic_animal_tissue_code.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/check_crossfile_olink_validation.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/check_failedsamples.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/check_manifest_rawdata.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/check_metadata_metabolites.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/check_metadata_phase_file.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/check_metadata_proteins.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/check_metadata_samples.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/check_metadata_samples_olink.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/check_missing_values.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/check_ratio_proteomics.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/reference/check_results.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e48e4cb

Please sign in to comment.