Skip to content

Commit

Permalink
Merge pull request #3 from AroneyS/dev
Browse files Browse the repository at this point in the history
Update fork
  • Loading branch information
AroneyS authored Sep 25, 2023
2 parents f6c9bc7 + 022d290 commit 7e88bb5
Show file tree
Hide file tree
Showing 11 changed files with 362 additions and 201 deletions.
47 changes: 46 additions & 1 deletion aviary/aviary.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def main():

qc_group.add_argument(
'--min-mean-q', '--min_mean_q',
help='Minimum mean quality threshold',
help='Minimum long read mean quality threshold',
dest="min_mean_q",
default=10
)
Expand All @@ -340,6 +340,51 @@ def main():
default=100
)

qc_group.add_argument(
'--min-short-read-length', '--min_short_read_length',
help='Minimum length of short reads to be kept',
dest="min_short_read_length",
default=15
)

qc_group.add_argument(
'--max-short-read-length', '--max_short_read_length',
help='Maximum length of short reads to be kept, 0 = no maximum',
dest="max_short_read_length",
default=0
)

qc_group.add_argument(
'--disable-adpater-trimming', '--disable_adpater_trimming',
help='Disable adapter trimming of short reads',
type=str2bool,
nargs='?',
const=True,
dest="disable_adapter_trimming",
default=False
)

qc_group.add_argument(
'--unqualified-percent-limit', '--unqualified_percent_limit',
help='how many percents of bases are allowed to be unqualified. Default 40 means 40 percent',
dest="unqualified_percent_limit",
default=40
)

qc_group.add_argument(
'--quality-cutoff', '--quality_cutoff',
help='The short read quality value that a base is qualified. Default 15 means phred quality >=Q15 is qualified.',
dest="quality_cutoff",
default=15
)

qc_group.add_argument(
'--extra-fastp-params', '--extra_fastp_params',
help='Extra parameters to pass to fastp, supply as a single string e.g. --extra-fastp-params "-V -e 10"',
dest="extra_fastp_params",
default=''
)

qc_group.add_argument(
'--skip-qc', '--skip_qc',
help='Skip quality control steps',
Expand Down
1 change: 1 addition & 0 deletions aviary/envs/minimap2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ channels:
dependencies:
- samtools = 1.9
- minimap2 = 2.18
- fastp
- pigz
19 changes: 19 additions & 0 deletions aviary/modules/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,13 +148,26 @@ def __init__(self,
self.min_mean_q = args.min_mean_q
self.keep_percent = args.keep_percent
self.skip_qc = args.skip_qc
self.min_short_read_size = args.min_short_read_length
self.max_short_read_size = args.max_short_read_length
self.disable_adapter_trimming = args.disable_adapter_trimming
self.unqualified_percent_limit = args.unqualified_percent_limit
self.quality_cutoff = args.quality_cutoff
self.extra_fastp_params = args.extra_fastp_params
except AttributeError:
self.reference_filter = 'none'
self.gold_standard = 'none'
self.min_read_size = 0
self.min_mean_q = 0
self.keep_percent = 100
self.skip_qc = False
self.min_short_read_size = 0
self.max_short_read_size = 0
self.disable_adapter_trimming = False
self.unqualified_percent_limit = 0
self.quality_cutoff = 0
self.extra_fastp_params = 'none'


try:
self.gsa_mappings = args.gsa_mappings
Expand Down Expand Up @@ -321,6 +334,12 @@ def make_config(self):
conf["min_read_size"] = self.min_read_size
conf["min_mean_q"] = self.min_mean_q
conf["keep_percent"] = self.keep_percent
conf["min_short_read_size"] = self.min_short_read_size
conf["max_short_read_size"] = self.max_short_read_size
conf["disable_adapter_trimming"] = self.disable_adapter_trimming
conf["unqualified_percent_limit"] = self.unqualified_percent_limit
conf["quality_cutoff"] = self.quality_cutoff
conf["extra_fastp_params"] = self.extra_fastp_params
conf["skip_qc"] = self.skip_qc
conf["gsa"] = self.gold_standard
conf["gsa_mappings"] = self.gsa_mappings
Expand Down
6 changes: 6 additions & 0 deletions aviary/modules/quality_control/qc.smk
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ rule qc_short_reads:
fastq = "data/short_reads.fastq.gz",
filtered = "data/short_filter.done"
params:
disable_adapter_trimming = config["disable_adapter_trimming"],
min_length = config['min_short_read_size'],
max_length = config['max_short_read_size'],
quality_cutoff = config['quality_cutoff'],
unqualified_percent_limit = config['unqualified_percent_limit'],
extra_fastp_params = config['extra_fastp_params'],
coassemble = config["coassemble"],
reference_filter = [] if "none" in config["reference_filter"] else config["reference_filter"],
skip_qc = config["skip_qc"]
Expand Down
Loading

0 comments on commit 7e88bb5

Please sign in to comment.