Skip to content

Commit

Permalink
command
Browse files Browse the repository at this point in the history
  • Loading branch information
zprobot committed Sep 28, 2023
1 parent 9fdc3bf commit d764195
Show file tree
Hide file tree
Showing 9 changed files with 186 additions and 11 deletions.
59 changes: 59 additions & 0 deletions docs/command/AE_or_DE_command.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Generate AE or DE file

## DE
### use case
- PRIDE projet(make sure you have run the `project_command.py`)

```
python differential_expression_command.py
--msstats_file PXD014414.sdrf_openms_design_msstats_in_comparisons.csv
--project_file result/PXD014414.json
--sdrf_file PXD014414.sdrf.tsv
--output_folder result
```

- Non-PRIDE project(Don't not need to run the `project_command.py`)

```
python differential_expression_command.py
--msstats_file PXD014414.sdrf_openms_design_msstats_in_comparisons.csv
--generate_project False
--sdrf_file PXD014414.sdrf.tsv
--output_folder result
```

### Optional parameter
- --fdr_threshold FDR threshold to use to filter the results
- --output_prefix_file Prefix of the df expression file
- --delete_existing Delete existing files in the output folder

## AE
### use case
- PRIDE projet(make sure you have run the `project_command.py`)

```
python absolute_expression_command.py
--ibaq_file PXD004452-ibaq.csv
--project_file result/PXD004452.json
--output_folder result
```

- Non-PRIDE project(Don't not need to run the `project_command.py`)

```
python absolute_expression_command.py
--ibaq_file PXD004452-ibaq.csv
--generate_project False
--output_folder result
```

### Optional parameter
- --output_prefix_file Prefix of the df expression file
- --delete_existing Delete existing files in the output folder







28 changes: 28 additions & 0 deletions docs/command/Feature_command.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generate feature.parquet

## Use cases
- pride projet(make sure you have run the `project_command.py`)

```python
python feature_command.py
--sdrf_file PXD014414.sdrf.tsv
--msstats_file PXD014414.sdrf_openms_design_msstats_in.csv
--mztab_file PXD014414.sdrf_openms_design_openms.mzTab
--output_folder result
```

- Non-PRIDE project(Don't not need to run the `project_command.py`)

```python
python feature_command.py
--sdrf_file PXD014414.sdrf.tsv
--msstats_file PXD014414.sdrf_openms_design_msstats_in.csv
--mztab_file PXD014414.sdrf_openms_design_openms.mzTab
--generate_project False
--output_folder result
```

### Optional parameter
- --use_cache Whether to use disk instead of memory.
- --output_prefix_file The prefix of the result file.
- --consensusxml_file The consensusXML file used to retrieve the mz/rt
46 changes: 46 additions & 0 deletions docs/command/Other_command.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
## generate_spectra_message
### Use case
generate_spectra_message support psm and parquet.
Since the result file is too large, you can specify --partition to split the result file.

```
python generate_spectra_message_command.py
--parquet_path PXD014414-f4fb88f6-0a45-451d-a8a6-b6d58fb83670.psm.parquet
--mzml_directory mzmls
--output_path psm/PXD014414.parquet
--label psm
--partition charge
```

## get_unanimous_name
### use case
get_unanimous_name support parquet and tsv.
For parquet, map_parameter have two option (map_protein_name or map_protein_accession), and the label controls whether it is PSM or Feature.

- parquet
```
python get_unanimous_command.py map-unanimous-for-parquet
--parquet_path PXD014414-f4fb88f6-0a45-451d-a8a6-b6d58fb83670.psm.parquet
--fasta Reference fasta database
--output_path psm/PXD014414.psm.parquet
--map_parameter map_protein_name
--label psm
```

- tsv
```
python get_unanimous_command.py get-unanimous-for-tsv
--path PXD014414-c2a52d63-ea64-4a64-b241-f819a3157b77.differential.tsv
--fasta Reference fasta database
--output_path psm/PXD014414.de.tsv
--map_parameter map_protein_name
```

## compare parquet_of_pqrquet
### use case
```
python parquet_command.py
--parquet_path_one res_lfq2_discache.parquet
--parquet_path_two res_lfq2_no_cache.parquet
--report_path report.txt
```
10 changes: 10 additions & 0 deletions docs/command/Project_command.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Generate project.json

## use case
```
python project_command.py
--project_accession PXD014414
--sdrf PXD014414.sdrf.tsv
--quantms_version 1.12
--output_folder result
```
32 changes: 32 additions & 0 deletions docs/command/Psm_command.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Generate Psm.parquet or compare psm.parquet

## Generate Psm.parquet
### Use cases
- PRIDE projet(make sure you have run the `project_command.py`)

```
python psm_command.py convert-psm-file
--mztab_file PXD014414.sdrf_openms_design_openms.mzTab
--output_folder result
```

- Non-PRIDE project(Don't not need to run the `project_command.py`)

```
python feature_command.py convert-psm-file
--mztab_file PXD014414.sdrf_openms_design_openms.mzTab
--generate_project False
--output_folder result
```

### Optional parameter
- --output_prefix_file The prefix of the result file.
- --verbose Output debug information.

## Compare psm.parquet
### Use case
```
python feature_command.py compare-set-of-psms
--parquets PXD014414-comet.parquet PXD014414-sage.parquet PXD014414-msgf.parquet
--tags comet sage msgf
```
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@click.option(
"--output_folder", help="Folder to generate the df expression file.", required=True
)
@click.option("--output_file", help="Prefix of the df expression file", required=False)
@click.option("--output_prefix_file", help="Prefix of the df expression file", required=False)
@click.option(
"--generate_project",
help="Generate project.json for pride project, Otherwise, False",
Expand All @@ -26,7 +26,7 @@
def convert_ibaq_absolute(
ibaq_file:str,
output_folder: str,
output_file: str,
output_prefix_file: str,
generate_project: bool = True,
delete_existing: bool = True,
project_file:str = None,
Expand All @@ -37,7 +37,7 @@ def convert_ibaq_absolute(
:param ibaq_file: IBAQ file
:param project_file: quantms.io project file
:param output_folder: Folder to generate the df expression file.
:param output_file: Prefix of the df expression file
:param output_prefix_file: Prefix of the df expression file
:param generate_project: "Generate project.json for pride project, Otherwise, False"
:param delete_existing: Delete existing files in the output folder
:return: none
Expand All @@ -48,7 +48,7 @@ def convert_ibaq_absolute(
de_handler.load_ibaq_file(ibaq_file)
de_handler.convert_ibaq_to_quantms(
output_folder=output_folder,
output_file_prefix=output_file,
output_prefix_file_prefix=output_prefix_file,
delete_existing=delete_existing,
)
if generate_project:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
@click.option(
"--output_folder", help="Folder to generate the df expression file.", required=True
)
@click.option("--output_file", help="Prefix of the df expression file", required=False)
@click.option("--output_prefix_file", help="Prefix of the df expression file", required=False)
@click.option(
"--generate_project",
help="Generate project.json for pride project, Otherwise, False",
Expand All @@ -38,7 +38,7 @@ def convert_msstats_differential(
sdrf_file: str,
fdr_threshold: float,
output_folder: str,
output_file: str,
output_prefix_file: str,
generate_project: bool= True,
delete_existing: bool=True,
project_file: str = None,
Expand All @@ -50,7 +50,7 @@ def convert_msstats_differential(
:param project_file: quantms.io project file
:param sdrf_file: the SDRF file needed to extract some of the metadata
:param output_folder: Folder to generate the df expression file.
:param output_file: Prefix of the df expression file
:param output_prefix_file: Prefix of the df expression file
:param delete_existing: Delete existing files in the output folder
:param fdr_threshold: FDR threshold to use to filter the results
:param generate_project: "Generate project.json for pride project, Otherwise, False"
Expand All @@ -68,7 +68,7 @@ def convert_msstats_differential(
de_handler.set_fdr_threshold(fdr_threshold=fdr_threshold)
de_handler.convert_msstats_to_quantms(
output_folder=output_folder,
output_file_prefix=output_file,
output_file_prefix=output_prefix_file,
delete_existing=delete_existing,
)
if generate_project:
Expand Down
4 changes: 2 additions & 2 deletions python/quantmsio/quantms_io/commands/get_unanimous_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#parquet
@click.command(
"map_protein_name_for_parquet", short_help="According fasta database to map the proteins accessions to uniprot names."
"map-unanimous-for-parquet", short_help="According fasta database to map the proteins accessions to uniprot names."
)
@click.option('--parquet_path', help='Psm or feature parquet path')
@click.option('--fasta', help='Reference fasta database')
Expand All @@ -27,7 +27,7 @@ def get_unanimous_for_parquet(parquet_path,fasta,output_path,map_parameter,label

# tsv
@click.command(
"map_protein_name_for_de_or_ae", short_help="According fasta database to map the proteins accessions to uniprot names."
"get-unanimous-for-tsv", short_help="According fasta database to map the proteins accessions to uniprot names."
)
@click.option('--path', help='ae or de path')
@click.option('--fasta', help='Reference fasta database')
Expand Down
2 changes: 1 addition & 1 deletion python/quantmsio/quantms_io/commands/psm_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def convert_psm_file(mztab_file: str, output_folder: str,generate_project:bool =


@click.command(
"compare-psm-parquet", short_help="plot venn for a set of Psms parquet"
"compare-set-of-psms", short_help="plot venn for a set of Psms parquet"
)
@click.option('--parquets', type=str, help='List of psm parquet path', multiple=True)
@click.option('--tags', type=str, help='List of parquet label', multiple=True)
Expand Down

0 comments on commit d764195

Please sign in to comment.