Skip to content

Commit

Permalink
minor errors fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
matin authored and matin committed Jul 24, 2024
1 parent 8352ecf commit 6bf5ab2
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 14 deletions.
5 changes: 3 additions & 2 deletions src/api/comp_control_method.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

functionality:
namespace: "control_methods"
info:
Expand All @@ -15,9 +16,9 @@ functionality:
- name: --layer
type: string
direction: input
default: lognorm
default: scgen_pearson
description: Which layer of pertubation data to use to find tf-gene relationships.
required: true
required: false
- name: --prior_data
__merge__: file_prior.yaml
direction: input
Expand Down
6 changes: 5 additions & 1 deletion src/api/comp_metric.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ functionality:
direction: input
default: ridge
description: name of regretion to use
multiple: true
multiple: false
info:
test_default: ridge
- name: --subsample
type: integer
direction: input
default: -1
description: number of samples randomly drawn from perturbation data
info:
test_default: 200

test_resources:
- type: python_script
Expand Down
2 changes: 1 addition & 1 deletion src/api/file_multiomics_atac_h5ad.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: file
example: resources/grn-benchmark/multiomics_atac.h5ad
example: resources_test/grn-benchmark/multiomics_atac.h5ad
info:
label: multiomics atac
summary: "Peak data for multiomics data."
Expand Down
2 changes: 1 addition & 1 deletion src/api/file_multiomics_rna_h5ad.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
type: file
example: resources/grn-benchmark/multiomics_rna.h5ad
example: resources_test/grn-benchmark/multiomics_rna.h5ad
info:
label: multiomics rna
summary: "RNA expression for multiomics data."
Expand Down
4 changes: 2 additions & 2 deletions src/api/file_perturbation_h5ad.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ info:
- name: pearson
type: double
description: "Normalized values using pearson residuals"
required: true
required: false
- name: lognorm
type: double
description: "Normalized values using shifted logarithm "
required: true
required: false

6 changes: 3 additions & 3 deletions src/control_methods/negative_control/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
## VIASH START
par = {
"perturbation_data": "resources/grn-benchmark/perturbation_data.h5ad",
"layer": "lognorm",
"layer": "scgen_pearson",
"prior_data": "resources/grn-benchmark/prior_data.h5ad",
"output": "resources/grn-benchmark/negative_control.csv",
"prediction": "output/negative_control.csv",
}
## VIASH END
print('Reading input data')
Expand All @@ -30,5 +30,5 @@ def create_negative_control(gene_names) -> np.ndarray:
pivoted_net = pivoted_net[pivoted_net['weight'] != 0]

print('Saving')
pivoted_net.to_csv(par["output"])
pivoted_net.to_csv(par["prediction"])

4 changes: 2 additions & 2 deletions src/control_methods/positive_control/script.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
## VIASH START
par = {
"perturbation_data": "resources/grn-benchmark/perturbation_data.h5ad",
"layer": "lognorm",
"layer": "scgen_pearson",
"prior_data": "resources/grn-benchmark/prior_data.h5ad",
"prediction": "resources/grn-benchmark/positive_control.csv",
"prediction": "output/positive_control.csv",
}
## VIASH END
print('Reading input data')
Expand Down
4 changes: 2 additions & 2 deletions src/metrics/regression_1/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def cv_5(genes_n):
def run_method_1(
net: pd.DataFrame,
train_df: pd.DataFrame,
reg_type: str = 'GRB',
reg_type: str = 'GB',
exclude_missing_genes: bool = False,
verbose: int = 0) -> None:
"""
Expand All @@ -73,8 +73,8 @@ def run_method_1(
regr = lightgbm_wrapper(dict(random_state=32, n_estimators=100, min_samples_leaf=2, min_child_samples=1, feature_fraction=0.05, verbosity=-1))
elif reg_type=='RF':
regr = lightgbm_wrapper(dict(boosting_type='rf',random_state=32, n_estimators=100, feature_fraction=0.05, verbosity=-1))

else:
print(f'{reg_type} is not defined')
raise ValueError("define first")

n_tfs = net.shape[1]
Expand Down

0 comments on commit 6bf5ab2

Please sign in to comment.