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

more flexible bam correlation wrapper

parent 609235c3
No related branches found
No related tags found
No related merge requests found
...@@ -185,20 +185,28 @@ export -f dge_tophat_se ...@@ -185,20 +185,28 @@ export -f dge_tophat_se
dge_bam_correlate(){ dge_bam_correlate(){
if [ $# -ne 1 ]; then if [ $# -eq 0 ]; then
echo "Usage: dge_bam_correlate <bam_directory>" >&2 ; return; echo "Usage: dge_bam_correlate <bam_directory>" >&2 ;
echo "Usage: dge_bam_correlate <bam_files...>" >&2 ;
return;
fi fi
local bamDir=$1 local bamDir=$1
bamFiles=$(find $bamDir | grep ".bam$" | grep -v "unmapped" | sort) if [ $# -e 1 ]; then
bamLabels=$(echo "$bamFiles" |sed 's!.*/!!' | sed 's/_ca.bam//g' | sed 's/.bam//g' | xargs echo); echo $bamLabels bamFiles=$(find $bamDir | grep ".bam$" | grep -v "unmapped" | sort)
else
bamFiles=$*
fi
bamLabels=$(echo "$bamFiles" | xargs -n1 basename | sed 's!.*/!!' | sed 's/_mmf.bam//g' | sed 's/_ca.bam//g' | sed 's/.bam//g' | xargs echo); echo $bamLabels
## see how well bam files correlate using untrimmed data ## see how well bam files correlate using untrimmed data
bcCmd="bamCorrelate bins --bamfiles $(echo $bamFiles | xargs echo) --labels $bamLabels --plotFile='bc.pdf' --outFileCorMatrix='bc.txt' --numberOfProcessors=6 --corMethod spearman --zMin 0.5 --zMax 1" bcCmd="bamCorrelate bins --bamfiles $(echo $bamFiles | xargs echo) --labels $bamLabels --plotFile='bc.pdf' --outFileCorMatrix='bc.txt' --numberOfProcessors=6 --corMethod spearman --zMin 0.5 --zMax 1"
mysub "${project}__bamcorrelate" "$bcCmd" -q long -n 4 -R span[hosts=1] | blockScript .bamcorrelate echo $bcCmd
#mysub "${project}__bamcorrelate" "$bcCmd" -q long -n 4 -R span[hosts=1] | blockScript .bamcorrelate
mailme "$project: bamcorrelate done in $(pwd)" #mailme "$project: bamcorrelate done in $(pwd)"
} }
export -f dge_bam_correlate export -f dge_bam_correlate
......
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