Skip to content

Commit

Permalink
WES -> capseq, WES is a specific type of capture sequencing.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShujiaHuang committed Dec 5, 2023
1 parent 25ec767 commit ec83b52
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
8 changes: 4 additions & 4 deletions ilus/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# Import specific functions of ilus
from ilus.pipeline import (
create_wgs_pipeline_command, create_wes_pipeline_command, WGS,
create_wgs_pipeline_command, create_capseq_pipeline_command, WGS,
create_genotype_joint_calling_command, genotypeGVCFs,
create_vqsr_command, variantrecalibrator
)
Expand Down Expand Up @@ -93,7 +93,7 @@ def parse_commandline_args():
create_wgs_pipeline_command(commands)

# The arguments for the whole pipeline of WES.
create_wes_pipeline_command(commands)
create_capseq_pipeline_command(commands)

# The arguments for joint-calling process
create_genotype_joint_calling_command(commands)
Expand Down Expand Up @@ -131,8 +131,8 @@ def run_command(args):
aione = {"config": load_config(args.sysconf)}
WGS(args, aione)

# Create WES pipeline. WES could re-use the same processes of WGS.
elif args.command == "WES":
elif args.command == "capseq":
# Create pipeline for capture-sequencing. WES is one kind of capture sequencing.
aione = {"config": load_config(args.sysconf)}
WGS(args, aione, is_capture_seq=True)

Expand Down
2 changes: 1 addition & 1 deletion ilus/pipeline/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from ._command_args import (
create_wgs_pipeline_command,
create_wes_pipeline_command,
create_capseq_pipeline_command,
create_genotype_joint_calling_command,
create_vqsr_command
)
Expand Down
16 changes: 9 additions & 7 deletions ilus/pipeline/_command_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,25 +145,27 @@ def create_wgs_pipeline_command(commands):
return wgs_cmd


def create_wes_pipeline_command(commands):
def create_capseq_pipeline_command(commands):
"""All the arguments for creating WES pipeline."""
# Todo: 思考要不要把这个参数改为 capseq,意思就是这个功能泛化为捕获测序数据分析流程,WES 只是捕获测序的一个特例?
wes_cmd = _add_germline_short_variant_discovery_argument(
capseq_cmd = _add_germline_short_variant_discovery_argument(
commands.add_parser(
"WES",
"capseq",
parents=[_parent_parser()],
help="Create pipeline scripts for WES (from FASTQ to genotype VCF).")
help="Create pipeline scripts for capture sequencing data (from FASTQ to genotype VCF). "
"Whole-exome sequencing (WES) belong to capture sequencing, which only captures "
"the coding regions of the genome.")
)

wes_cmd.add_argument(
capseq_cmd.add_argument(
"--capture-interval",
dest="interval", # WES capture region file (BED/Picard,1-based)
type=str,
required=True,
help="WES capture intervals: string or file (BED/Picard)"
help="Capture intervals, must be a file path: (BED/Picard) file"
)

return wes_cmd
return capseq_cmd


def create_genotype_joint_calling_command(commands):
Expand Down
3 changes: 2 additions & 1 deletion ilus/pipeline/_germline_short_variant_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ def _fetch_calling_variants_interval(kwargs, aione: dict = None, is_capture_seq:
if is_capture_seq:
# 如果是 capture sequence 比如 WES,把该文件记录起来,该 key 只为种情况而添加。
if (type(kwargs.interval) is not str) or (not Path(kwargs.interval).is_file()):
sys.stderr.write(f"[Error] --capture-interval must be a file, but got {kwargs.interval}\n")
sys.stderr.write(f"[Error] --capture-interval must be a file, "
f"but got {kwargs.interval}\n")
sys.exit(1)

aione["config"]["capture_interval_file"] = kwargs.interval
Expand Down
4 changes: 2 additions & 2 deletions tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ ilus WGS -c -n my_wgs -C ilus_sys.yaml -I sample_fastq.list -O ./tmp --use-senti
ilus WGS -c -n my_wgs -C ilus_sys.yaml -I sample_fastq.list -O ./tmp -f --interval human_GRCh38.calling_interval.bed

## WES
ilus WES -c -n my_wgs -C ilus_sys.yaml -I sample_fastq.list --capture-interval human_GRCh38.calling_interval.bed -O ./tmp -f
ilus WES -c -n my_wgs -C ilus_sys.yaml -I sample_fastq.list --capture-interval human_GRCh38.calling_interval.bed -O ./tmp -f --use-sentieon
ilus capseq -c -n my_wgs -C ilus_sys.yaml -I sample_fastq.list --capture-interval wes.test_interval.bed -O ./tmp -f
ilus capseq -c -n my_wgs -C ilus_sys.yaml -I sample_fastq.list --capture-interval wes.test_interval.bed -O ./tmp -f --use-sentieon

0 comments on commit ec83b52

Please sign in to comment.