Skip to content

Commit

Permalink
add eps from clustering to config
Browse files Browse the repository at this point in the history
  • Loading branch information
kriese committed Jun 3, 2022
1 parent 322143d commit 3f72d5c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ alternative_haplotype_vcf: # str
# path to liftover directory (explained below)
liftover_root: # str, defaults to 'resources/references/liftover'

clustering:
eps: 0.6 # float, the higher the bigger the clusters can be

# Settings for the pairwise alignment
pw_alignment:
match: # positive integer
Expand Down
3 changes: 3 additions & 0 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ pw_alignment:
gap: -1
mismatch: -1

clustering:
eps: 0.6 # float, the higher the bigger the clusters can be

samples: ['17_08']

# display names and file names of the used references
Expand Down
4 changes: 3 additions & 1 deletion workflow/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,11 @@ rule cluster:
sequences = "results/{sample}/{region}/sequences.fa"
output:
clustering = "results/{sample}/{region}/clustering.txt"
params:
eps = config['clustering']['eps']
shell:
"""
python workflow/scripts/read_cluster.py cluster {input.sequences} {input.dists} -o {output.clustering}
python workflow/scripts/read_cluster.py cluster {input.sequences} {input.dists} --eps {params.eps} -o {output.clustering}
"""

rule pca_plot:
Expand Down
2 changes: 1 addition & 1 deletion workflow/scripts/read_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ def parse_args():
cluster_parser = subparsers.add_parser('cluster', help="Cluster reads by distance.")
cluster_parser.add_argument("sequences", type=Path)
cluster_parser.add_argument("distances", type=Path)
cluster_parser.add_argument("--eps", type=float, default=0.15)
cluster_parser.add_argument("--min_samples", type=int, default=5)
cluster_parser.add_argument("--eps", type=float, default=0.3)
cluster_parser.add_argument("--output", "-o", type=Path, default=None)

plot_parser = subparsers.add_parser('plot', help="Plot the clustering in a PCA plot (2D).")
Expand Down

0 comments on commit 3f72d5c

Please sign in to comment.