Skip to content

Commit df795ef

Browse files
committed
handle multiple sequencing units per sample for sample annotation generation
1 parent 390954b commit df795ef

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

workflow/rules/quantification.smk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ rule sample_annotation:
5151
run:
5252
multiqc_df = pd.read_csv(os.path.join(input.multiqc_stats,"multiqc_general_stats.txt"), delimiter='\t', index_col=0).loc[list(samples.keys()),:]
5353
# merge by sample names (index) and drop redundant or unnecessary columns
54-
annot_df = pd.merge(annot, multiqc_df, left_index=True, right_index=True, how='inner').drop(['bam_file', 'sample_name'], axis=1)
54+
annot_df = pd.merge(annot_samples, multiqc_df, left_index=True, right_index=True, how='inner').drop(['bam_file', 'sample_name'], axis=1)
5555
# make column names R compatible
5656
annot_df.columns = (
5757
annot_df.columns

workflow/scripts/plot_sample_annotation.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ sample_annotation_html_path <- snakemake@output[["sample_annotation_html"]]
2222

2323
#### load & prepare data ####
2424
# load data
25-
sample_annotation <- data.frame(fread(file.path(sample_annotation_path), header=TRUE), row.names=1, check.names = FALSE)
25+
sample_annotation <- data.table::fread(file.path(sample_annotation_path), header = TRUE)
26+
sample_annotation <- data.frame(sample_annotation[!duplicated(sample_annotation[[1]]), ], row.names = 1, check.names = FALSE)
27+
2628
anno <- data.frame(fread(file.path(sample_annotation_w_QC_path), header=TRUE), row.names=1)
2729

2830
# determine QC (pipeline provided) columns

0 commit comments

Comments
 (0)