Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
531 changes: 531 additions & 0 deletions coderbuild/cnf/03-drugs-cnf.py

Large diffs are not rendered by default.

478 changes: 478 additions & 0 deletions coderbuild/cnf/04-experiments-cnf.py

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions coderbuild/cnf/build_drugs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
# build_drugs.sh - wraps 03-drugs-cnf.py per coderdata convention.
#
# Usage:
# build_drugs.sh <existing_drug_files>
#
# <existing_drug_files> is a comma-delimited list of drug TSV files from
# previous datasets in the build sequence. Their improve_drug_id values
# get reused when the canonical SMILES match.

set -euo pipefail

PREV_DRUGS="${1:-}"

python 03-drugs-cnf.py \
--prev_drugs "$PREV_DRUGS" \
--out_drugs /tmp/cnf_drugs.tsv \
--out_desc /tmp/cnf_drug_descriptors.tsv

python build_drug_desc.py --drugtable /tmp/cnf_drugs.tsv --desctable /tmp/cnf_drug_descriptors.tsv.gz
12 changes: 12 additions & 0 deletions coderbuild/cnf/build_exp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
# build_exp.sh - wraps 04-experiments-cnf.py per coderdata convention.
#
# Usage:
# build_exp.sh <samples_file> <drugs_file>

set -euo pipefail

SAMPLES="${1:?Usage: build_exp.sh <cnf_samples.csv> <cnf_drugs.tsv>}"
DRUGS="${2:?Usage: build_exp.sh <cnf_samples.csv> <cnf_drugs.tsv>}"

python 04-experiments-cnf.py "$SAMPLES" "$DRUGS" --output /tmp/cnf_experiments.tsv
12 changes: 9 additions & 3 deletions coderbuild/mpnst/00_sample_gen.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# 00_sample_gen.R
# This script generate a new sample table based on previous dataset's sample file (taking the max improve_sample_id)
# Load required libraries
library(data.table)
Expand Down Expand Up @@ -26,9 +27,14 @@ synapser::synLogin(authToken=synapse_token)
manifest<-synapser::synTableQuery("select * from syn53503360")$asDataFrame()|>
as.data.frame()

#Drop contaminated sample JH-2-009
#Drop contaminated sample JH-2-009 and others with issues
manifest <- manifest %>%
filter(Sample != "JH-2-009")
filter(Sample != "JH-2-009") %>%
filter(Sample != "WU-545") %>%
filter(Sample != "WU-536") %>%
filter(Sample != "WU-505") %>%
filter(Sample != "MN-1") %>%
filter(Sample != "MN-3")


###sample file has a strict schema
Expand Down Expand Up @@ -56,7 +62,7 @@ sampTable<-manifest|>

##third, generate a sample for the MTs if they were generated
pdxmt<-subset(sampTable,!is.na(MicroTissueDrugFolder))
pdxmt$model_type=rep('xenograft derived organoid',nrow(pdxmt))
pdxmt$model_type=rep('3D-MEDS',nrow(pdxmt))
print(pdxmt)

main<-rbind(sampTable,pdxmt)|>
Expand Down
Loading