Skip to content

Commit 19f7612

Browse files
authored
Merge pull request #75 from J35P312/master
2.12.0
2 parents a16c3f9 + d4fc050 commit 19f7612

File tree

5 files changed

+44
-5
lines changed

5 files changed

+44
-5
lines changed

TIDDIT.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
sys.path.insert(0, '{}/src/'.format(wd))
99
import TIDDIT_calling
1010

11-
version = "2.11.0"
11+
version = "2.12.0"
1212
parser = argparse.ArgumentParser("""TIDDIT-{}""".format(version),add_help=False)
1313
parser.add_argument('--sv' , help="call structural variation", required=False, action="store_true")
1414
parser.add_argument('--cov' , help="generate a coverage bed file", required=False, action="store_true")

src/TIDDIT.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ int main(int argc, char **argv) {
4646
int min_variant_size= 100;
4747
int sample = 100000000;
4848
string outputFileHeader ="output";
49-
string version = "2.11.0";
49+
string version = "2.12.0";
5050

5151
//collect all options as a vector
5252
vector<string> arguments(argv, argv + argc);

src/TIDDIT_calling.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,21 @@ def cluster(args):
234234
for chrA in chromosomes:
235235
calls[chrA] =[]
236236
print ("{}".format(chrA))
237+
signals_chrA={}
238+
signals=[ [hit[0],hit[1],hit[2],hit[3],hit[4],hit[5],hit[6],hit[7],hit[8]] for hit in args.c.execute('SELECT chrB,posA,posB,forwardA,qualA,forwardB,qualB,resolution,name FROM TIDDITcall WHERE chrA == \'{}\''.format(chrA)).fetchall()]
239+
237240
for chrB in chromosomes:
238-
signal_data=numpy.array([ [hit[0],hit[1],hit[2],hit[3],hit[4],hit[5],hit[6],hit[7]] for hit in args.c.execute('SELECT posA,posB,forwardA,qualA,forwardB,qualB,resolution,name FROM TIDDITcall WHERE chrA == \'{}\' AND chrB == \'{}\''.format(chrA,chrB)).fetchall()])
241+
if not chrB in signals_chrA:
242+
signals_chrA[chrB] = []
243+
244+
for signal in signals:
245+
signals_chrA[signal[0]].append(signal[1:])
239246

247+
for chrB in signals_chrA:
248+
signals_chrA[chrB]=numpy.array(signals_chrA[chrB])
249+
250+
for chrB in chromosomes:
251+
signal_data=signals_chrA[chrB]
240252
if not len(signal_data):
241253
continue
242254

src/TIDDIT_coverage.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def determine_ploidy(args,chromosomes,coverage_data,Ncontent,library_stats):
8888
print ("make sure that the contigs of the bam file and the reference match")
8989
quit()
9090

91-
if len(cov):
91+
if cov.size:
9292
coverage_norm=numpy.median(cov)
9393
else:
9494
coverage_norm=1
@@ -107,7 +107,11 @@ def determine_ploidy(args,chromosomes,coverage_data,Ncontent,library_stats):
107107
else:
108108
cov=coverage_data[chromosome][numpy.where( (coverage_data[chromosome][:,1] > args.Q) | (coverage_data[chromosome][:,1] == 0) ),0]
109109

110-
chromosomal_average=numpy.median(cov)
110+
if cov.size:
111+
chromosomal_average=numpy.median(cov)
112+
else:
113+
chromosomal_average=0
114+
111115
if not args.force_ploidy:
112116
try:
113117
ploidies[chromosome]=int(round((chromosomal_average)/coverage_norm*args.n))
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
BootStrap: debootstrap
2+
OSVersion: trusty
3+
MirrorURL: http://us.archive.ubuntu.com/ubuntu/
4+
5+
6+
%runscript
7+
echo "This is what happens when you run the container..."
8+
9+
10+
%post
11+
echo "Hello from inside the container"
12+
sed -i 's/$/ universe/' /etc/apt/sources.list
13+
apt-get update
14+
apt-get -y --force-yes install build-essential cmake make zlib1g-dev python python-dev python-setuptools git wget libbz2-dev unzip
15+
easy_install pip
16+
pip install numpy cython
17+
18+
wget https://github.com/SciLifeLab/TIDDIT/archive/TIDDIT-2.12.0.zip
19+
unzip TIDDIT-2.12.0.zip
20+
21+
mv TIDDIT-TIDDIT-2.12.0/* /bin/
22+
cd /bin/ && ./INSTALL.sh
23+
chmod +x /bin/TIDDIT.py

0 commit comments

Comments
 (0)