diff --git a/build/lib/mimseq/deseq.R b/build/lib/mimseq/deseq.R index 392518b..8b80854 100644 --- a/build/lib/mimseq/deseq.R +++ b/build/lib/mimseq/deseq.R @@ -38,6 +38,7 @@ outdir = args[1] sampleData = args[2] control_cond = args[3] cluster_id = as.numeric(args[4]) +p_adj = as.numeric(args[5]) subdir = "DESeq2/" subdir_isodecoder = "DESeq2/isodecoder" subdir_anticodon = "DESeq2/anticodon" @@ -299,9 +300,9 @@ if (nrow(coldata) == 1) { # Count plots # add significance to baseMean matrices for current contrast - baseMeanPerLvl_anticodon$sig = res_anticodon[rownames(baseMeanPerLvl_anticodon),'padj'] < 0.05 + baseMeanPerLvl_anticodon$sig = res_anticodon[rownames(baseMeanPerLvl_anticodon),'padj'] <= p_adj baseMeanPerLvl_anticodon$sig = !is.na(baseMeanPerLvl_anticodon$sig) & baseMeanPerLvl_anticodon$sig # deal with NAs turning them into FALSE - baseMeanPerLvl_isodecoder$sig = res_isodecoder[rownames(baseMeanPerLvl_isodecoder),'padj'] < 0.05 + baseMeanPerLvl_isodecoder$sig = res_isodecoder[rownames(baseMeanPerLvl_isodecoder),'padj'] <= p_adj baseMeanPerLvl_isodecoder$sig = !is.na(baseMeanPerLvl_isodecoder$sig) & baseMeanPerLvl_isodecoder$sig # deal with NAs turning them into FALSE # add direction of DE to baseMean @@ -331,8 +332,8 @@ if (nrow(coldata) == 1) { scale_x_log10() + scale_y_log10() + #geom_smooth(method = 'lm', se = TRUE, alpha = 0.5, color = '#3182bd', fill = 'grey') + geom_abline(intercept = 0, slope = 1, linetype = 'dashed', color = '#3182bd', alpha = 0.8) + - scale_color_manual('Differential expression', labels = c("None", "Down", "Up"), values = c("darkgrey", "#f28f3b", "#4daf4a")) + - scale_shape_manual('Differential expression', labels = c("None", "Down", "Up"), values = c(19, 17, 17)) + + scale_color_manual(paste('Differential expression\n(p-adj <=',p_adj, ')'), labels = c("None", "Down", "Up"), values = c("darkgrey", "#f28f3b", "#4daf4a")) + + scale_shape_manual(paste('Differential expression\n(p-adj <=',p_adj, ')'), labels = c("None", "Down", "Up"), values = c(19, 17, 17)) + scale_size_manual(values = c(1,2), guide = FALSE) + theme_bw() + labs(x = paste('log10', combinations[[i]][2], 'counts', sep = ' '), y = paste('log10', combinations[[i]][1], 'counts', sep = ' ')) + annotate("label", 0, Inf, hjust = 0, vjust = 1, label = paste("italic(r) == ", anticodon_cor), parse = TRUE) @@ -342,8 +343,8 @@ if (nrow(coldata) == 1) { scale_x_log10() + scale_y_log10() + #geom_smooth(method = 'lm', se = TRUE, alpha = 0.5, color = '#3182bd', fill = 'grey') + geom_abline(intercept = 0, slope = 1, linetype = 'dashed', color = '#3182bd', alpha = 0.8) + - scale_color_manual('Differential expression', labels = c("None", "Down", "Up"), values = c("darkgrey", "#f28f3b", "#4daf4a")) + - scale_shape_manual('Differential expression', labels = c("None", "Down", "Up"), values = c(19, 17, 17)) + + scale_color_manual(paste('Differential expression\n(p-adj <=',p_adj, ')'), labels = c("None", "Down", "Up"), values = c("darkgrey", "#f28f3b", "#4daf4a")) + + scale_shape_manual(paste('Differential expression\n(p-adj <=',p_adj, ')'), labels = c("None", "Down", "Up"), values = c(19, 17, 17)) + scale_size_manual(values = c(1,2), guide = FALSE) + theme_bw() + labs(x = paste('log10', combinations[[i]][2], 'counts', sep = ' '), y = paste('log10', combinations[[i]][1], 'counts', sep = ' ')) + annotate("label", 0, Inf, hjust = 0, vjust = 1, label = paste("italic(r) == ", isodecoder_cor), parse = TRUE) diff --git a/build/lib/mimseq/mimseq.py b/build/lib/mimseq/mimseq.py index 4c0d107..e6fc4ce 100644 --- a/build/lib/mimseq/mimseq.py +++ b/build/lib/mimseq/mimseq.py @@ -49,7 +49,7 @@ def restrictedFloat2(x): raise argparse.ArgumentTypeError('{} not a real number'.format(x)) def mimseq(trnas, trnaout, name, species, out, cluster, cluster_id, cov_diff, posttrans, control_cond, threads, max_multi, snp_tolerance, \ - keep_temp, cca, double_cca, min_cov, mismatches, remap, remap_mismatches, misinc_thresh, mito_trnas, pretrnas, local_mod, sample_data): + keep_temp, cca, double_cca, min_cov, mismatches, remap, remap_mismatches, misinc_thresh, mito_trnas, pretrnas, local_mod, p_adj, sample_data): # Main wrapper # Integrity check for output folder argument... @@ -176,7 +176,7 @@ def mimseq(trnas, trnaout, name, species, out, cluster, cluster_id, cov_diff, po \n| Differential expression analysis with DESeq2 |\ \n+----------------------------------------------+") - deseq_cmd = ["Rscript", script_path + "/deseq.R", out, sample_data, control_cond, str(cluster_id)] + deseq_cmd = ["Rscript", script_path + "/deseq.R", out, sample_data, control_cond, str(cluster_id), str(p_adj)] #subprocess.check_call(deseq_cmd) process = subprocess.Popen(deseq_cmd, stdout = subprocess.PIPE) while True: @@ -239,6 +239,10 @@ def main(): options.add_argument('--local-modomics', required=False, dest = 'local_mod', action='store_true',\ help = "Disable retrieval of Modomics data from online. Instead use older locally stored data. Warning - this leads\ to usage of older Modomics data!") + options.add_argument('--p-adj', required = False, dest = 'p_adj', type = restrictedFloat, default=0.05,\ + help = "Adjusted p-value threshold for DESeq2 pairwise condition differential epxression dot plots. \ + tRNAs with DESeq2 adjusted p-values equal to or below this value will be displayed as green or orange triangles for up- or down-regulated tRNAs, respectively. \ + Default p-adj <= 0.05") align = parser.add_argument_group("GSNAP alignment options") align.add_argument('--max-mismatches', metavar = 'allowed mismatches', required = False, dest = 'mismatches', type = float, \ @@ -358,7 +362,7 @@ def main(): mimseq(args.trnas, args.trnaout, args.name, args.species, args.out, args.cluster, args.cluster_id, args.cov_diff, \ args.posttrans, args.control_cond, args.threads, args.max_multi, args.snp_tolerance, \ args.keep_temp, args.cca, args.double_cca, args.min_cov, args.mismatches, args.remap, args.remap_mismatches, \ - args.misinc_thresh, args.mito, args.pretrnas, args.local_mod, args.sampledata) + args.misinc_thresh, args.mito, args.pretrnas, args.local_mod, args.p_adj, args.sampledata) if __name__ == '__main__': main() diff --git a/build/lib/mimseq/mmQuant.py b/build/lib/mimseq/mmQuant.py index 754a640..29a01c1 100644 --- a/build/lib/mimseq/mmQuant.py +++ b/build/lib/mimseq/mmQuant.py @@ -57,6 +57,7 @@ def unknownMods(inputs, knownTable, cluster_dict, modTable, misinc_thresh, cov_t isodecoder, pos = line.split("\t")[0:2] predRound1[isodecoder].append(int(pos)) knownTable = {cluster:[pos for pos in knownTable[cluster] if pos not in predRound1[cluster]] for cluster, pos in knownTable.items()} # subtraction + knownTable = defaultdict(list, knownTable) except: next diff --git a/build/lib/mimseq/version.py b/build/lib/mimseq/version.py index a4b2295..5f42872 100644 --- a/build/lib/mimseq/version.py +++ b/build/lib/mimseq/version.py @@ -1 +1 @@ -__version__ = "0.3.4.1" +__version__ = "0.3.4.2" diff --git a/dist/mimseq-0.3.4.1.tar.gz b/dist/mimseq-0.3.4.1.tar.gz deleted file mode 100644 index a8045bc..0000000 Binary files a/dist/mimseq-0.3.4.1.tar.gz and /dev/null differ diff --git a/dist/mimseq-0.3.4.1-py3-none-any.whl b/dist/mimseq-0.3.4.2-py3-none-any.whl similarity index 98% rename from dist/mimseq-0.3.4.1-py3-none-any.whl rename to dist/mimseq-0.3.4.2-py3-none-any.whl index e2b82f3..3c9c12a 100644 Binary files a/dist/mimseq-0.3.4.1-py3-none-any.whl and b/dist/mimseq-0.3.4.2-py3-none-any.whl differ diff --git a/dist/mimseq-0.3.4.2.tar.gz b/dist/mimseq-0.3.4.2.tar.gz new file mode 100644 index 0000000..8d32541 Binary files /dev/null and b/dist/mimseq-0.3.4.2.tar.gz differ diff --git a/mimseq.egg-info/PKG-INFO b/mimseq.egg-info/PKG-INFO index f0b36aa..e512af1 100644 --- a/mimseq.egg-info/PKG-INFO +++ b/mimseq.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: mimseq -Version: 0.3.4.1 +Version: 0.3.4.2 Summary: Custom high-throughput tRNA sequencing alignment and quantification pipeline based on modification induced misincorporation cDNA synthesis. Home-page: https://github.com/nedialkova-lab/mim-tRNAseq Author: Drew Behrens diff --git a/mimseq/version.py b/mimseq/version.py index a4b2295..5f42872 100644 --- a/mimseq/version.py +++ b/mimseq/version.py @@ -1 +1 @@ -__version__ = "0.3.4.1" +__version__ = "0.3.4.2"