Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JgiMg and JgiMt: Add rule that requires a dna_cont_well when the dna_cont_type is "plate" #59

Closed
turbomam opened this issue Mar 24, 2023 · 7 comments
Assignees
Labels

Comments

@turbomam
Copy link
Member

But not vice versa

@turbomam turbomam self-assigned this Mar 24, 2023
@turbomam turbomam changed the title JgiMg and JgiMt: Add rule that requires a well position when the container is a plate JgiMg and JgiMt: Add rule that requires a dna_cont_well when the dna_cont_type is "plate" Mar 24, 2023
@turbomam
Copy link
Member Author

https://github.com/microbiomedata/nmdc-schema/blob/6455ce2350c134ecce12c993d429d26883f39b6f/src/schema/nmdc.yaml#L227-L250

  Biosample:
    rules:
      - description: Samples in tubes can't have a plate position.
          But plate_position currently does have to be asserted as an empty string.
          Can't be null, None, un-asserted,etc.
          Had wanted to use value_present, but that may not be implemented in the linkml-runtime yet.
        preconditions:
          slot_conditions:
            dna_cont_type:
              equals_string: tube
        postconditions:
          slot_conditions:
            dna_cont_well:
              none_of:
                pattern: ".+"
      - description: Samples in plates must have a plate position that matches the regex. Note the requirement for an empty string in the tube case. Waiting for value_present validation to be added to runtime
        preconditions:
          slot_conditions:
            dna_cont_type:
              equals_string: plate
        postconditions:
          slot_conditions:
            dna_cont_well:
              pattern: ^(?!A1|A12|H1|H12)(([A-H][1-9])|([A-H]1[0-2]))$

@turbomam
Copy link
Member Author

turbomam commented Mar 24, 2023

try a simpler rule first?

  • when the dna_cont_type= plate, then the dna_volume must be less than 1 (mL?)
  • when the dna_cont_type = tube, then the dna_volume must be greater than 1

@turbomam
Copy link
Member Author

JgiMgInterface:
  rules:
    - preconditions:
        slot_conditions:
          dna_cont_type:
            equals_string: plate
      postconditions:
        slot_conditions:
          dna_volume:
            maximum_value: 1
    - preconditions:
        slot_conditions:
          dna_cont_type:
            equals_string: tube
      postconditions:
        slot_conditions:
          dna_volume:
            minimum_value: 1

@turbomam
Copy link
Member Author

[{"preconditions":{"slot_conditions":{"dna_cont_type":{"equals_string":"plate"}}},"postconditions":{"slot_conditions":{"dna_volume":{"maximum_value":1}}}},{"preconditions":{"slot_conditions":{"dna_cont_type":{"equals_string":"tube"}}},"postconditions":{"slot_conditions":{"dna_volume":{"minimum_value":1}}}}]

@turbomam
Copy link
Member Author

yq -i '(.classes.[] | select(.name == "JgiMgInterface") | .rules) = [{"preconditions":{"slot_conditions":{"dna_cont_type":{"equals_string":"plate"}}},"postconditions":{"slot_conditions":{"dna_volume":{"maximum_value":1}}}},{"preconditions":{"slot_conditions":{"dna_cont_type":{"equals_string":"tube"}}},"postconditions":{"slot_conditions":{"dna_volume":{"minimum_value":1}}}}]' local/with_modifications.yaml

@turbomam
Copy link
Member Author

@pkalita-lbl will be working on the emission of rules by gen-jsonschema

@mslarae13
Copy link
Contributor

Duplicate microbiomedata/nmdc-schema#1433

Closing in favor of the issue that includes DNA/RNA plate and other slot dependancies.

@turbomam turbomam added the yq label Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants