Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fastp and update docs #154

Merged
merged 6 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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