Skip to content

Commit

Permalink
switch to impg latest, add rule to output node length
Browse files Browse the repository at this point in the history
  • Loading branch information
davidebolo1993 committed Jan 8, 2025
1 parent dcac331 commit dee91a4
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 444 deletions.
11 changes: 1 addition & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,6 @@ RUN wget https://github.com/samtools/samtools/releases/download/1.21/samtools-1.
&& cd .. \
&& rm -rf samtools-1.21

##install strobealign
RUN git clone https://github.com/ksahlin/strobealign \
&& cd strobealign \
&& cmake -B build -DCMAKE_C_FLAGS="-msse4.2" -DCMAKE_CXX_FLAGS="-msse4.2" \
&& cmake --build build -j 8 \
&& cd ..

ENV PATH /opt/strobealign/build:$PATH

##install bwa-mem
RUN git clone https://github.com/lh3/bwa.git \
&& cd bwa \
Expand Down Expand Up @@ -158,7 +149,7 @@ RUN git clone https://github.com/AndreaGuarracino/gfainject \
##install impg
RUN git clone https://github.com/pangenome/impg \
&& cd impg \
&& git checkout 37b18e18123d92fa5fa824a4e15d8aa7cad3b6db \
&& git checkout 15248982d5a873b36e5fe4547b265f9f172cfb54 \
&& cargo install --force --path . \
&& cp target/release/impg ../impg-tmp \
&& cd .. \
Expand Down
1 change: 1 addition & 0 deletions cosigt_smk/workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ for region in config['region']:
cosigt_input.append(config['output'] + '/cosigt/'+ sample + '/' + region + '/cosigt_genotype.tsv')
cosigt_input.append(config['output'] + '/bwa-mem2/'+ sample + '/' + region + '.realigned.bam.all.pdf')
cosigt_input.append(config['output'] + '/odgi/viz/' + region + '.png')
cosigt_input.append(config['output'] + '/odgi/view/' + region + '.node.length.tsv')
if region in config['annotations']:
cosigt_input.append(config['output'] + '/odgi/untangle/' + region + '.gggenes.pdf')

Expand Down
2 changes: 1 addition & 1 deletion cosigt_smk/workflow/envs/impg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ channels:
- conda-forge
- bioconda
dependencies:
- impg=0.2.2
- impg=0.2.3
3 changes: 2 additions & 1 deletion cosigt_smk/workflow/rules/gafpack.smk
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ rule gafpack_coverage:
gafpack \
--gfa {input.gfa} \
--gaf {input.gaf} \
--len-scale --weight-queries | gzip > {output}
--len-scale \
--weight-queries | gzip > {output}
'''
1 change: 1 addition & 0 deletions cosigt_smk/workflow/rules/impg.smk
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ rule impg_project:
shell:
'''
impg \
query \
-p {input.paf} \
-b {input.bed} | \
grep -v \
Expand Down
31 changes: 3 additions & 28 deletions cosigt_smk/workflow/rules/odgi.smk
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ rule odgi_paths_matrix:
cut -f 1,4- | gzip > {output}
'''

rule odgi_view_len:
rule odgi_view_node_length:
'''
https://github.com/pangenome/odgi
'''
input:
rules.odgi_view.output
output:
config['output'] + '/odgi/view/{region}.len.tsv'
config['output'] + '/odgi/view/{region}.node.length.tsv'
threads:
1
resources:
Expand All @@ -96,38 +96,13 @@ rule odgi_view_len:
conda:
'../envs/odgi.yaml'
benchmark:
'benchmarks/{region}.odgi_view_len.benchmark.txt'
'benchmarks/{region}.odgi_view_node_length.benchmark.txt'
shell:
'''
grep '^S' {input} | \
awk '{{print("node."$2,length($3))}}' OFS="\\t" > {output}
'''

rule filter_odgi_matrix:
'''
https://github.com/davidebolo1993/cosigt
'''
input:
coverage=rules.odgi_chop.output,
size=rules.odgi_view_len.output
output:
config['output'] + '/odgi/paths/matrix_flt/{region}.tsv.gz'
threads:
1
resources:
mem_mb=lambda wildcards, attempt: attempt * config['default']['mem_mb'],
time=lambda wildcards, attempt: attempt * config['default']['time']
container:
'docker://davidebolo1993/cosigt_workflow:latest'
#conda:
#'../envs/odgi.yaml'
benchmark:
'benchmarks/{region}.filter_odgi_matrix.benchmark.txt'
shell:
'''
flt {input.coverage} {input.size} | gzip > {output}
'''

rule odgi_similarity:
'''
https://github.com/pangenome/odgi
Expand Down
51 changes: 0 additions & 51 deletions cosigt_smk/workflow/scripts/cluster2.r

This file was deleted.

Loading

0 comments on commit dee91a4

Please sign in to comment.