Skip to content

Commit b14f394

Browse files
committed
modified: INSTALL.sh
modified: TIDDIT.py modified: src/TIDDIT.cpp modified: src/TIDDIT_calling.py modified: src/TIDDIT_coverage.py
1 parent 15d471e commit b14f394

File tree

5 files changed

+22
-6
lines changed

5 files changed

+22
-6
lines changed

INSTALL.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ cd build
33
cmake ..
44
make
55
cd ..
6-
pip install numpy cython
6+
#pip install numpy cython
77
cd src
88
python setup.py build_ext --inplace

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))

0 commit comments

Comments
 (0)