Skip to content

Commit

Permalink
Merge pull request #30 from UMCUGenetics/release/v1.4.0
Browse files Browse the repository at this point in the history
v1.4.0
  • Loading branch information
rernst authored Aug 16, 2021
2 parents 9d6f9a0 + b060c56 commit 66a255f
Show file tree
Hide file tree
Showing 27 changed files with 928 additions and 206 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,6 @@ ENV/

# Mac OS
.DS_Store

# temp scripts
tmp
106 changes: 81 additions & 25 deletions clarity_epp.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,18 @@ def export_manual_pipetting(args):
clarity_epp.export.manual_pipetting.samplesheet_multiplex_library_pool(lims, args.process_id, args.output_file)
elif args.type == 'multiplex_sequence_pool':
clarity_epp.export.manual_pipetting.samplesheet_multiplex_sequence_pool(lims, args.process_id, args.output_file)
elif args.type == 'normalization':
clarity_epp.export.manual_pipetting.samplesheet_normalization(lims, args.process_id, args.output_file)
elif args.type == 'capture':
clarity_epp.export.manual_pipetting.samplesheet_capture(lims, args.process_id, args.output_file)
elif args.type == 'exonuclease':
clarity_epp.export.manual_pipetting.sammplesheet_exonuclease(lims, args.process_id, args.output_file)
elif args.type == 'pcr_exonuclease':
clarity_epp.export.manual_pipetting.sammplesheet_pcr_exonuclease(lims, args.process_id, args.output_file)
elif args.type == 'mip_multiplex_pool':
clarity_epp.export.manual_pipetting.samplesheet_mip_multiplex_pool(lims, args.process_id, args.output_file)
elif args.type == 'mip_dilute_pool':
clarity_epp.export.manual_pipetting.samplesheet_mip_pool_dilution(lims, args.process_id, args.output_file)


def export_ped_file(args):
Expand All @@ -82,10 +94,17 @@ def export_merge_file(args):


def export_removed_samples(args):
"""Export removed sampels table."""
"""Export removed samples table."""
clarity_epp.export.sample.removed_samples(lims, args.output_file)


def export_sample_indications(args):
"""Export sample indication table."""
clarity_epp.export.sample.sample_indications(
lims, args.output_file, args.artifact_name, args.sequencing_run, args.sequencing_run_project
)


def export_tapestation(args):
"""Export samplesheets for Tapestation machine."""
clarity_epp.export.tapestation.samplesheet(lims, args.process_id, args.output_file)
Expand Down Expand Up @@ -183,13 +202,18 @@ def placement_complete_step(args):
subparser = parser.add_subparsers()

output_parser = argparse.ArgumentParser(add_help=False)
output_parser.add_argument('-o', '--output_file', nargs='?', type=argparse.FileType('w'), default=sys.stdout, help='Output file path (default=stdout)')
output_parser.add_argument(
'-o', '--output_file', nargs='?', type=argparse.FileType('w'), default=sys.stdout,
help='Output file path (default=stdout)'
)

# export
parser_export = subparser.add_parser('export', help='Export from lims.')
parser_export = subparser.add_parser('export', help='Export from lims')
subparser_export = parser_export.add_subparsers()

parser_export_bioanalyzer = subparser_export.add_parser('bioanalyzer', help='Create bioanalyzer samplesheets', parents=[output_parser])
parser_export_bioanalyzer = subparser_export.add_parser(
'bioanalyzer', help='Create bioanalyzer samplesheets', parents=[output_parser]
)
parser_export_bioanalyzer.add_argument('process_id', help='Clarity lims process id')
parser_export_bioanalyzer.set_defaults(func=export_bioanalyzer)

Expand All @@ -203,47 +227,77 @@ def placement_complete_step(args):
parser_export_email.add_argument('process_id', help='Clarity lims process id')
parser_export_email.set_defaults(func=export_email)

parser_export_hamilton = subparser_export.add_parser('hamilton', help='Create hamilton samplesheets', parents=[output_parser])
parser_export_hamilton = subparser_export.add_parser(
'hamilton', help='Create hamilton samplesheets', parents=[output_parser]
)
parser_export_hamilton.add_argument('type', choices=['filling_out', 'purify'], help='Samplesheet type')
parser_export_hamilton.add_argument('process_id', help='Clarity lims process id')
parser_export_hamilton.set_defaults(func=export_hamilton)

parser_export_illumina = subparser_export.add_parser('illumina', help='Export updated illumina samplesheet.', parents=[output_parser])
parser_export_illumina = subparser_export.add_parser(
'illumina', help='Export updated illumina samplesheet', parents=[output_parser]
)
parser_export_illumina.add_argument('process_id', help='Clarity lims process id')
parser_export_illumina.add_argument('artifact_id', help='Clarity lims samplesheet artifact id')
parser_export_illumina.set_defaults(func=export_illumina)

