Skip to content

Commit

Permalink
minor changes in code.
Browse files Browse the repository at this point in the history
  • Loading branch information
ypriverol committed Apr 19, 2024
1 parent 1674870 commit 5e95e81
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pypgatk/commands/blast_get_position.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@click.option('-n', '--number_of_processes', help='Used to specify the number of processes. Default is 40.')

@click.pass_context
def blast_get_position(ctx, config_file, input_psm_to_blast, output_psm, input_reference_database, number_of_processes):
def blast_get_position(ctx, config_file, input_psm_to_blast, output_psm, input_reference_database, number_of_processes):
config_data = None
if config_file is not None:
config_data = read_yaml_from_file(config_file)
Expand Down
1 change: 0 additions & 1 deletion pypgatk/commands/mztab_class_fdr.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"groups e.g. \"{non_canonical:[altorf,pseudo,ncRNA];mutations:[COSMIC,cbiomut];variants:[var_mut,var_rs]}\"")
@click.pass_context
def mztab_class_fdr(ctx, config_file, input_mztab, outfile_name, decoy_prefix, global_fdr_cutoff, class_fdr_cutoff, peptide_groups_prefix):

config_data = None
if config_file is not None:
config_data = read_yaml_from_file(config_file)
Expand Down
25 changes: 14 additions & 11 deletions pypgatk/commands/validate_peptides.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,31 @@

log = logging.getLogger(__name__)

@click.command('validate_peptides', short_help='Command to inspect MS2 spectra of single-subsititution peptide identifications')

@click.command('validate_peptides',
short_help='Command to inspect MS2 spectra of single-subsititution peptide identifications')
@click.option('-c', '--config_file', help='Configuration file for the validate peptides pipeline')
@click.option('-p', '--mzml_path', help='The mzml file path.You only need to use either mzml_path or mzml_files')
@click.option('-f', '--mzml_files', help='The mzml files.Different files are separated by ",".You only need to use either mzml_path or mzml_files')
@click.option('-f', '--mzml_files',
help='The mzml files.Different files are separated by ",".You only need to use either mzml_path or mzml_files')
@click.option('-i', '--infile_name', help='Variant peptide PSMs table')
@click.option('-o', '--outfile_name', help='Output file for the results')
@click.option('-ion', '--ions_tolerance', help='MS2 fragment ions mass accuracy')
@click.option('-n', '--number_of_processes', help='Used to specify the number of processes. Default is 40.')
@click.option('-r', '--relative', help='When using ppm as ions_tolerance (not Da), it needs to be turned on', is_flag=True)
@click.option('-msgf', '--msgf', help='If it is the standard format of MSGF output, please turn on this switch, otherwise it defaults to mzTab format', is_flag=True)

@click.option('-r', '--relative', help='When using ppm as ions_tolerance (not Da), it needs to be turned on',
is_flag=True)
@click.option('-msgf', '--msgf',
help='If it is the standard format of MSGF output, please turn on this switch, otherwise it defaults to mzTab format',
is_flag=True)
@click.pass_context

def validate_peptides(ctx, config_file, mzml_path, mzml_files, infile_name, outfile_name, ions_tolerance, number_of_processes, relative, msgf):
def validate_peptides(ctx, config_file, mzml_path, mzml_files, infile_name, outfile_name, ions_tolerance,
number_of_processes, relative, msgf):
config_data = None
if config_file is not None:
config_data = read_yaml_from_file(config_file)

validate_flag = bool(infile_name and (mzml_path or mzml_files) and outfile_name)
if not validate_flag :
if not validate_flag:
print_help()

pipeline_arguments = {}
Expand All @@ -44,9 +49,7 @@ def validate_peptides(ctx, config_file, mzml_path, mzml_files, infile_name, outf
pipeline_arguments[ValidatePeptidesService.CONFIG_RELATIVE] = relative
if msgf is not None:
pipeline_arguments[ValidatePeptidesService.CONFIG_MSGF] = msgf

validate_peptides_service = ValidatePeptidesService(config_data, pipeline_arguments)
if validate_flag:
validate_peptides_service.validate(infile_name, outfile_name)


0 comments on commit 5e95e81

Please sign in to comment.