Skip to content

Commit

Permalink
bugfix for large D in cigars
Browse files Browse the repository at this point in the history
  • Loading branch information
baraaorabi committed Apr 7, 2021
1 parent 0285eb8 commit b8f8dbb
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 107 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ Align takes the following arguments:
### Isoforms

```
py/freddie_isoforms.py --segment-dir {SEGMENT} --cluster-dir {CLUSTER} --output {ISOFORMS.GTF} -t {threads}
py/freddie_isoforms.py --split-dir {SPLIT} --cluster-dir {CLUSTER} --output {ISOFORMS.GTF} -t {threads}
```

Align takes the following arguments:

- `--segment-dir/-s`: `SEGMENT` output directory of the segment stage
- `--cluster-dir/-s`: `CLUSTER` output directory of the cluster stage
- `--split-dir/-s`: `SPLIT` output directory of the segment stage
- `--cluster-dir/-c`: `CLUSTER` output directory of the cluster stage
- `--output/-o`: Output GTF file of isoforms stage. Default: `freddie_isoforms.gtf`
- `--threads/-t`: Number of threads. Default: 1

Expand Down
4 changes: 2 additions & 2 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ rule cluster:
rule isoforms:
input:
script = config['exec']['isoforms'],
segment = '{}/{{sample}}/freddie.segment'.format(output_d),
split = '{}/{{sample}}/freddie.split'.format(output_d),
cluster = '{}/{{sample}}/freddie.cluster'.format(output_d),
output:
isoforms = protected('{}/{{sample}}/freddie.isoforms.gtf'.format(output_d)),
Expand All @@ -112,4 +112,4 @@ rule isoforms:
mem = "16G",
time = 359,
shell:
'{input.script} -s {input.segment} -c {input.cluster} -o {output.isoforms} -t {threads}'
'{input.script} -s {input.split} -c {input.cluster} -o {output.isoforms} -t {threads}'
2 changes: 1 addition & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ outpath:

gurobi:
license: gurobi.lic
timeout: 15
timeout: 1

exec:
split : py/freddie_split.py
Expand Down
98 changes: 0 additions & 98 deletions py/freddie_align.py

This file was deleted.

Empty file modified py/freddie_isoforms.py
100755 → 100644
Empty file.
4 changes: 2 additions & 2 deletions py/freddie_segment.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,8 @@ def get_unaligned_gaps_and_polyA(read, segs):
(_, l_seg_idx) = intervals[-1]
end = segs[l_seg_idx][1]
q_esc_pos, _ = get_interval_end(end=end, read=read)
assert 0 <= q_ssc_pos < q_esc_pos <= read['length'], (
q_ssc_pos, q_esc_pos, read['length'], start, end, read)
assert 0 <= q_ssc_pos <= q_esc_pos <= read['length'], (
q_ssc_pos, q_esc_pos, read['length'], start, end, segs, read)
s_polys = list()
for char in ['A', 'T']:
s = 0
Expand Down
3 changes: 2 additions & 1 deletion py/freddie_split.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ def get_intervals(aln):

for t, c in cigar:
assert(0 <= t < 10)
for t, c in cigar:
if t in target_consuming:
tend += c
qstart_c = qstart
Expand All @@ -153,6 +152,8 @@ def get_intervals(aln):
intervals = list()
interval_cigar = list()
for t, c in cigar:
if t == pysam.CDEL and c > 20:
t = pysam.CREF_SKIP
if t in exon_consuming:
interval_cigar.append((t, c))
if t == pysam.CDEL:
Expand Down

0 comments on commit b8f8dbb

Please sign in to comment.