parser_export_labels = subparser_export.add_parser('labels', help='Export container labels.', parents=[output_parser])
parser_export_labels = subparser_export.add_parser('labels', help='Export container labels', parents=[output_parser])
parser_export_labels.add_argument('type', choices=['container', 'container_sample', 'storage_location'], help='Label type')
parser_export_labels.add_argument('process_id', help='Clarity lims process id')
parser_export_labels.add_argument('-d', '--description', nargs='?', help='Container name description')
parser_export_labels.set_defaults(func=export_labels)

parser_export_manual_pipetting = subparser_export.add_parser('manual', help='Create manual pipetting _exports', parents=[output_parser])
parser_export_manual_pipetting.add_argument('type', choices=['purify', 'dilute_library_pool', 'multiplex_library_pool', 'multiplex_sequence_pool'], help='Samplesheet type')
parser_export_manual_pipetting = subparser_export.add_parser(
'manual', help='Create manual pipetting exports', parents=[output_parser]
)
parser_export_manual_pipetting.add_argument(
'type',
choices=[
'purify', 'dilute_library_pool', 'multiplex_library_pool', 'multiplex_sequence_pool', 'normalization',
'capture', 'exonuclease', 'pcr_exonuclease', 'mip_multiplex_pool', 'mip_dilute_pool'
],
help='Samplesheet type'
)
parser_export_manual_pipetting.add_argument('process_id', help='Clarity lims process id')
parser_export_manual_pipetting.set_defaults(func=export_manual_pipetting)

parser_export_merge = subparser_export.add_parser('merge', help='Export merge file.', parents=[output_parser])
parser_export_merge = subparser_export.add_parser('merge', help='Export merge file', parents=[output_parser])
parser_export_merge.add_argument('process_id', help='Clarity lims process id')
parser_export_merge.set_defaults(func=export_merge_file)

parser_export_ped = subparser_export.add_parser('ped', help='Export ped file.', parents=[output_parser])
parser_export_ped = subparser_export.add_parser('ped', help='Export ped file', parents=[output_parser])
parser_export_ped.add_argument('process_id', help='Clarity lims process id')
parser_export_ped.set_defaults(func=export_ped_file)

parser_export_removed_samples = subparser_export.add_parser('removed_samples', help='Export removed sampels table.', parents=[output_parser])
parser_export_removed_samples = subparser_export.add_parser(
'removed_samples', help='Export removed samples table', parents=[output_parser]
)
parser_export_removed_samples.set_defaults(func=export_removed_samples)

parser_export_tapestation = subparser_export.add_parser('tapestation', help='Create tapestation samplesheets', parents=[output_parser])
parser_export_sample_indications = subparser_export.add_parser(
'sample_indications', help='Export sample indication table.', parents=[output_parser]
)
parser_export_sample_indications_group = parser_export_sample_indications.add_mutually_exclusive_group(required=True)
parser_export_sample_indications_group.add_argument('-a', '--artifact_name', help='Artifact name')
parser_export_sample_indications_group.add_argument('-r', '--sequencing_run', help='Sequencing run name')
parser_export_sample_indications.add_argument(
'-p', '--sequencing_run_project', nargs='?', help='Sequencing run project name'
)
parser_export_sample_indications.set_defaults(func=export_sample_indications)

parser_export_tapestation = subparser_export.add_parser(
'tapestation', help='Create tapestation samplesheets', parents=[output_parser]
)
parser_export_tapestation.add_argument('process_id', help='Clarity lims process id')
parser_export_tapestation.set_defaults(func=export_tapestation)

parser_export_tecan = subparser_export.add_parser('tecan', help='Create tecan samplesheets', parents=[output_parser])
parser_export_tecan.add_argument('process_id', help='Clarity lims process id')
parser_export_tecan.set_defaults(func=export_tecan)

parser_export_workflow = subparser_export.add_parser('workflow', help='Export workflow result file.', parents=[output_parser])
parser_export_workflow = subparser_export.add_parser(
'workflow', help='Export workflow result file', parents=[output_parser]
)
parser_export_workflow.add_argument('type', choices=['all', 'lab', 'data_analysis'], help='Workflow type')
parser_export_workflow.add_argument('process_id', help='Clarity lims process id')
parser_export_workflow.set_defaults(func=export_workflow)
Expand All @@ -269,48 +323,50 @@ def placement_complete_step(args):
parser_upload_tecan.set_defaults(func=upload_tecan_results)

