Skip to content

Commit

Permalink
Update LaunchMetrics.py
Browse files Browse the repository at this point in the history
adding demux only routine to the script
  • Loading branch information
darrelln32 committed Mar 25, 2024
1 parent 4908efe commit f1b3e25
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion scripts/LaunchMetrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@
import shutil
import pathlib
import scripts.generate_run_params
import scripts.get_total_reads_from_demux


# Global Variable : we do not want to process these experiments in this script
DO_NOT_PROCESS = ["10X_Genomics", "DLP"]
DO_NOT_PROCESS = ["DLP"]
# These recipes will be evaluated using DRAGEN because of their larger size of fastqs
RUN_ON_DRAGEN = ["MissionBio", "SingleCellCNV", "MouseWholeGenome", "HumanWholeGenome", "PombeWholeGenome", "ChIPSeq", "AmpliconSeq"]
# these projects willl only need demux stats
DEMUX_ONLY = ["SMARTSeq", "10X_Genomics"]

# Organisms to have DRAGEN BAMS
DRAGEN_RNA_GENOMES = ["GRCh38", "grcm39"]
# this list contains the headers of the columns. we will access the data using these listings
Expand All @@ -38,6 +42,7 @@ def launch_metrics(self, all_samples, run, project_directory):
work_directory = "{}/{}/".format(parent_directory, run)
rna_directory = "{}RNA/".format(work_directory)
dragen_directory = "{}DRAGEN/".format(work_directory)
stats_done_directory = "/igo/stats/DONE/{}".format(run.split("_")[0])

# create work directory
pathlib.Path(work_directory).mkdir(parents = True, exist_ok = True)
Expand All @@ -59,6 +64,12 @@ def launch_metrics(self, all_samples, run, project_directory):
# test to see if there are some samples that this script will not process
if any(s in sample.recipe for s in DO_NOT_PROCESS):
continue

if any(s in sample.recipe for s in DEMUX_ONLY):
demux_report_file = "/igo/staging/FASTQ/{}/Reports/Demultiplex_Stats.csv".format(run)
demux_reads_per_sample = scripts.get_total_reads_from_demux.get_total_reads([sample.sample_id], demux_report_file)
scripts.get_total_reads_from_demux.write_to_am_txt(run, sample.sample_id, demux_reads_per_sample[sample.sample_id], stats_done_directory)

# grab the sample parameters (bait set, type, gtag, etc)
sample_parameters = self.get_parameters(sample.genome, sample.recipe)
# process the RNA data seperately
Expand Down

0 comments on commit f1b3e25

Please sign in to comment.