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

modernized chipseq utilities

parent 3c31df51
No related branches found
No related tags found
No related merge requests found
......@@ -136,7 +136,7 @@ if [ $# -ne 2 ]; then
fi
echo '
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.26/R/core_commons.R")
bamFile=commandArgs(T)[1]
chromInfoFile=commandArgs(T)[2]
......@@ -144,9 +144,12 @@ chromInfoFile=commandArgs(T)[2]
#bamFile="/projects/bioinfo/holger/projects/krause_chipseq/alignments_mmfilt/H3HA_Dome_mmf.bam";
#chromInfoFile="danRer7.chromInfo"
#bamFile="/projects/bioinfo/holger/projects/krause_chipseq/reanalysis/../alignments_mmfilt/H3HA_Sphere_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", ""))
chromInfo <- read_tsv(chromInfoFile, col_names=F) %>% set_names("chromosome", "chr_length") %>% mutate(chrom=str_replace(chromosome, "chr", ""))
#data.frame(chrom=chrOrderBam) %>%
# left_join(chromInfo) %>%
......@@ -154,16 +157,15 @@ chromInfo <- read.delim(chromInfoFile) %>% mutate(chrom=str_replace(chrom, "chr"
# 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)) %>%
read_tsv(chromInfoFile, col_names=F) %>%
set_names("chromosome", "chr_length") %>%
mutate(chromosome=str_replace(chromosome, "chrM", "MT") %>% str_replace("chr", "")) %>%
mutate(chromosome=factor(as.character(chromosome), levels=chrOrderBam)) %>% arrange(chromosome) %>%
filter(!is.na(chromosome)) %>%
write.delim(stdout(), header=F, quote=F)
' | Rscript --vanilla - $1 $2 2> /dev/null
}
export -f cs_sync_order_chrominfo2bam
cs_sync_order_bam2bed
cs_sync_order_bam2bed(){
......@@ -172,7 +174,7 @@ if [ $# -ne 2 ]; then
fi
echo '
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.26/R/core_commons.R")
bamFile=commandArgs(T)[1]
bedFile=commandArgs(T)[2]
......
......@@ -14,6 +14,7 @@ export PATH=${BIO_BIN_BASE}/FastQC_0.11.2:$PATH
export PATH=${BIO_BIN_BASE}/bedtools2-2.25.0/bin/:$PATH
export PATH=${BIO_BIN_BASE}/samtools-1.3:$PATH
export PATH=${BIO_BIN_BASE}/STAR-2.5.1b/source:$PATH
export PATH=${BIO_BIN_BASE}/ucsc:$PATH # for wigToBigWig
#export PATH=/home/brandl/bin/subread-1.4.6-p3-Linux-x86_64/bin:$PATH
......
......@@ -6,6 +6,10 @@
<groupId>de.mpicbg.scicomp.bioinfo</groupId>
<version>1.0-SNAPSHOT</version>
<properties>
<kotlin.version>1.0.3</kotlin.version>
</properties>
<dependencies>
<dependency>
......@@ -25,5 +29,45 @@
<artifactId>kutils</artifactId>
<version>0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
<version>${kotlin.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<sourceDirectory></sourceDirectory>
<plugins>
<plugin>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-maven-plugin</artifactId>
<version>${kotlin.version}</version>
<executions>
<execution>
<id>compile</id>
<phase>process-sources</phase>
<goals>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>test-compile</id>
<phase>process-test-sources</phase>
<goals>
<goal>test-compile</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
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