# QC
parser_qc = subparser.add_parser('qc', help='Set QC values/flags.')
parser_qc = subparser.add_parser('qc', help='Set QC values/flags')
subparser_qc = parser_qc.add_subparsers()

parser_qc_fragment_length = subparser_qc.add_parser('fragment_length', help='Set fragment length qc flag.')
parser_qc_fragment_length = subparser_qc.add_parser('fragment_length', help='Set fragment length qc flag')
parser_qc_fragment_length.add_argument('process_id', help='Clarity lims process id')
parser_qc_fragment_length.set_defaults(func=qc_fragment_length)

parser_qc_illumina = subparser_qc.add_parser('illumina', help='Set average % Bases >=Q30.')
parser_qc_illumina = subparser_qc.add_parser('illumina', help='Set average % Bases >=Q30')
parser_qc_illumina.add_argument('process_id', help='Clarity lims process id')
parser_qc_illumina.set_defaults(func=qc_illumina)

parser_qc_qubit = subparser_qc.add_parser('qubit', help='Set qubit qc flag.')
parser_qc_qubit = subparser_qc.add_parser('qubit', help='Set qubit qc flag')
parser_qc_qubit.add_argument('process_id', help='Clarity lims process id')
parser_qc_qubit.set_defaults(func=qc_qubit)

# placement
parser_placement = subparser.add_parser('placement', help='Container placement functions.')
parser_placement = subparser.add_parser('placement', help='Container placement functions')
subparser_placement = parser_placement.add_subparsers()

parser_placement_automatic = subparser_placement.add_parser('copy', help='Copy container layout from previous step.')
parser_placement_automatic = subparser_placement.add_parser('copy', help='Copy container layout from previous step')
parser_placement_automatic.add_argument('process_id', help='Clarity lims process id')
parser_placement_automatic.set_defaults(func=placement_automatic)

parser_placement_artifact = subparser_placement.add_parser('artifact', help='Change artifact name to sequence name.')
parser_placement_artifact = subparser_placement.add_parser('artifact', help='Change artifact name to sequence name')
parser_placement_artifact.add_argument('type', choices=['sequence_name', 'run_id'], help='Check type')
parser_placement_artifact.add_argument('process_id', help='Clarity lims process id')
parser_placement_artifact.set_defaults(func=placement_artifact_set_name)

parser_placement_route_artifact = subparser_placement.add_parser('route_artifact', help='Route artifact to a workflow.')
parser_placement_route_artifact = subparser_placement.add_parser('route_artifact', help='Route artifact to a workflow')
parser_placement_route_artifact.add_argument('process_id', help='Clarity lims process id')
parser_placement_route_artifact.set_defaults(func=placement_route_artifact)

parser_placement_barcode = subparser_placement.add_parser('barcode_check', help='Check barcode clarity_epp.placement.')
parser_placement_barcode = subparser_placement.add_parser('barcode_check', help='Check barcode clarity_epp.placement')
parser_placement_barcode.add_argument('type', choices=['check_family'], help='Check type')
parser_placement_barcode.add_argument('process_id', help='Clarity lims process id')
parser_placement_barcode.set_defaults(func=placement_barcode)

parser_placement_complete_step = subparser_placement.add_parser('complete_step', help='Complete step Dx Mark protocol complete.')
parser_placement_complete_step = subparser_placement.add_parser(
'complete_step', help='Complete step Dx Mark protocol complete'
)
parser_placement_complete_step.add_argument('process_id', help='Clarity lims process id')
parser_placement_complete_step.set_defaults(func=placement_complete_step)

parser_placement_unpooling = subparser_placement.add_parser('unpooling', help='Unpooling of sequencing pool.')
parser_placement_unpooling = subparser_placement.add_parser('unpooling', help='Unpooling of sequencing pool')
parser_placement_unpooling.add_argument('process_id', help='Clarity lims process id')
parser_placement_unpooling.set_defaults(func=placement_unpooling)

Expand Down
26 changes: 13 additions & 13 deletions clarity_epp/export/__init__.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
"""Export functions."""

import bioanalyzer
import caliper
import email
import hamilton
import illumina
import labels
import manual_pipetting
import merge
import ped
import sample
import tapestation
import tecan
import workflow
import clarity_epp.export.bioanalyzer
import clarity_epp.export.caliper
import clarity_epp.export.email
import clarity_epp.export.hamilton
import clarity_epp.export.illumina
import clarity_epp.export.labels
import clarity_epp.export.manual_pipetting
import clarity_epp.export.merge
import clarity_epp.export.ped
import clarity_epp.export.sample
import clarity_epp.export.tapestation
import clarity_epp.export.tecan
import clarity_epp.export.workflow
Loading

0 comments on commit 66a255f

Please sign in to comment.