Skip to content

Commit 7445e73

Browse files
committed
Renamed to for consistency
1 parent 6376d23 commit 7445e73

File tree

1 file changed

+21
-25
lines changed

1 file changed

+21
-25
lines changed

rins_ccls/extract_insertion_points_and_overlappers.sh

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
#!/usr/bin/env bash
2+
set -x
23

3-
##!/bin/sh -x
44

55
index='hg19'
66
mapq=0
7-
8-
# find pattern of base files NOT
9-
# bam replaced with .pre_ltr.bowtie2.hg19.bam
10-
# and .post_ltr.bowtie2.hg19.bam
11-
base='bowtie2.herv_k113_ltr_ends.__very_sensitive_local.aligned'
7+
core='bowtie2.herv_k113_ltr_ends.__very_sensitive_local.aligned'
128
basedir=`pwd`
139

10+
1411
function usage(){
1512
echo
1613
echo "Usage: (NO EQUALS SIGNS)"
1714
echo
1815
echo "`basename $0`"
1916
echo
20-
echo "`basename $0` [--index STRING] [--mapq INTEGER] [--base 'STRING'] sampledir(s)"
17+
echo "`basename $0` [--index STRING] [--mapq INTEGER] [--core 'STRING'] sampledir(s)"
2118
echo
2219
echo "Example:"
2320
echo " `basename $0` NA211??"
@@ -26,7 +23,7 @@ function usage(){
2623
echo "Defaults:"
2724
echo " --index/-i .. : $index"
2825
echo " --mapq/-q .. : $mapq"
29-
echo " --base/-b ... : $base"
26+
echo " --core/-c ... : $core"
3027
echo
3128
echo "Output directed to file, similarly named."
3229
echo
@@ -39,8 +36,8 @@ while [ $# -ne 0 ] ; do
3936
shift; index=$1; shift ;;
4037
-q|--mapq*)
4138
shift; mapq=$1; shift ;;
42-
-b|--b*)
43-
shift; base=$1; shift ;;
39+
-c|--c*)
40+
shift; core=$1; shift ;;
4441
-*)
4542
echo ; echo "Unexpected args from: ${*}"; usage ;;
4643
*)
@@ -61,13 +58,12 @@ logfile=`basename $0`.$index.$quality.$date.out
6158
echo "index : $index"
6259
echo "mapq : $mapq"
6360
echo "quality : $quality"
64-
echo "base : $base"
61+
echo "core : $core"
6562
echo
6663

6764
#TCGA-41-5651-01A.bowtie2.herv_k113_ltr_ends.__very_sensitive_local.aligned.bam
6865

6966
while [ $# -ne 0 ] ; do
70-
# for bam in `find . -depth 2 -name $findpattern`; do
7167
cd $basedir
7268

7369
#echo $bam
@@ -85,7 +81,7 @@ logfile=`basename $0`.$index.$quality.$date.out
8581
#echo $base
8682
# TCGA-02-2483-01A.bowtie2.herv_k113_ltr_ends.__very_sensitive_local.aligned.bam
8783

88-
echo $base
84+
echo $core
8985
# *bowtie2.herv_k113_ltr_ends.__very_sensitive_local.aligned
9086

9187
#base=${base%.*} # drop the extension
@@ -97,23 +93,23 @@ logfile=`basename $0`.$index.$quality.$date.out
9793

9894
# TCGA-41-5651-01A.bowtie2.herv_k113_ltr_ends.__very_sensitive_local.aligned.pre_ltr.bowtie2.hg19.bam
9995

100-
samtools view -q $mapq -F 20 $sample.$base.pre_ltr.bowtie2.$index.bam \
96+
samtools view -q $mapq -F 20 $sample.$core.pre_ltr.bowtie2.$index.bam \
10197
| awk '{print $3":"$4+length($10)}' \
102-
| sort > $sample.$base.pre_ltr.bowtie2.$index.$quality.insertion_points
103-
samtools view -q $mapq -F 20 $sample.$base.post_ltr.bowtie2.$index.bam \
98+
| sort > $sample.$core.pre_ltr.bowtie2.$index.$quality.insertion_points
99+
samtools view -q $mapq -F 20 $sample.$core.post_ltr.bowtie2.$index.bam \
104100
| awk '{print $3":"$4}' \
105-
| sort > $sample.$base.post_ltr.bowtie2.$index.$quality.insertion_points
106-
positions_within_10bp.sh $sample.$base.*.bowtie2.$index.$quality.insertion_points \
107-
| sort | uniq -c > $sample.$base.both_ltr.bowtie2.$index.$quality.insertion_points.overlappers
101+
| sort > $sample.$core.post_ltr.bowtie2.$index.$quality.insertion_points
102+
positions_within_10bp.sh $sample.$core.*.bowtie2.$index.$quality.insertion_points \
103+
| sort | uniq -c > $sample.$core.both_ltr.bowtie2.$index.$quality.insertion_points.overlappers
108104

109-
samtools view -q $mapq -F 4 -f 16 $sample.$base.pre_ltr.bowtie2.$index.bam \
105+
samtools view -q $mapq -F 4 -f 16 $sample.$core.pre_ltr.bowtie2.$index.bam \
110106
| awk '{print $3":"$4}' \
111-
| sort > $sample.$base.pre_ltr.bowtie2.$index.$quality.rc_insertion_points
112-
samtools view -q $mapq -F 4 -f 16 $sample.$base.post_ltr.bowtie2.$index.bam \
107+
| sort > $sample.$core.pre_ltr.bowtie2.$index.$quality.rc_insertion_points
108+
samtools view -q $mapq -F 4 -f 16 $sample.$core.post_ltr.bowtie2.$index.bam \
113109
| awk '{print $3":"$4+length($10)}' \
114-
| sort > $sample.$base.post_ltr.bowtie2.$index.$quality.rc_insertion_points
115-
positions_within_10bp.sh $sample.$base.*.bowtie2.$index.$quality.rc_insertion_points \
116-
| sort | uniq -c > $sample.$base.both_ltr.bowtie2.$index.$quality.rc_insertion_points.rc_overlappers
110+
| sort > $sample.$core.post_ltr.bowtie2.$index.$quality.rc_insertion_points
111+
positions_within_10bp.sh $sample.$core.*.bowtie2.$index.$quality.rc_insertion_points \
112+
| sort | uniq -c > $sample.$core.both_ltr.bowtie2.$index.$quality.rc_insertion_points.rc_overlappers
117113

118114
shift
119115
done

0 commit comments

Comments
 (0)