Skip to content

Commit

Permalink
Merge pull request #108 from J35P312/master
Browse files Browse the repository at this point in the history
Version 3.6.1
  • Loading branch information
J35P312 authored Jul 21, 2023
2 parents dc15db1 + 807598c commit 0afb2d4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

setup(
name = 'tiddit',
version = '3.6.0',
version = '3.6.1',


url = "https://github.com/SciLifeLab/TIDDIT",
Expand Down
2 changes: 1 addition & 1 deletion tiddit/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import tiddit.tiddit_contig_analysis as tiddit_contig_analysis

def main():
version="3.6.0"
version="3.6.1"
parser = argparse.ArgumentParser("""tiddit-{}""".format(version),add_help=False)
parser.add_argument("--sv" , help="call structural variation", required=False, action="store_true")
parser.add_argument("--cov" , help="generate a coverage bed file", required=False, action="store_true")
Expand Down
19 changes: 18 additions & 1 deletion tiddit/tiddit_variant.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,22 @@ from joblib import Parallel, delayed
from pysam import AlignmentFile, AlignedSegment



def percentile(a, q):
size = len(a)
percentiles=[]

sorted_a=sorted(a)

for v in q:
if not size:
percentiles.append(0)
else:
percentiles.append( sorted_a[ int(math.ceil((size * v) / 100.0)) - 1 ] )

return(percentiles)


def scoring(scoring_dict,percentiles):
score=[0]
if scoring_dict["n_contigs"]:
Expand Down Expand Up @@ -543,7 +559,8 @@ def main(str bam_file_name,dict sv_clusters,args,dict library,int min_mapq,sampl


p=[1,5,10,20,30,40,50,60,70,75,80,85,90,95,97.5,99]
percentiles={"FA":numpy.percentile(ratios["fragments_A"],p),"FB":numpy.percentile(ratios["fragments_B"],p),"RA":numpy.percentile(ratios["reads_A"],p),"RB":numpy.percentile(ratios["reads_B"],p)}

percentiles={"FA":percentile(ratios["fragments_A"],p),"FB":percentile(ratios["fragments_B"],p),"RA":percentile(ratios["reads_A"],p),"RB":percentile(ratios["reads_B"],p)}

for v in variants_list:
for variant in v:
Expand Down

0 comments on commit 0afb2d4

Please sign in to comment.