Skip to content
Snippets Groups Projects
Commit 8fc29827 authored by Holger Brandl's avatar Holger Brandl
Browse files

inc R datautils version to 1.9; better counting

parent dd2b5932
No related branches found
No related tags found
No related merge requests found
#source <(curl https://raw.githubusercontent.com/holgerbrandl/datautils/v1.4/R/spinr/spin_utils.sh 2>&1 2>/dev/null)
#source <(curl https://raw.githubusercontent.com/holgerbrandl/datautils/v1.8/R/spinr/spin_utils.sh 2>&1 2>/dev/null)
## configure paths
......@@ -14,8 +14,8 @@ export PYTHONPATH=/home/brandl/bin/macs2/lib/python2.7/site-packages:$PYTHONPATH
cs_bowtie_qc(){
echo '
devtools::source_url("https://raw.githubusercontent.com/holgerbrandl/datautils/v1.4/R/core_commons.R")
devtools::source_url("https://raw.githubusercontent.com/holgerbrandl/datautils/v1.4/R/ggplot_commons.R")
devtools::source_url("https://raw.githubusercontent.com/holgerbrandl/datautils/v1.8/R/core_commons.R")
devtools::source_url("https://raw.githubusercontent.com/holgerbrandl/datautils/v1.8/R/ggplot_commons.R")
########################################################################################################################
#> # Bowtie2 Mapping Summary
......@@ -132,16 +132,26 @@ if [ $# -ne 2 ]; then
fi
echo '
devtools::source_url("https://raw.githubusercontent.com/holgerbrandl/datautils/v1.4/R/core_commons.R")
devtools::source_url("https://raw.githubusercontent.com/holgerbrandl/datautils/v1.8/R/core_commons.R")
bamFile=commandArgs(T)[1]
chromInfoFile=commandArgs(T)[2]
#bamFile="/projects/bioinfo/holger/projects/khan_chipseq_h1/alignments_mmfilt/H1M_Dome_mmf.bam";
#bedFile="danRer7.chromInfo"
#bamFile="/projects/bioinfo/holger/projects/krause_chipseq/alignments_mmfilt/H3HA_Dome_mmf.bam";
#chromInfoFile="danRer7.chromInfo"
chrOrderBam <- readLines(pipe(paste("samtools view -H ", bamFile, " | cut -f2 | grep -F SN"))) %>% str_replace(fixed("SN:"), "")
chromInfo <- read.delim(chromInfoFile) %>% mutate(chrom=str_replace(chrom, "chr", ""))
#data.frame(chrom=chrOrderBam) %>%
# left_join(chromInfo) %>%
# ## make sure to always keep all chromsomes of the bam no matter if they are present in the chromInfo.
# mutate(size=ifelse(is.na(size), -1, size)) %>%
# write.delim(stdout(), header=F, quote=F)
read.delim(chromInfoFile) %>%
mutate(chrom=str_replace(chrom, "chrM", "MT")) %>%
mutate(chrom=str_replace(chrom, "chr", "")) %>%
mutate(chrom=factor(as.character(chrom), levels=chrOrderBam)) %>% arrange(chrom) %>%
filter(!is.na(chrom)) %>%
......@@ -158,7 +168,7 @@ if [ $# -ne 2 ]; then
fi
echo '
devtools::source_url("https://raw.githubusercontent.com/holgerbrandl/datautils/v1.4/R/core_commons.R")
devtools::source_url("https://raw.githubusercontent.com/holgerbrandl/datautils/v1.8/R/core_commons.R")
bamFile=commandArgs(T)[1]
bedFile=commandArgs(T)[2]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment