Skip to content

Commit

Permalink
Merge pull request #397 from pangenome/fix_hg_filter_ani_diff
Browse files Browse the repository at this point in the history
Be smoother with the ANI filter in the mapping step
  • Loading branch information
AndreaGuarracino authored May 5, 2024
2 parents a8cb62d + 1b2e5f9 commit 02227ae
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
13 changes: 10 additions & 3 deletions partition-before-pggb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ SEGMENT_LENGTH=5000
MAP_PCT_ID=90
MASH_KMER=19
MASH_KMER_THRES=0.001
HG_FILTER_ANI_DIFF=30

# wfmash's parameters
input_fasta=false
Expand All @@ -21,7 +20,7 @@ no_splits=false
sparse_map=false
mash_kmer=$MASH_KMER
mash_kmer_thres=$MASH_KMER_THRES
hg_filter_ani_diff=$HG_FILTER_ANI_DIFF
hg_filter_ani_diff=false
exclude_delim="#"

# seqwish's default values
Expand Down Expand Up @@ -347,6 +346,15 @@ if [[ $block_length == false ]]; then
block_length=$(echo "$segment_length * 5" | bc)
fi

if [[ $hg_filter_ani_diff == false ]]; then
if [[ $map_pct_id -ge 90 ]]; then
hg_filter_ani_diff=30
elif [[ $map_pct_id -lt 90 && $map_pct_id -ge 80 ]]; then
hg_filter_ani_diff=10
else
hg_filter_ani_diff=0
fi
fi

paf_spec=$mapper_letter-s$segment_length-l$block_length-p$map_pct_id-n$n_mappings-K$mash_kmer-F$mash_kmer_thres-x$sparse_map-g$hg_filter_ani_diff

Expand Down Expand Up @@ -483,7 +491,6 @@ general:
compress: $compress
threads: $threads
poa_threads: $poa_threads
respect_pansn: $respect_pansn
$mapper:
version: $mapper_version
segment-length: $segment_length
Expand Down
13 changes: 10 additions & 3 deletions pggb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ SEGMENT_LENGTH=5000
MAP_PCT_ID=90
MASH_KMER=19
MASH_KMER_THRES=0.001
HG_FILTER_ANI_DIFF=30

# wfmash's parameters
input_fasta=false
Expand All @@ -21,7 +20,7 @@ no_splits=false
sparse_map=false
mash_kmer=$MASH_KMER
mash_kmer_thres=$MASH_KMER_THRES
hg_filter_ani_diff=$HG_FILTER_ANI_DIFF
hg_filter_ani_diff=false
exclude_delim="#"

# seqwish's default values
Expand Down Expand Up @@ -347,6 +346,15 @@ if [[ $block_length == false ]]; then
block_length=$(echo "$segment_length * 5" | bc)
fi

if [[ $hg_filter_ani_diff == false ]]; then
if [[ $map_pct_id -ge 90 ]]; then
hg_filter_ani_diff=30
elif [[ $map_pct_id -lt 90 && $map_pct_id -ge 80 ]]; then
hg_filter_ani_diff=10
else
hg_filter_ani_diff=0
fi
fi

paf_spec=$mapper_letter-s$segment_length-l$block_length-p$map_pct_id-n$n_mappings-K$mash_kmer-F$mash_kmer_thres-x$sparse_map-g$hg_filter_ani_diff

Expand Down Expand Up @@ -483,7 +491,6 @@ general:
compress: $compress
threads: $threads
poa_threads: $poa_threads
respect_pansn: $respect_pansn
$mapper:
version: $mapper_version
segment-length: $segment_length
Expand Down

0 comments on commit 02227ae

Please sign in to comment.