Skip to content
This repository was archived by the owner on Mar 15, 2024. It is now read-only.

Commit bd9523b

Browse files
update
1 parent e007cb0 commit bd9523b

File tree

98 files changed

+821542
-520594
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+821542
-520594
lines changed

ClustersPloter.sh

-93
This file was deleted.

ClustersPloter.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bin/ClustersPloter.sh

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
% git clone http://github.com/orangeSi/ClustersPloter.git
55
% cd ClustersPloter/example/
66
% cat work.sh # output svg and html
7-
# or go to https://clustersploter.readthedocs.io/en/latest/#
7+
# or go to https://github.com/orangeSi/ClustersPloter/wiki or https://clustersploter.readthedocs.io/en/latest/#
88
```
99

1010
<br><br>

bin/ClustersPloter.sh

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#!/bin/sh
2+
base=`dirname $(readlink -f $0)`/../
3+
base=`readlink -f $base`
4+
if [ ! -f "$base/bin/env.sh" ];
5+
then
6+
echo -e "\n$(tput setaf 1)error: cannot find $base/bin/env.sh$(tput setaf 7)\n"
7+
exit 1
8+
fi
9+
. $base/bin/env.sh
10+
if [ $# -ne 4 ];
11+
then
12+
echo -e "\nusage:\n sh $0 $(tput setaf 3)track.list$(tput setaf 7) prefix outdir/ $(tput setaf 3)main.conf$(tput setaf 7)\n\nany question, go to https://github.com/orangeSi/ClustersPloter/issues"
13+
exit
14+
fi
15+
#set -vex
16+
17+
#samtools view -h S20K.sort.bam s160:155612-178608 |samtools view - -b >S20K.s160.155612.178608.sort.bam #samtools index S20K.s160.155612.178608.sort.bam
18+
19+
#base=`dirname $(readlink -f $0)`/src/
20+
#source $base/../env.sh
21+
list=$1
22+
prefix=$2
23+
outdir=$3
24+
conf=$4
25+
26+
for i in $list $conf
27+
do
28+
if [ ! -f "$i" ];
29+
then
30+
echo -e "\n$(tput setaf 1)error: file $i not exists$(tput setaf 7)"
31+
exit
32+
fi
33+
done
34+
35+
if [ ! -d "$outdir" ];
36+
then
37+
mkdir -p $outdir
38+
fi
39+
40+
cd $outdir
41+
42+
num=`cat $conf|grep -iE "^\s*hist_scatter_line\s*|^\s*reads_mapping\s*|^\s*synteny\s*"|wc -l`
43+
if [ "$num" -ge 1 ];
44+
then
45+
echo
46+
date
47+
echo -e "$(tput setaf 3)perl $base/src/prepare.data.pl --list $list --prefix $prefix --outdir . --conf $conf$(tput setaf 7)"
48+
time perl $base/src/prepare.data.pl --list $list --prefix $prefix --outdir . --conf $conf >$prefix.prepare.data.log 2>$prefix.prepare.data.error.tmp
49+
cat $prefix.prepare.data.error.tmp|grep -v '^+ ' > $prefix.prepare.data.error && rm $prefix.prepare.data.error.tmp
50+
echo
51+
else
52+
cp $list $list.$prefix
53+
cp $conf $conf.$prefix
54+
fi
55+
56+
if [ -s $prefix.prepare.data.error ];
57+
then
58+
cat $prefix.prepare.data.error
59+
echo -e "\n\n$(tput setaf 1)error in file: $prefix.prepare.data.error$(tput setaf 7)\n\n"
60+
date
61+
exit
62+
else
63+
date
64+
echo
65+
echo
66+
date
67+
echo -e "$(tput setaf 3)perl $base/src/plot.genome.featureCluster.pl --list $list.$prefix --prefix $prefix --outdir . --conf $conf.$prefix $(tput setaf 7)"
68+
time perl $base/src/plot.genome.featureCluster.pl --list $list.$prefix --prefix $prefix --outdir . --conf $conf.$prefix >$prefix.plot.log 2>$prefix.plot.error.tmp
69+
cat $prefix.plot.error.tmp|grep -v '^+ ' >$prefix.plot.error && rm $prefix.plot.error.tmp
70+
echo
71+
fi
72+
echo
73+
#ls -ltrh $prefix.prepare.data.log $prefix.plot.log 2>/dev/null
74+
#ls -ltrh $prefix.prepare.data.error $prefix.plot.error 2>/dev/null
75+
if [ -s $prefix.plot.error ];
76+
then
77+
cat $prefix.plot.error
78+
echo -e "\n\n$(tput setaf 1)detail error in file $prefix.plot.error, $(tput setaf 7)\n\n"
79+
date
80+
exit
81+
else
82+
echo -e "\n\n$(tput setaf 2)finished, no error~$(tput setaf 7)\n\n"
83+
fi
84+
date
85+
86+
echo "$(tput setaf 2)output is:$(tput setaf 7)"
87+
ls -thl $prefix.svg $prefix.notitle.svg $prefix.html
88+
echo

bin/env.sh

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
home=$(dirname `readlink -f $BASH_SOURCE`)
2+
home="$home/../"
3+
#echo base is $base
4+
## for perl library
5+
export PERL5LIB=$home/src:$home/src/Imager-1.011/lib64/perl5/:$PERL5LIB ## for perl library
6+
7+
# for samtool
8+
export PATH=/zfssz5/BC_PUB/Software/03.Soft_ALL/samtools-1.7:$PATH
9+
10+
11+
function check_env(){
12+
perl -e 'use Imager::Font'
13+
if [ "$?" == "0" ];
14+
then
15+
echo -e "\nfind Imager::Font"
16+
else
17+
echo -e "\n$(tput setaf 1)error, not find Imager::Font, maybe you should try to re-install perl package Imager::Font(https://cpan.metacpan.org/authors/id/A/AD/ADDI/Imager-0.41.tar.gz) by cpan or manually-install$(tput setaf 7)\n"
18+
fi
19+
dep="samtools sort perl"
20+
for i in $dep
21+
do
22+
$i --help >/dev/null
23+
if [ "$?" != "0" ];
24+
then
25+
echo -e "error: not find $i"
26+
exit
27+
else
28+
j=`which $i`
29+
echo find $j
30+
fi
31+
done
32+
}
33+
34+
check_env

0 commit comments

Comments
 (0)